/* =========================================================
   E.C.C.O. / e-Parti — design system professionnel
   Bleu #30A2DE · Jaune #F0D74D · Rouge #D32125
   ========================================================= */

@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Sora:wght@600;700;800&display=swap");

:root {
  --ep-blue: #30a2de;
  --ep-blue-dark: #1a7fb8;
  --ep-blue-deeper: #0e5f8c;
  --ep-blue-soft: #e8f5fc;
  --ep-yellow: #f0d74d;
  --ep-yellow-dark: #d4b820;
  --ep-red: #d32125;
  --ep-ink: #13222c;
  --ep-muted: #5a6b76;
  --ep-surface: #ffffff;
  --ep-bg: #f4f8fb;
  --ep-border: rgba(48, 162, 222, 0.16);
  --ep-shadow: 0 8px 24px rgba(14, 95, 140, 0.08);
  --ep-shadow-sm: 0 2px 8px rgba(14, 95, 140, 0.06);
  --ep-radius: 0.85rem;
  --ep-radius-sm: 0.55rem;
  --ep-font: "Manrope", sans-serif;
  --ep-display: "Sora", "Manrope", sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
  color: var(--ep-ink);
  font-family: var(--ep-font);
  font-size: 0.95rem;
  line-height: 1.55;
  background:
    radial-gradient(ellipse 80% 50% at 100% -10%, rgba(48, 162, 222, 0.14), transparent 55%),
    radial-gradient(ellipse 60% 40% at 0% 100%, rgba(240, 215, 77, 0.08), transparent 50%),
    linear-gradient(180deg, #eef6fb 0%, var(--ep-bg) 45%, #f7fafc 100%);
  background-attachment: fixed;
}

a {
  color: var(--ep-blue-dark);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover { color: var(--ep-blue-deeper); }

/* ---------- Navbar ---------- */
.eparti-nav {
  background:
    linear-gradient(115deg, rgba(14, 95, 140, 0.96) 0%, rgba(26, 127, 184, 0.94) 48%, rgba(48, 162, 222, 0.92) 100%);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 28px rgba(14, 95, 140, 0.22);
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
  z-index: 1030;
}
.eparti-nav::after {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--ep-yellow) 0%, var(--ep-red) 50%, var(--ep-yellow) 100%);
}
.eparti-nav .navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: #fff !important;
  font-family: var(--ep-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  transition: transform 0.18s ease;
}
.eparti-nav .navbar-brand:hover { transform: translateY(-1px); }

.brand-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 50%;
  background: #000;
  padding: 2px;
  box-shadow:
    0 0 0 2px var(--ep-yellow),
    0 6px 14px rgba(0, 0, 0, 0.25);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text .brand-name { font-size: 1.15rem; }
.brand-text .brand-tag {
  font-family: var(--ep-font);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ep-yellow);
}

.nav-toggler-ep {
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 0.6rem;
  padding: 0.4rem 0.55rem;
}
.nav-toggler-ep:focus {
  box-shadow: 0 0 0 0.2rem rgba(240, 215, 77, 0.35);
}

.nav-shell {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 0.28rem;
  backdrop-filter: blur(8px);
}

.nav-pills-ep {
  gap: 0.15rem;
  align-items: center;
}

.eparti-nav .nav-pills-ep .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: rgba(255, 255, 255, 0.88) !important;
  font-weight: 600;
  font-size: 0.86rem;
  padding: 0.45rem 0.9rem !important;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
  white-space: nowrap;
}
.eparti-nav .nav-pills-ep .nav-link .nav-ico {
  font-size: 0.85rem;
  opacity: 0.85;
  line-height: 1;
}
.eparti-nav .nav-pills-ep .nav-link:hover,
.eparti-nav .nav-pills-ep .nav-link:focus {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}
.eparti-nav .nav-pills-ep .nav-link.active {
  color: var(--ep-blue-deeper) !important;
  background: #fff;
  border-color: rgba(255, 255, 255, 0.7);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}
.eparti-nav .nav-pills-ep .nav-link.active .nav-ico {
  color: var(--ep-blue);
  opacity: 1;
}

.nav-aside {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-left: 0.75rem;
  flex-wrap: wrap;
}

.btn-nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ep-yellow) !important;
  color: var(--ep-ink) !important;
  font-weight: 800 !important;
  font-size: 0.86rem;
  letter-spacing: 0.02em;
  border-radius: 999px !important;
  padding: 0.5rem 1.15rem !important;
  text-decoration: none !important;
  box-shadow: 0 6px 16px rgba(240, 215, 77, 0.35);
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.btn-nav-cta:hover {
  background: #fff !important;
  color: var(--ep-blue-deeper) !important;
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(255, 255, 255, 0.2);
}

.btn-nav-login {
  display: inline-flex;
  align-items: center;
  color: #fff !important;
  font-weight: 700;
  font-size: 0.86rem;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none !important;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.btn-nav-login:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: #fff;
}

.nav-user {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 0.28rem 0.45rem 0.28rem 0.28rem;
}
.nav-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, var(--ep-yellow), #ffe98a);
  color: var(--ep-blue-deeper);
  font-weight: 800;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.nav-user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
  max-width: 120px;
}
.nav-user-name {
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-user-role {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.nav-logout {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff !important;
  text-decoration: none !important;
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.95rem;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-logout:hover {
  background: var(--ep-red);
  color: #fff !important;
}

@media (max-width: 991.98px) {
  .nav-shell {
    border-radius: 1rem;
    margin: 0.85rem 0 0.5rem;
    padding: 0.45rem;
  }
  .nav-pills-ep {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }
  .eparti-nav .nav-pills-ep .nav-link {
    width: 100%;
    justify-content: flex-start;
  }
  .nav-aside {
    width: 100%;
    margin: 0.5rem 0 0.25rem;
    justify-content: space-between;
  }
  .nav-user {
    flex: 1;
  }
  .nav-user-meta { max-width: none; }
  .brand-text .brand-tag { display: none; }
}

/* ---------- Page header (listes / forms / détails) ---------- */
.page-header {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1.15rem 1.25rem 1.2rem;
  background:
    linear-gradient(135deg, rgba(232, 245, 252, 0.95) 0%, rgba(255, 255, 255, 0.92) 55%, rgba(240, 215, 77, 0.12) 100%);
  border: 1px solid var(--ep-border);
  border-radius: var(--ep-radius);
  box-shadow: var(--ep-shadow-sm);
  overflow: hidden;
  animation: page-in 0.45s ease both;
}
.page-header::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: linear-gradient(180deg, var(--ep-blue), var(--ep-yellow), var(--ep-red));
}
.page-header-text { min-width: 0; flex: 1; padding-left: 0.35rem; }
.page-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ep-blue-dark);
  background: rgba(48, 162, 222, 0.12);
  border: 1px solid rgba(48, 162, 222, 0.2);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  margin-bottom: 0.55rem;
}
.page-title {
  font-family: var(--ep-display);
  font-weight: 800;
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  color: var(--ep-blue-deeper);
  letter-spacing: -0.03em;
  margin: 0;
  line-height: 1.2;
}
.page-subtitle {
  color: var(--ep-muted);
  font-size: 0.93rem;
  margin: 0.45rem 0 0;
  max-width: 42rem;
}
.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}
.breadcrumb-ep {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.84rem;
  color: var(--ep-muted);
  margin-bottom: 0.85rem;
  padding: 0.35rem 0.75rem;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--ep-border);
  border-radius: 999px;
}
.breadcrumb-ep a { font-weight: 700; }
.breadcrumb-ep .sep { opacity: 0.45; }

@keyframes page-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-title {
  font-family: var(--ep-display);
  color: var(--ep-blue-deeper);
  font-weight: 700;
  position: relative;
  padding-bottom: 0.55rem;
  margin-bottom: 1.25rem;
}
.section-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 56px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--ep-blue), var(--ep-yellow));
}

/* ---------- Panels / surfaces ---------- */
.panel,
.form-section,
.filter-bar,
.table-panel {
  background: var(--ep-surface);
  border: 1px solid var(--ep-border);
  border-radius: calc(var(--ep-radius) + 0.1rem);
  box-shadow: var(--ep-shadow-sm);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.panel:hover,
.form-section:hover,
.table-panel:hover {
  box-shadow: var(--ep-shadow);
}

.panel,
.form-section {
  position: relative;
  padding: 1.35rem 1.5rem 1.45rem;
  margin-bottom: 1.15rem;
  overflow: hidden;
  animation: page-in 0.5s ease both;
}
.form-section:nth-of-type(2) { animation-delay: 0.05s; }
.form-section:nth-of-type(3) { animation-delay: 0.1s; }
.form-section:nth-of-type(4) { animation-delay: 0.15s; }

.form-section::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--ep-blue), var(--ep-yellow));
}

.panel-header,
.form-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: -1.35rem -1.5rem 1.2rem;
  padding: 0.95rem 1.5rem;
  background:
    linear-gradient(105deg, rgba(48, 162, 222, 0.14) 0%, rgba(255, 255, 255, 0.95) 60%);
  border-bottom: 1px solid var(--ep-border);
  border-radius: calc(var(--ep-radius) + 0.1rem) calc(var(--ep-radius) + 0.1rem) 0 0;
}
.panel-header h5,
.form-section-header h5,
.form-section h5 {
  font-family: var(--ep-display);
  color: var(--ep-blue-deeper);
  font-weight: 700;
  font-size: 1.02rem;
  margin: 0;
}
.form-section h5 {
  display: flex;
  align-items: center;
  margin: -0.2rem 0 1.15rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px dashed rgba(48, 162, 222, 0.28);
}
.form-section h5 .step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  margin-right: 0.55rem;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--ep-blue), var(--ep-blue-deeper));
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
  font-family: var(--ep-font);
  box-shadow: 0 4px 10px rgba(48, 162, 222, 0.35);
}

/* ---------- Formulaire compact (adhésion) ---------- */
.page-header-compact {
  padding: 0.85rem 1.1rem;
  margin-bottom: 0.85rem;
}
.page-header-compact .page-title {
  font-size: 1.45rem;
}
.page-header-compact .page-subtitle {
  margin-bottom: 0;
  font-size: 0.88rem;
}
.form-compact .form-section {
  padding: 0.85rem 1rem 0.95rem;
  margin-bottom: 0.7rem;
}
.form-compact .form-section h5 {
  margin: 0 0 0.65rem;
  padding-bottom: 0.45rem;
  font-size: 0.95rem;
}
.form-compact .form-section h5 .step {
  width: 1.45rem;
  height: 1.45rem;
  margin-right: 0.4rem;
  font-size: 0.72rem;
}
.form-compact .form-label {
  margin-bottom: 0.2rem;
  font-size: 0.78rem;
}
.form-compact .form-control,
.form-compact .form-select {
  padding: 0.42rem 0.7rem;
  font-size: 0.88rem;
  border-radius: 0.55rem;
}
.form-compact .form-control:focus,
.form-compact .form-select:focus {
  transform: none;
}
.form-compact .form-check {
  padding: 0.4rem 0.65rem;
  border-radius: 0.55rem;
}
.form-compact .form-actions {
  margin-top: 0.75rem;
  padding-top: 0.7rem;
}
.form-compact #details-membre-wrap[hidden] {
  display: none !important;
}

/* ---------- Filter bar ---------- */
.filter-bar {
  position: relative;
  padding: 1rem 1.15rem;
  margin-bottom: 1.15rem;
  background:
    linear-gradient(180deg, #fff 0%, #f7fbfe 100%);
  animation: page-in 0.4s ease both;
}
.filter-bar::after {
  content: "";
  position: absolute;
  left: 1.15rem;
  right: 1.15rem;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--ep-blue), transparent);
  opacity: 0.35;
}
.filter-bar .form-control,
.filter-bar .form-select {
  border-radius: 0.7rem;
  background: #fff;
  min-height: 2.55rem;
}

/* ---------- Forms ---------- */
.form-label {
  font-weight: 700;
  color: var(--ep-blue-deeper);
  font-size: 0.82rem;
  letter-spacing: 0.01em;
  margin-bottom: 0.4rem;
}
.form-control,
.form-select {
  border: 1.5px solid rgba(48, 162, 222, 0.22);
  border-radius: 0.7rem;
  padding: 0.62rem 0.85rem;
  font-size: 0.93rem;
  color: var(--ep-ink);
  background: linear-gradient(180deg, #fff, #fbfdff);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.form-control:hover,
.form-select:hover {
  border-color: rgba(48, 162, 222, 0.45);
}
.form-control:focus,
.form-select:focus {
  border-color: var(--ep-blue);
  box-shadow: 0 0 0 0.22rem rgba(48, 162, 222, 0.16);
  background: #fff;
  transform: translateY(-1px);
}
.form-control::placeholder { color: #9aabb6; }
.form-text { color: var(--ep-muted); font-size: 0.8rem; }
.form-check {
  padding: 0.65rem 0.85rem;
  background: var(--ep-blue-soft);
  border: 1px solid rgba(48, 162, 222, 0.18);
  border-radius: 0.7rem;
}
.form-check-input {
  width: 1.1em;
  height: 1.1em;
  margin-top: 0.15em;
}
.form-check-input:checked {
  background-color: var(--ep-blue);
  border-color: var(--ep-blue);
}
.form-check-label { font-weight: 600; color: var(--ep-ink); }
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
  margin-top: 1.35rem;
  padding: 1rem 0 0;
  border-top: 1px dashed rgba(48, 162, 222, 0.28);
}
.field-error,
.text-danger.small {
  color: var(--ep-red) !important;
  font-size: 0.8rem;
  margin-top: 0.3rem;
  font-weight: 600;
}

/* ---------- Buttons ---------- */
.btn {
  font-weight: 600;
  border-radius: var(--ep-radius-sm);
  padding: 0.48rem 1rem;
  font-size: 0.9rem;
}
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.82rem; }
.btn-lg { padding: 0.65rem 1.35rem; font-size: 1rem; border-radius: 0.7rem; }

.btn-gold,
.btn-primary-ep {
  background: var(--ep-yellow);
  color: var(--ep-ink);
  font-weight: 700;
  border: none;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(240, 215, 77, 0.3);
}
.btn-gold:hover,
.btn-primary-ep:hover {
  background: #ffe566;
  color: var(--ep-ink);
}

.btn-blue,
.btn-success {
  background: var(--ep-blue) !important;
  border-color: var(--ep-blue) !important;
  color: #fff !important;
}
.btn-blue:hover,
.btn-success:hover {
  background: var(--ep-blue-dark) !important;
  border-color: var(--ep-blue-dark) !important;
}
.btn-outline-success,
.btn-outline-primary {
  color: var(--ep-blue-dark) !important;
  border-color: rgba(48, 162, 222, 0.55) !important;
  background: #fff;
}
.btn-outline-success:hover,
.btn-outline-primary:hover {
  background: var(--ep-blue) !important;
  border-color: var(--ep-blue) !important;
  color: #fff !important;
}
.btn-outline-secondary {
  border-color: rgba(90, 107, 118, 0.35);
  color: var(--ep-muted);
}
.btn-outline-secondary:hover {
  background: var(--ep-blue-soft);
  border-color: var(--ep-blue);
  color: var(--ep-blue-deeper);
}
.btn-outline-danger {
  border-color: rgba(211, 33, 37, 0.45);
  color: var(--ep-red);
}
.btn-outline-danger:hover {
  background: var(--ep-red);
  border-color: var(--ep-red);
  color: #fff;
}
.btn-outline-light {
  border-width: 2px;
  border-radius: 999px;
  font-weight: 600;
}
.btn-link-ep {
  color: var(--ep-blue-dark);
  font-weight: 700;
  font-size: 0.86rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid transparent;
}
.btn-link-ep:hover {
  background: var(--ep-blue-soft);
  border-color: rgba(48, 162, 222, 0.25);
  color: var(--ep-blue-deeper);
}

/* ---------- Tables / listes ---------- */
.table-panel {
  overflow: hidden;
  margin-bottom: 1.15rem;
  animation: page-in 0.5s ease both;
}
.table-panel .table { margin: 0; }
.table thead th {
  background: linear-gradient(180deg, #eaf5fb 0%, #dff0f9 100%);
  color: var(--ep-blue-deeper);
  font-weight: 800;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid rgba(48, 162, 222, 0.22);
  padding: 0.95rem 1.05rem;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}
.table > :not(caption) > * > * {
  border-color: rgba(48, 162, 222, 0.12);
  padding: 0.9rem 1.05rem;
  vertical-align: middle;
}
.table tbody tr {
  transition: background 0.15s ease, transform 0.15s ease;
}
.table-hover tbody tr:hover {
  background: linear-gradient(90deg, rgba(48, 162, 222, 0.08), rgba(240, 215, 77, 0.08));
}
.table td {
  color: var(--ep-ink);
  font-size: 0.92rem;
}
.table .cell-muted { color: var(--ep-muted); font-size: 0.88rem; }
.table .cell-strong {
  font-weight: 700;
  color: var(--ep-blue-deeper);
  font-family: var(--ep-display);
  font-size: 0.95rem;
}
.person-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}
.person-avatar {
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, var(--ep-blue), var(--ep-blue-deeper));
  color: #fff;
  font-weight: 800;
  font-size: 0.78rem;
  flex-shrink: 0;
  box-shadow: 0 3px 8px rgba(14, 95, 140, 0.25);
}
.empty-state {
  text-align: center;
  padding: 2.75rem 1.5rem;
  color: var(--ep-muted);
  background:
    radial-gradient(circle at top, rgba(48, 162, 222, 0.08), transparent 55%);
}
.empty-state strong {
  display: block;
  color: var(--ep-blue-deeper);
  font-family: var(--ep-display);
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
}

.list-stack { display: flex; flex-direction: column; gap: 0.85rem; }
.list-item-card {
  position: relative;
  background: var(--ep-surface);
  border: 1px solid var(--ep-border);
  border-radius: var(--ep-radius);
  padding: 1.1rem 1.25rem 1.1rem 1.35rem;
  box-shadow: var(--ep-shadow-sm);
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.list-item-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--ep-blue), var(--ep-yellow));
}
.list-item-card:hover {
  border-color: rgba(48, 162, 222, 0.4);
  box-shadow: var(--ep-shadow);
  transform: translateY(-2px);
}

/* ---------- Detail pages ---------- */
.detail-layout {
  display: grid;
  gap: 1.15rem;
  animation: page-in 0.45s ease both;
}
@media (min-width: 992px) {
  .detail-layout { grid-template-columns: 1fr 310px; align-items: start; }
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}
@media (max-width: 767px) {
  .detail-grid { grid-template-columns: 1fr; }
}
.detail-field {
  position: relative;
  padding: 0.85rem 0.95rem;
  background: linear-gradient(180deg, #f8fcfe, #f2f8fb);
  border: 1px solid rgba(48, 162, 222, 0.14);
  border-radius: 0.75rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.detail-field:hover {
  border-color: rgba(48, 162, 222, 0.35);
  box-shadow: 0 6px 16px rgba(14, 95, 140, 0.08);
  transform: translateY(-1px);
}
.detail-field .label {
  display: block;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ep-blue);
  margin-bottom: 0.3rem;
}
.detail-field .value {
  font-weight: 600;
  color: var(--ep-ink);
  word-break: break-word;
  line-height: 1.4;
}
.detail-block {
  margin-top: 1.15rem;
  padding: 1rem 1.05rem;
  border: 1px dashed rgba(48, 162, 222, 0.3);
  border-radius: 0.75rem;
  background: rgba(48, 162, 222, 0.04);
}
.detail-block .label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ep-blue);
  margin-bottom: 0.4rem;
}
.sidebar-card {
  background:
    linear-gradient(180deg, #fff 0%, #f7fbfe 100%);
  border: 1px solid var(--ep-border);
  border-radius: calc(var(--ep-radius) + 0.1rem);
  padding: 1.2rem;
  box-shadow: var(--ep-shadow);
  position: sticky;
  top: 5.5rem;
  overflow: hidden;
}
.sidebar-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--ep-blue), var(--ep-yellow), var(--ep-red));
}
.sidebar-card .photo-frame {
  border-radius: 0.85rem;
  overflow: hidden;
  border: 3px solid #fff;
  margin: 0 auto 1rem;
  max-width: 150px;
  background: var(--ep-blue-soft);
  box-shadow:
    0 0 0 2px var(--ep-blue),
    0 10px 24px rgba(14, 95, 140, 0.18);
}
.sidebar-card .photo-frame img {
  width: 100%;
  display: block;
  object-fit: cover;
  aspect-ratio: 3 / 4;
  max-height: 190px;
}
.action-stack { display: flex; flex-direction: column; gap: 0.6rem; }

/* ---------- Détail membre compact ---------- */
.detail-compact {
  gap: 0.7rem;
}
@media (min-width: 992px) {
  .detail-compact {
    grid-template-columns: 1fr 180px;
  }
}
.detail-compact .panel {
  padding: 0;
  margin-bottom: 0.7rem;
}
.detail-compact .panel-header {
  margin: 0;
  padding: 0.55rem 0.85rem;
  border-radius: calc(var(--ep-radius) + 0.1rem) calc(var(--ep-radius) + 0.1rem) 0 0;
}
.detail-compact .panel-header h5 {
  font-size: 0.9rem;
}
.detail-compact .detail-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
  padding: 0.7rem 0.85rem 0.85rem;
}
@media (max-width: 991.98px) {
  .detail-compact .detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 575.98px) {
  .detail-compact .detail-grid {
    grid-template-columns: 1fr;
  }
}
.detail-compact .detail-field {
  padding: 0.45rem 0.6rem;
  border-radius: 0.55rem;
}
.detail-compact .detail-field:hover {
  transform: none;
  box-shadow: none;
}
.detail-compact .detail-field .label {
  font-size: 0.65rem;
  margin-bottom: 0.15rem;
  letter-spacing: 0.04em;
}
.detail-compact .detail-field .value {
  font-size: 0.88rem;
  line-height: 1.3;
}
.detail-compact .detail-block {
  margin: 0 0.85rem 0.85rem;
  padding: 0.55rem 0.7rem;
  border-radius: 0.55rem;
}
.detail-compact .detail-block .label {
  margin-bottom: 0.2rem;
}
.detail-compact .detail-block p {
  font-size: 0.88rem;
  line-height: 1.35;
}
.detail-compact .form-actions {
  margin: 0 0.85rem 0.85rem;
  padding-top: 0.55rem;
  margin-top: 0;
}
.detail-compact .sidebar-card {
  padding: 0.85rem;
}
.detail-compact .sidebar-card .photo-frame {
  margin: 0 auto 0.55rem;
  max-width: 84px;
  border-width: 2px;
  border-radius: 0.45rem;
  box-shadow:
    0 0 0 1px var(--ep-blue),
    0 4px 10px rgba(14, 95, 140, 0.12);
}
.detail-compact .sidebar-card .photo-frame img {
  max-height: 105px;
}
.detail-compact .photo-frame-empty {
  aspect-ratio: 3 / 4;
  min-height: 0;
  max-width: 84px;
  max-height: 105px;
}
.detail-compact .photo-frame-empty .person-avatar {
  width: 1.85rem;
  height: 1.85rem;
  font-size: 0.85rem;
}
.detail-compact .sidebar-photo-extra {
  margin-bottom: 0.55rem;
  max-width: 84px;
  margin-left: auto;
  margin-right: auto;
}
.detail-compact .sidebar-photo-extra .label {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ep-blue);
  margin-bottom: 0.25rem;
  text-align: center;
}
.detail-compact .sidebar-photo-extra img {
  border: 1px solid var(--ep-border);
  max-height: 72px;
  width: 100%;
  object-fit: cover;
}
.detail-compact .action-stack {
  gap: 0.4rem;
}

/* ---------- Badges ---------- */
.badge {
  font-weight: 800;
  font-size: 0.7rem;
  letter-spacing: 0.03em;
  padding: 0.45em 0.8em;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}
.badge-attente,
.badge-en_attente {
  background: linear-gradient(145deg, var(--ep-yellow), #ffe566);
  color: var(--ep-ink);
}
.badge-valide {
  background: linear-gradient(145deg, var(--ep-blue), var(--ep-blue-dark));
  color: #fff;
}
.badge-rejete {
  background: linear-gradient(145deg, #e64548, var(--ep-red));
  color: #fff;
}
.badge.bg-secondary {
  background: linear-gradient(145deg, var(--ep-blue-dark), var(--ep-blue-deeper)) !important;
}

/* ---------- Stats / charts / hero ---------- */
.stat-card {
  background: var(--ep-surface);
  border: 1px solid var(--ep-border);
  border-left: 4px solid var(--ep-blue);
  border-radius: var(--ep-radius);
  box-shadow: var(--ep-shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--ep-shadow);
}
.stat-card.accent-yellow { border-left-color: var(--ep-yellow); }
.stat-card.accent-red { border-left-color: var(--ep-red); }
.stat-card.accent-blue { border-left-color: var(--ep-blue); }
.stat-value {
  font-family: var(--ep-display);
  font-weight: 800;
  color: var(--ep-blue-deeper);
  letter-spacing: -0.02em;
}
.stat-value.text-warning { color: var(--ep-yellow-dark) !important; }
.stat-value.text-danger { color: var(--ep-red) !important; }
.stat-value.text-success { color: var(--ep-blue-dark) !important; }

.chart-panel h5 { margin-bottom: 0.75rem; }
.chart-wrap { position: relative; height: 180px; width: 100%; }
.chart-wrap-sm { height: 160px; }

.hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  border-radius: calc(var(--ep-radius) + 0.15rem);
  padding: clamp(2.2rem, 5vw, 3.75rem) clamp(1.35rem, 4vw, 2.75rem);
  background:
    linear-gradient(125deg, rgba(14, 95, 140, 0.94) 0%, rgba(26, 127, 184, 0.88) 48%, rgba(48, 162, 222, 0.82) 100%),
    url("../img/hero-pattern.svg");
  background-size: cover, 28px 28px;
  box-shadow: var(--ep-shadow);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, transparent 55%, rgba(211, 33, 37, 0.16) 100%);
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--ep-yellow), var(--ep-red), var(--ep-yellow));
}
.hero > * { position: relative; z-index: 1; }
.hero-brand { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.1rem; }
.hero-logo {
  width: clamp(80px, 12vw, 112px);
  height: clamp(80px, 12vw, 112px);
  object-fit: contain;
  border-radius: 50%;
  background: #000;
  padding: 5px;
  box-shadow: 0 0 0 3px var(--ep-yellow), 0 10px 24px rgba(0, 0, 0, 0.22);
}
.hero-title {
  font-family: var(--ep-display);
  font-weight: 800;
  font-size: clamp(1.8rem, 4.5vw, 2.9rem);
  letter-spacing: -0.03em;
  margin: 0 0 0.3rem;
}
.hero-slogan {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ep-yellow);
  margin-bottom: 0.85rem;
}
.hero .lead { max-width: 34rem; font-size: 1.02rem; opacity: 0.95; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.25rem; }

/* ---------- Accueil : campagnes (slider) ---------- */
.home-campagnes {
  margin-bottom: 1.75rem;
  animation: page-in 0.5s ease 0.06s both;
}
.home-campagnes-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.85rem;
  margin-bottom: 1rem;
}
.home-campagnes-header .section-title {
  margin-bottom: 0;
  padding-bottom: 0.4rem;
}
.home-campagnes-slider {
  position: relative;
  padding: 0 2.4rem 1.6rem;
}
.home-campagnes-viewport {
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  outline: none;
}
.home-campagnes-viewport::-webkit-scrollbar { display: none; }
.home-campagnes-track {
  display: flex;
  gap: 0.9rem;
  padding: 0.15rem 0.1rem 0.35rem;
}
.home-campagne-card {
  flex: 0 0 calc((100% - 0.9rem) / 2);
  width: calc((100% - 0.9rem) / 2);
  max-width: none;
  scroll-snap-align: start;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.95rem;
  align-items: start;
  min-height: 8.5rem;
  padding: 1rem 1.05rem;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98) 0%, rgba(232, 245, 252, 0.65) 100%);
  border: 1px solid var(--ep-border);
  border-radius: var(--ep-radius);
  box-shadow: var(--ep-shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.home-campagne-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--ep-shadow);
  border-color: rgba(48, 162, 222, 0.35);
}
.home-campagne-card.is-past {
  opacity: 0.82;
}
.home-campagne-card.is-past .home-campagne-date {
  background: linear-gradient(160deg, #5a6b76, #7a8a95);
}
.home-campagne-card.is-past .home-campagne-type {
  color: var(--ep-muted);
  background: rgba(90, 107, 118, 0.1);
  border-color: rgba(90, 107, 118, 0.2);
}
.home-campagne-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 3.6rem;
  padding: 0.55rem 0.45rem;
  border-radius: var(--ep-radius-sm);
  background: linear-gradient(160deg, var(--ep-blue-deeper), var(--ep-blue));
  color: #fff;
  text-align: center;
  line-height: 1.15;
}
.home-campagne-day {
  font-family: var(--ep-display);
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.home-campagne-month {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.92;
}
.home-campagne-time {
  margin-top: 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  opacity: 0.85;
}
.home-campagne-type {
  display: inline-flex;
  margin-bottom: 0.35rem;
  padding: 0.15rem 0.5rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ep-blue-dark);
  background: rgba(48, 162, 222, 0.12);
  border: 1px solid rgba(48, 162, 222, 0.2);
  border-radius: 999px;
}
.home-campagne-title {
  font-family: var(--ep-display);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ep-blue-deeper);
  margin: 0 0 0.3rem;
  line-height: 1.3;
}
.home-campagne-meta {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ep-muted);
}
.home-campagne-desc {
  margin: 0.45rem 0 0;
  font-size: 0.88rem;
  color: var(--ep-ink);
  line-height: 1.45;
}
.home-campagnes-nav {
  position: absolute;
  top: calc(50% - 0.9rem);
  transform: translateY(-50%);
  z-index: 2;
  width: 2.2rem;
  height: 2.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(48, 162, 222, 0.3);
  border-radius: 50%;
  background: #fff;
  color: var(--ep-blue-deeper);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: var(--ep-shadow-sm);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.home-campagnes-nav:hover {
  background: var(--ep-blue-soft);
  border-color: var(--ep-blue);
}
.home-campagnes-nav:active { transform: translateY(-50%) scale(0.96); }
.home-campagnes-nav--prev { left: 0; }
.home-campagnes-nav--next { right: 0; }
.home-campagnes-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  gap: 0.4rem;
}
.home-campagnes-dot {
  width: 0.55rem;
  height: 0.55rem;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(48, 162, 222, 0.28);
  cursor: pointer;
  transition: width 0.2s ease, background 0.2s ease;
}
.home-campagnes-dot.is-active {
  width: 1.35rem;
  background: linear-gradient(90deg, var(--ep-blue), var(--ep-blue-dark));
}

@media (max-width: 767.98px) {
  .home-campagnes-slider { padding: 0 0 1.55rem; }
  .home-campagnes-nav { display: none; }
  .home-campagne-card {
    flex-basis: 100%;
    width: 100%;
  }
}


/* ---------- Login / misc ---------- */
.login-panel { border-top: 4px solid var(--ep-blue); }
.login-logo {
  width: 84px;
  height: 84px;
  object-fit: contain;
  border-radius: 50%;
  background: #000;
  padding: 4px;
  margin: 0 auto 1rem;
  display: block;
  box-shadow: 0 0 0 3px var(--ep-yellow);
}
.card-preview {
  max-width: 520px;
  border: 1px solid var(--ep-border);
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: var(--ep-shadow);
  background: #fff;
}
.btn-success,
.btn-blue,
.btn-outline-success,
.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-danger {
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn-success:hover,
.btn-blue:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(48, 162, 222, 0.28);
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: linear-gradient(145deg, var(--ep-blue-soft), #fff);
  color: var(--ep-blue-deeper);
  border: 1px solid rgba(48, 162, 222, 0.25);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 700;
}

/* ---------- Alerts / footer ---------- */
.alert {
  border-radius: var(--ep-radius-sm);
  border: 1px solid transparent;
}
.alert-success {
  background: var(--ep-blue-soft);
  border-color: rgba(48, 162, 222, 0.35);
  color: var(--ep-blue-deeper);
}
.alert-danger {
  background: #fdecec;
  border-color: rgba(211, 33, 37, 0.25);
  color: #8f1518;
}
.alert-warning {
  background: #fff8e1;
  border-color: rgba(240, 215, 77, 0.5);
  color: #7a6500;
}
.text-success { color: var(--ep-blue-dark) !important; }

.eparti-footer {
  background: linear-gradient(90deg, var(--ep-blue-deeper), var(--ep-blue-dark));
  color: rgba(255, 255, 255, 0.8);
  margin-top: auto;
  border-top: 3px solid var(--ep-yellow);
}
.eparti-footer strong { color: var(--ep-yellow); }

.list-group-item { border-color: var(--ep-border); }

/* =========================================================
   RESPONSIVE — tablette & mobile
   ========================================================= */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

img, svg, video, canvas {
  max-width: 100%;
  height: auto;
}

body {
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

/* Touch-friendly targets */
@media (pointer: coarse) {
  .btn,
  .nav-link,
  .form-control,
  .form-select,
  .btn-nav-cta,
  .btn-nav-login {
    min-height: 44px;
  }
  .btn-sm { min-height: 40px; padding-top: 0.4rem; padding-bottom: 0.4rem; }
  .form-check-input {
    width: 1.25em;
    height: 1.25em;
  }
  .page-actions .btn,
  .form-actions .btn,
  .action-stack .btn {
    min-height: 44px;
  }
}

/* —— Tablette (768px – 991px) —— */
@media (min-width: 768px) and (max-width: 991.98px) {
  main.container {
    max-width: 100%;
    padding-left: max(1.25rem, env(safe-area-inset-left));
    padding-right: max(1.25rem, env(safe-area-inset-right));
  }

  .page-header {
    gap: 1rem;
    align-items: center;
  }
  .page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
  }
  .page-actions .btn {
    flex: 0 1 auto;
  }

  .detail-layout {
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 1rem;
  }
  .detail-layout > aside {
    order: 0;
  }

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

  .detail-compact .detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .table-panel .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .table-panel table {
    min-width: 640px;
  }

  .chart-wrap { height: 220px; }
  .chart-wrap-sm { height: 200px; }

  .hero {
    padding: 2rem 1.75rem;
  }
  .hero-actions .btn {
    min-width: 11rem;
  }

  .stat-card .stat-value.fs-3 {
    font-size: 1.75rem !important;
  }

  .form-section.col-lg-8 {
    max-width: 100%;
    flex: 0 0 100%;
  }

  .filter-bar .row {
    row-gap: 0.65rem;
  }
}

/* —— ≤ tablette (tous écrans < desktop) —— */
@media (max-width: 991.98px) {
  main.container {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }

  .page-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
  }
  .page-actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .page-actions .btn {
    flex: 1 1 auto;
    text-align: center;
    justify-content: center;
  }
  .page-actions form {
    width: 100%;
  }
  .page-actions form .form-select {
    width: 100%;
    min-width: 0;
  }

  .sidebar-card {
    position: static;
    margin-top: 0.25rem;
  }

  .card-preview {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  .nav-shell {
    width: 100%;
  }

  /* Menu mobile : pleine largeur, liens confortables */
  #navMain.show .nav-shell,
  #navMain.collapsing .nav-shell {
    margin-top: 0.75rem;
  }
}

/* —— Mobile (≤ 767px) —— */
@media (max-width: 767.98px) {
  body {
    font-size: 0.92rem;
    background-attachment: scroll;
  }

  main.container {
    padding-top: 1rem !important;
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom)) !important;
  }

  .page-header {
    padding: 1rem;
    margin-bottom: 1rem;
  }
  .page-title {
    font-size: 1.35rem;
  }
  .page-subtitle {
    font-size: 0.88rem;
  }
  .page-actions {
    flex-direction: column;
  }
  .page-actions .btn {
    width: 100%;
    flex: 1 1 100%;
  }

  .breadcrumb-ep {
    max-width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.15rem;
  }

  .panel,
  .form-section {
    padding: 1rem 1rem 1.15rem;
    margin-bottom: 0.9rem;
  }
  .panel-header,
  .form-section-header {
    margin: -1rem -1rem 1rem;
    padding: 0.8rem 1rem;
  }
  .form-section h5 {
    font-size: 0.95rem;
    flex-wrap: wrap;
  }

  .filter-bar {
    padding: 0.85rem;
  }
  .filter-bar .row > [class*="col-"] {
    margin-bottom: 0.35rem;
  }

  .detail-layout {
    grid-template-columns: 1fr;
  }
  /* Photo / carte en premier sur mobile */
  .detail-layout > aside {
    order: -1;
  }

  /* Tables → cartes empilées */
  .table-panel {
    border: none;
    background: transparent;
    box-shadow: none;
  }
  .table-responsive {
    overflow: visible;
  }
  .table-responsive-cards thead {
    display: none;
  }
  .table-responsive-cards,
  .table-responsive-cards tbody,
  .table-responsive-cards tr,
  .table-responsive-cards td {
    display: block;
    width: 100%;
  }
  .table-responsive-cards tr {
    background: var(--ep-surface);
    border: 1px solid var(--ep-border);
    border-radius: var(--ep-radius);
    box-shadow: var(--ep-shadow-sm);
    margin-bottom: 0.85rem;
    padding: 0.35rem 0.15rem;
    overflow: hidden;
    position: relative;
  }
  .table-responsive-cards tr::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--ep-blue), var(--ep-yellow));
  }
  .table-responsive-cards td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    border: none !important;
    border-bottom: 1px solid rgba(48, 162, 222, 0.1) !important;
    padding: 0.7rem 1rem !important;
    text-align: right;
  }
  .table-responsive-cards td:last-child {
    border-bottom: none !important;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.45rem;
  }
  .table-responsive-cards td::before {
    content: attr(data-label);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--ep-blue);
    text-align: left;
    flex: 0 0 38%;
  }
  .table-responsive-cards td .person-cell {
    justify-content: flex-end;
    text-align: left;
    min-width: 0;
  }
  .table-responsive-cards td[data-label=""] {
    display: block;
    text-align: center;
  }
  .table-responsive-cards td[data-label=""]::before {
    display: none;
  }
  .table-responsive-cards td[data-label="Action"]::before,
  .table-responsive-cards td[data-label="Actions"]::before {
    display: none;
  }
  .table-responsive-cards td[data-label="Action"],
  .table-responsive-cards td[data-label="Actions"] {
    justify-content: stretch;
  }
  .table-responsive-cards td[data-label="Action"] .btn,
  .table-responsive-cards td[data-label="Actions"] .btn {
    flex: 1 1 auto;
  }

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

  .sidebar-card .photo-frame img,
  .sidebar-card .photo-frame {
    max-width: min(160px, 42vw);
    max-height: 200px;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    margin-left: auto;
    margin-right: auto;
  }
  .sidebar-card {
    text-align: center;
  }
  .action-stack {
    text-align: left;
  }

  .hero {
    padding: 1.6rem 1.15rem;
    border-radius: 0.85rem;
  }
  .hero-brand {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .hero-logo {
    width: 72px;
    height: 72px;
  }
  .hero-title {
    font-size: 1.65rem;
  }
  .hero-actions {
    flex-direction: column;
    width: 100%;
  }
  .hero-actions .btn {
    width: 100%;
    text-align: center;
  }
  .hero .lead {
    font-size: 0.95rem;
  }

  .stat-card {
    margin-bottom: 0;
  }
  .stat-value.fs-2 {
    font-size: 1.65rem !important;
  }
  .stat-value.fs-3 {
    font-size: 1.55rem !important;
  }

  .chart-wrap,
  .chart-wrap-sm {
    height: 170px;
  }

  .login-panel {
    margin: 0 0.15rem;
  }

  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .form-actions .btn {
    width: 100%;
  }

  .list-item-card {
    padding: 1rem;
  }

  .eparti-footer {
    padding: 0.5rem 0 max(0.75rem, env(safe-area-inset-bottom));
    font-size: 0.8rem;
  }

  .eparti-nav.sticky-top {
    padding-top: max(0.5rem, env(safe-area-inset-top));
  }

  .page-actions .btn + .btn {
    margin-left: 0;
  }

  .card-preview {
    border-radius: 0.65rem;
  }

  /* Éviter le zoom iOS sur focus input */
  .form-control,
  .form-select,
  textarea.form-control {
    font-size: 16px !important;
  }

  /* Formulaire d'adhésion : une colonne claire */
  .form-compact .row > [class*="col-md-"],
  .form-section .row > [class*="col-md-"] {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

/* —— Très petit mobile (≤ 380px) —— */
@media (max-width: 380px) {
  .brand-logo { width: 36px; height: 36px; }
  .brand-text .brand-name { font-size: 1rem; }
  .page-title { font-size: 1.2rem; }
  .person-avatar { width: 1.85rem; height: 1.85rem; font-size: 0.7rem; }
  .table-responsive-cards td::before { flex-basis: 34%; }
  .btn-nav-cta { padding-left: 0.85rem !important; padding-right: 0.85rem !important; }
}

/* —— Paysage mobile —— */
@media (max-height: 500px) and (orientation: landscape) {
  .hero { padding: 1.25rem; }
  .hero-logo { width: 56px; height: 56px; }
  .chart-wrap,
  .chart-wrap-sm { height: 140px; }
  .eparti-nav .navbar-brand .brand-tag { display: none; }
}

/* ---------- Paramètres / référentiels ---------- */
.params-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
  margin: -0.35rem 0 1.35rem;
  padding: 0.55rem 0.9rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ep-blue-dark);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--ep-border);
  border-radius: 999px;
  width: fit-content;
  max-width: 100%;
  animation: page-in 0.5s ease 0.05s both;
}
.params-flow-sep {
  color: var(--ep-yellow-dark);
  opacity: 0.85;
  font-weight: 800;
}

.params-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.params-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 1.15rem 1.2rem 1.1rem;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.98) 0%, rgba(232, 245, 252, 0.55) 100%);
  border: 1px solid var(--ep-border);
  border-radius: var(--ep-radius);
  box-shadow: var(--ep-shadow-sm);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  animation: page-in 0.45s ease both;
}
.params-card:nth-child(1) { animation-delay: 0.04s; }
.params-card:nth-child(2) { animation-delay: 0.08s; }
.params-card:nth-child(3) { animation-delay: 0.12s; }
.params-card:nth-child(4) { animation-delay: 0.16s; }
.params-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--ep-blue);
}
.params-card::after {
  content: "";
  position: absolute;
  right: -18%;
  top: -28%;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(48, 162, 222, 0.14), transparent 70%);
  pointer-events: none;
}
.params-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--ep-shadow);
  border-color: rgba(48, 162, 222, 0.35);
}
.params-card--blue::before { background: linear-gradient(180deg, var(--ep-blue), var(--ep-blue-dark)); }
.params-card--yellow::before { background: linear-gradient(180deg, var(--ep-yellow), var(--ep-yellow-dark)); }
.params-card--red::before { background: linear-gradient(180deg, #e64548, var(--ep-red)); }
.params-card--deep::before { background: linear-gradient(180deg, var(--ep-blue-dark), var(--ep-blue-deeper)); }

.params-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}
.params-card-step {
  font-family: var(--ep-display);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--ep-muted);
}
.params-card-icon {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 0.7rem;
  background: var(--ep-blue-soft);
  border: 1px solid rgba(48, 162, 222, 0.2);
  position: relative;
  flex-shrink: 0;
}
.params-card-icon::before,
.params-card-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
}
.params-card-icon--map::before {
  width: 1rem;
  height: 0.85rem;
  border: 2px solid var(--ep-blue-dark);
  border-radius: 0.2rem 0.45rem 0.2rem 0.45rem;
  transform: rotate(-8deg);
}
.params-card-icon--city::before {
  width: 0.55rem;
  height: 0.95rem;
  left: 0.55rem;
  right: auto;
  background: var(--ep-blue-dark);
  border-radius: 0.1rem;
}
.params-card-icon--city::after {
  width: 0.7rem;
  height: 0.7rem;
  left: auto;
  right: 0.45rem;
  top: auto;
  bottom: 0.45rem;
  background: var(--ep-yellow-dark);
  border-radius: 0.1rem;
}
.params-card-icon--grid::before {
  width: 0.95rem;
  height: 0.95rem;
  background:
    linear-gradient(var(--ep-blue-dark), var(--ep-blue-dark)) 0 0 / 40% 40%,
    linear-gradient(var(--ep-blue-dark), var(--ep-blue-dark)) 100% 0 / 40% 40%,
    linear-gradient(var(--ep-blue-dark), var(--ep-blue-dark)) 0 100% / 40% 40%,
    linear-gradient(var(--ep-yellow-dark), var(--ep-yellow-dark)) 100% 100% / 40% 40%;
  background-repeat: no-repeat;
}
.params-card-icon--pin::before {
  width: 0.7rem;
  height: 0.7rem;
  border: 2px solid var(--ep-red);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  top: -0.1rem;
}
.params-card-icon--pin::after {
  width: 0.22rem;
  height: 0.22rem;
  background: var(--ep-red);
  border-radius: 50%;
  top: 0.05rem;
}

.params-card-title {
  font-family: var(--ep-display);
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ep-blue-deeper);
  margin: 0 0 0.35rem;
  line-height: 1.25;
}
.params-card-desc {
  margin: 0;
  color: var(--ep-muted);
  font-size: 0.86rem;
  line-height: 1.45;
  flex: 1;
}
.params-card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin: 1.05rem 0 1rem;
  padding-top: 0.85rem;
  border-top: 1px dashed rgba(48, 162, 222, 0.22);
}
.params-card-stat {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.params-card-stat-value {
  font-family: var(--ep-display);
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ep-blue-deeper);
  line-height: 1;
}
.params-card-stat-value--soft { color: var(--ep-blue-dark); }
.params-card-stat-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ep-muted);
}
.params-card-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.params-card-link {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 2.35rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.86rem;
  font-weight: 700;
  color: #fff !important;
  background: linear-gradient(135deg, var(--ep-blue) 0%, var(--ep-blue-dark) 100%);
  border-radius: var(--ep-radius-sm);
  box-shadow: 0 4px 12px rgba(26, 127, 184, 0.25);
  transition: transform 0.15s ease, filter 0.15s ease;
}
.params-card-link:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  color: #fff !important;
}
.params-card-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
  color: var(--ep-blue-deeper) !important;
  background: #fff;
  border: 1px solid rgba(48, 162, 222, 0.35);
  border-radius: var(--ep-radius-sm);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.params-card-add:hover {
  background: var(--ep-blue-soft);
  border-color: var(--ep-blue);
  transform: translateY(-1px);
}

.params-status {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.params-status--on {
  color: var(--ep-blue-deeper);
  background: rgba(48, 162, 222, 0.14);
  border: 1px solid rgba(48, 162, 222, 0.28);
}
.params-status--off {
  color: var(--ep-muted);
  background: rgba(90, 107, 118, 0.08);
  border: 1px solid rgba(90, 107, 118, 0.18);
}

.params-list .breadcrumb-ep {
  margin-bottom: 0.55rem;
  padding: 0.22rem 0.6rem;
  font-size: 0.78rem;
}
.params-list-header {
  margin-bottom: 0.75rem;
  padding: 0.7rem 0.95rem 0.75rem;
}
.params-list-header .page-kicker {
  margin-bottom: 0.3rem;
  padding: 0.18rem 0.55rem;
  font-size: 0.65rem;
}
.params-list-header .page-title {
  font-size: clamp(1.15rem, 2vw, 1.4rem);
}
.params-list-filters {
  margin-bottom: 0.75rem;
  padding: 0.55rem 0.75rem;
}
.params-list-filters::after {
  display: none;
}
.params-list-filters-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}
.params-list-filters-row .form-control,
.params-list-filters-row .form-select {
  flex: 1 1 10rem;
  min-width: 8rem;
  max-width: 22rem;
  padding: 0.3rem 0.55rem;
  font-size: 0.84rem;
  min-height: 2rem;
}
.params-list-filters-row .btn {
  flex: 0 0 auto;
  min-height: 2rem;
  padding: 0.28rem 0.75rem;
}
.params-list-table {
  margin-bottom: 0.75rem;
}
.params-list-table .table thead th {
  padding: 0.45rem 0.65rem;
  font-size: 0.68rem;
}
.params-list-table .table > :not(caption) > * > * {
  padding: 0.38rem 0.65rem;
}
.params-list-table .table td {
  font-size: 0.84rem;
}
.params-list-table .params-status {
  padding: 0.1rem 0.4rem;
  font-size: 0.68rem;
}
.params-list-table .btn-link-ep {
  font-size: 0.78rem;
  padding: 0.15rem 0.45rem;
}

/* ---------- Pagination ---------- */
.pagination-ep {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  margin: 0.25rem 0 1.25rem;
  padding: 0.55rem 0.75rem;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--ep-border);
  border-radius: var(--ep-radius-sm);
}
.pagination-ep-meta {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ep-muted);
}
.pagination-ep-meta--solo {
  margin: 0.15rem 0 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ep-muted);
}
.pagination-ep-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.pagination-ep-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.45rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ep-blue-deeper) !important;
  background: #fff;
  border: 1px solid rgba(48, 162, 222, 0.28);
  border-radius: 0.45rem;
  line-height: 1;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
a.pagination-ep-link:hover {
  background: var(--ep-blue-soft);
  border-color: var(--ep-blue);
}
.pagination-ep-link.is-active {
  color: #fff !important;
  background: linear-gradient(135deg, var(--ep-blue), var(--ep-blue-dark));
  border-color: transparent;
  box-shadow: 0 3px 8px rgba(26, 127, 184, 0.25);
}
.pagination-ep-link.is-disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}
.pagination-ep-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4rem;
  color: var(--ep-muted);
  font-weight: 700;
}

@media (max-width: 1199.98px) {
  .params-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 575.98px) {
  .params-grid {
    grid-template-columns: 1fr;
  }
  .params-flow {
    border-radius: var(--ep-radius-sm);
    width: 100%;
  }
  .params-list-filters-row .form-control,
  .params-list-filters-row .form-select {
    max-width: none;
    flex-basis: 100%;
  }
}

/* Impression */
@media print {
  .eparti-nav,
  .eparti-footer,
  .page-actions,
  .filter-bar,
  .btn,
  .nav-aside {
    display: none !important;
  }
  body {
    background: #fff;
  }
  .panel,
  .form-section,
  .table-panel {
    box-shadow: none;
    border-color: #ccc;
  }
}
