/* ============================================================
   D.J.E.D SARL — Styles de l'espace admin
   ============================================================ */
:root {
  --green: #0e4d34;
  --green-dark: #093525;
  --gold: #c39a3e;
  --gold-deep: #a67f2c;
  --cream: #faf8f3;
  --ink: #17211b;
  --muted: #5e6c63;
  --line: rgba(14, 77, 52, 0.12);
  --radius: 12px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Inter", system-ui, sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.6;
}
h1, h2 { font-family: "Cormorant Garamond", Georgia, serif; color: var(--green); }
a { color: inherit; text-decoration: none; }
img { display: block; }

/* ---------- Connexion ---------- */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(158deg, var(--green-dark), var(--green) 60%, #062619);
  padding: 1.5rem;
}
.login-card {
  background: #fff;
  border-radius: 18px;
  padding: 2.6rem 2.4rem;
  width: min(100%, 400px);
  text-align: center;
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.6);
  border-top: 4px solid var(--gold);
}
.login-logo { width: 90px; margin: 0 auto 1.2rem; }
.login-card h1 { font-size: 1.7rem; margin-bottom: 0.2rem; }
.login-sub { color: var(--muted); font-size: 0.9rem; margin-bottom: 1.6rem; }
.login-card form { display: grid; gap: 0.6rem; text-align: left; }
.login-card label { font-size: 0.8rem; font-weight: 600; color: var(--green); }
.login-card input {
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
}
.login-card input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(195, 154, 62, 0.18); }
.login-back { display: inline-block; margin-top: 1.4rem; font-size: 0.85rem; color: var(--muted); }
.login-back:hover { color: var(--gold-deep); }
.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; }
.forgot-link { font-size: 0.78rem; color: var(--gold-deep); text-decoration: underline; text-underline-offset: 2px; }
.forgot-link:hover { color: var(--green); }
.pwd-rule { font-size: 0.76rem; color: var(--muted); margin-top: -0.2rem; }
.login-card .alert { font-size: 0.86rem; line-height: 1.6; margin-bottom: 1rem; }

/* ---------- Boutons ---------- */
.btn-admin {
  background: linear-gradient(135deg, #d9b45a, var(--gold-deep));
  color: #251c06;
  border: 0;
  border-radius: 999px;
  padding: 0.8rem 1.6rem;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  font-family: inherit;
  justify-self: start;
}
.btn-admin:hover { filter: brightness(1.06); }
.btn-logout {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  border-radius: 999px;
  padding: 0.45rem 1rem;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.82rem;
}
.btn-logout:hover { background: rgba(255, 255, 255, 0.12); }

/* ---------- En-tête admin ---------- */
.admin-header { background: var(--green-dark); color: #fff; position: sticky; top: 0; z-index: 10; }
.admin-header-inner {
  width: min(94%, 1080px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0;
  flex-wrap: wrap;
}
.admin-brand { display: flex; align-items: center; gap: 0.7rem; font-size: 0.95rem; }
.admin-brand img { width: 42px; height: 42px; border-radius: 8px; background: #fff; padding: 2px; object-fit: contain; }
.admin-nav { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }
.admin-nav a { font-size: 0.88rem; color: rgba(255, 255, 255, 0.85); }
.admin-nav a:hover { color: #d9b45a; }
.admin-view-site { color: #d9b45a !important; }
.admin-back {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.42rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 999px;
  color: rgba(255, 255, 255, 0.9) !important; font-size: 0.82rem;
  transition: background 0.25s, border-color 0.25s;
}
.admin-back:hover { background: rgba(255, 255, 255, 0.12); border-color: #d9b45a; }

/* ---------- Contenu ---------- */
.admin-main { width: min(94%, 1080px); margin: 2rem auto 4rem; display: grid; gap: 2rem; }
.admin-section {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.8rem;
  scroll-margin-top: 80px;
}
.admin-section h2 { font-size: 1.6rem; margin-bottom: 0.3rem; }
.admin-help { color: var(--muted); font-size: 0.88rem; margin-bottom: 1.4rem; }

.alert { padding: 0.9rem 1.2rem; border-radius: 10px; font-size: 0.9rem; }
.alert.ok { background: #e8f3ec; color: #14532d; border: 1px solid #bbdcc8; }
.alert.warn { background: #fdf6e3; color: #7c5b12; border: 1px solid #ecd9a0; }
.alert.error { background: #fdecec; color: #8c1d1d; border: 1px solid #f0bcbc; margin-bottom: 0.8rem; }
.alert code { background: rgba(0, 0, 0, 0.06); padding: 0.1em 0.4em; border-radius: 4px; }

.admin-form { display: grid; gap: 0.9rem; }
.admin-form label { font-size: 0.8rem; font-weight: 700; color: var(--green); letter-spacing: 0.04em; }
.admin-form input[type="text"], .admin-form textarea {
  width: 100%;
  padding: 0.75rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.93rem;
  resize: vertical;
}
.admin-form input:focus, .admin-form textarea:focus {
  outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(195, 154, 62, 0.15);
}
.admin-form input[type="file"] { font-size: 0.88rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: end; }
.form-row.three { grid-template-columns: repeat(3, 1fr); align-items: start; }
.form-row > div { display: grid; gap: 0.4rem; }

.empty { color: var(--muted); font-style: italic; margin-top: 1rem; }

/* ---------- Listes carousel / actus ---------- */
.carousel-admin-list, .news-admin-list { list-style: none; margin-top: 1.4rem; display: grid; gap: 0.7rem; }
.carousel-admin-list li, .news-admin-list li {
  display: flex;
  align-items: center;
  gap: 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.6rem 0.9rem;
  background: var(--cream);
}
.thumb { width: 84px; height: 56px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.caption { flex: 1; font-size: 0.9rem; }
.actions { display: flex; gap: 0.4rem; }
.actions form { display: inline; }
.actions button, .news-admin-list .danger {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  width: 34px;
  height: 34px;
  cursor: pointer;
  font-size: 0.95rem;
}
.actions button:hover:not(:disabled) { border-color: var(--gold); }
.actions button:disabled { opacity: 0.35; cursor: default; }
button.danger { color: #a02222; }
button.danger:hover { border-color: #a02222; background: #fdecec; }

.news-meta { flex: 1; display: grid; gap: 0.15rem; }
.news-meta small { color: var(--muted); }
.news-excerpt { font-size: 0.85rem; color: var(--muted); }

/* ---------- Cases à cocher ---------- */
.checkbox-label {
  display: flex; align-items: center; gap: 0.6rem;
  font-size: 0.9rem !important; font-weight: 500 !important;
  color: var(--ink) !important; letter-spacing: 0 !important;
  cursor: pointer;
}
.checkbox-label input[type="checkbox"] { width: 1.05rem; height: 1.05rem; accent-color: var(--green); cursor: pointer; }

/* ---------- Mot de passe provisoire ---------- */
.alert.pwd { background: #eef4fb; color: #123b63; border: 1px solid #b9d3ea; }
.pwd-value {
  display: inline-block; margin-top: 0.3rem;
  background: #fff; border: 1px dashed #7aa5cc; border-radius: 6px;
  padding: 0.35rem 0.8rem;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 1.05rem; font-weight: 700; letter-spacing: 0.05em;
  user-select: all;
}

/* ---------- Vignettes variantes ---------- */
.thumb.round { border-radius: 50%; width: 56px; height: 56px; }
.thumb.initials {
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(160deg, var(--green), var(--green-dark));
  color: #d9b45a; display: grid; place-items: center;
  font-family: "Cormorant Garamond", serif; font-size: 1.3rem; font-weight: 700;
  flex-shrink: 0;
}
.thumb.pdf {
  width: 56px; height: 56px; border-radius: 10px;
  background: #fdecec; color: #a02222;
  display: grid; place-items: center;
  font-size: 0.75rem; font-weight: 800; letter-spacing: 0.08em;
  flex-shrink: 0;
}
.caption small { display: block; color: var(--muted); font-size: 0.8rem; font-weight: 400; }
.carousel-admin-list li.inactive { opacity: 0.55; }
.link-btn {
  border: 1px solid var(--line); background: #fff; border-radius: 8px;
  width: 34px; height: 34px; display: grid; place-items: center;
  font-size: 0.95rem; color: var(--ink);
}
.link-btn:hover { border-color: var(--gold); }

/* ---------- Demandes : compteur dans la navigation ---------- */
.nav-demandes { display: inline-flex; align-items: center; gap: 0.4rem; }
.compteur {
  background: #d9b45a; color: #251c06;
  font-size: 0.7rem; font-weight: 800; line-height: 1;
  min-width: 1.25rem; padding: 0.2rem 0.35rem;
  border-radius: 999px; text-align: center;
}

/* ---------- Demandes : pipeline ---------- */
.pipeline {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.6rem;
  margin-bottom: 1.6rem;
}
.pipe-etape {
  display: grid; gap: 0.1rem; text-align: center;
  padding: 0.9rem 0.5rem;
  background: var(--cream); border: 1px solid var(--line); border-radius: 10px;
  transition: border-color 0.25s, transform 0.25s, background 0.25s;
}
.pipe-etape:hover { transform: translateY(-2px); border-color: var(--gold); }
.pipe-etape.actif { background: #fff; border-color: var(--green); box-shadow: inset 0 -3px 0 var(--green); }
.pipe-etape strong {
  font-family: "Cormorant Garamond", serif; font-size: 1.9rem; line-height: 1;
  color: var(--green); font-variant-numeric: tabular-nums;
}
.pipe-etape span {
  font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
}
.pipe-etape.st-nouveau strong { color: #b8860b; }
.pipe-etape.st-discussion strong { color: #1d6fa5; }
.pipe-etape.st-membre strong { color: #14803c; }
.pipe-etape.st-sans-suite strong { color: #8a978f; }

/* ---------- Demandes : fiches ---------- */
.leads-list { list-style: none; display: grid; gap: 0.9rem; }
.lead {
  border: 1px solid var(--line); border-left: 4px solid var(--line);
  border-radius: 10px; padding: 1.1rem 1.3rem; background: #fff;
}
.lead.st-nouveau { border-left-color: #d9a521; background: #fffdf6; }
.lead.st-discussion { border-left-color: #2b8cc4; }
.lead.st-membre { border-left-color: #2ea35c; }
.lead.st-sans-suite { border-left-color: #c4cbc6; opacity: 0.72; }

.lead-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.lead-qui { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.lead-qui strong { font-size: 1.05rem; color: var(--green); }
.lead-statut {
  font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700;
  padding: 0.2rem 0.6rem; border-radius: 999px;
}
.lead-statut.st-nouveau { background: #fdf3d7; color: #8a6410; }
.lead-statut.st-discussion { background: #ddeefa; color: #175d87; }
.lead-statut.st-membre { background: #ddf3e5; color: #14803c; }
.lead-statut.st-sans-suite { background: #eceeed; color: #67736c; }
.lead-resp { font-size: 0.78rem; color: var(--muted); }
.lead-date { font-size: 0.76rem; color: var(--muted); white-space: nowrap; }

.lead-contact { display: flex; gap: 0.8rem; flex-wrap: wrap; align-items: center; margin-top: 0.35rem; }
.lead-contact a { color: var(--gold-deep); text-decoration: underline; font-size: 0.88rem; }
.lead-contact a:hover { color: var(--green); }
.lead-sujet {
  font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 700;
  color: var(--muted); background: var(--cream); padding: 0.15rem 0.55rem; border-radius: 6px;
}
.lead-message {
  margin-top: 0.7rem; padding: 0.8rem 1rem;
  background: var(--cream); border-radius: 8px;
  font-size: 0.92rem; color: var(--ink); white-space: pre-line;
}

.lead-notes { list-style: none; margin-top: 0.7rem; display: grid; gap: 0.35rem; }
.lead-notes li {
  display: flex; gap: 0.7rem; align-items: baseline;
  font-size: 0.85rem; color: var(--muted);
  padding-left: 0.8rem; border-left: 2px solid var(--gold-line);
}
.lead-notes time { font-size: 0.72rem; font-weight: 700; color: var(--gold-deep); white-space: nowrap; }

.lead-actions { margin-top: 0.8rem; }
.lead-actions summary {
  cursor: pointer; list-style: none;
  font-size: 0.78rem; font-weight: 700; color: var(--gold-deep);
  display: inline-block;
}
.lead-actions summary::-webkit-details-marker { display: none; }
.lead-actions summary::before { content: "⚙ "; }
.lead-actions summary:hover { color: var(--green); text-decoration: underline; }

.lead-panneau {
  margin-top: 0.9rem; padding-top: 0.9rem; border-top: 1px dashed var(--line);
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.9rem;
}
.lead-form { display: grid; gap: 0.3rem; }
.lead-form.large { grid-column: 1 / -1; }
.lead-form label {
  font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase;
  font-weight: 700; color: var(--green);
}
.lead-form input[type="text"], .lead-form select {
  padding: 0.5rem 0.7rem; border: 1px solid var(--line); border-radius: 8px;
  font-family: inherit; font-size: 0.87rem; background: #fff;
}
.lead-form input:focus, .lead-form select:focus {
  outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(195,154,62,0.15);
}
.lead-form button {
  justify-self: start; margin-top: 0.15rem;
  border: 0; border-radius: 8px; cursor: pointer;
  background: var(--green); color: #fff;
  padding: 0.45rem 0.9rem; font-size: 0.78rem; font-weight: 600; font-family: inherit;
}
.lead-form button:hover { background: var(--green-dark); }

.lead-boutons { grid-column: 1 / -1; display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }
.btn-convertir {
  border: 0; border-radius: 999px; cursor: pointer; font-family: inherit;
  background: linear-gradient(135deg, #d9b45a, var(--gold-deep)); color: #251c06;
  padding: 0.5rem 1.1rem; font-size: 0.8rem; font-weight: 700;
}
.btn-convertir:hover { filter: brightness(1.07); }
.deja-membre { font-size: 0.8rem; font-weight: 700; color: #14803c; }
.lead-boutons .danger {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 0.5rem 1rem; font-size: 0.8rem; cursor: pointer; font-family: inherit;
}

@media (max-width: 700px) {
  .pipeline { grid-template-columns: repeat(2, 1fr); }
  .lead-panneau { grid-template-columns: 1fr; }
}

/* ---------- Rôle particulier d'un membre ---------- */
.badge-role {
  display: inline-block; margin-left: 0.5rem;
  font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 700;
  background: linear-gradient(135deg, #d9b45a, var(--gold-deep));
  color: #251c06;
  padding: 0.18rem 0.6rem; border-radius: 999px;
  vertical-align: middle;
}
.role-editor { margin-top: 0.5rem; }
.role-editor summary {
  display: inline-block; cursor: pointer;
  font-size: 0.75rem; font-weight: 600; color: var(--gold-deep);
  padding: 0.2rem 0; list-style: none;
}
.role-editor summary::-webkit-details-marker { display: none; }
.role-editor summary::before { content: "🏷 "; }
.role-editor summary:hover { color: var(--green); text-decoration: underline; }
.role-editor[open] summary { margin-bottom: 0.5rem; }
.role-form { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; }
.role-form input[type="text"] {
  flex: 1; min-width: 200px;
  padding: 0.45rem 0.7rem; border: 1px solid var(--line); border-radius: 8px;
  font-family: inherit; font-size: 0.85rem;
}
.role-form input[type="text"]:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(195,154,62,0.15); }
.role-form button {
  border: 0; border-radius: 8px; cursor: pointer;
  background: var(--green); color: #fff;
  padding: 0.45rem 0.9rem; font-size: 0.8rem; font-weight: 600; font-family: inherit;
}
.role-form button:hover { background: var(--green-dark); }
.role-clear {
  margin-top: 0.4rem; border: 0; background: none; cursor: pointer;
  font-family: inherit; font-size: 0.75rem; color: #a02222; text-decoration: underline; padding: 0;
}

/* ---------- Espace membre ---------- */
.login-help { margin-top: 1.2rem; font-size: 0.82rem; color: var(--muted); line-height: 1.7; }
.login-help a { color: var(--gold-deep); text-decoration: underline; }
.member-welcome h2 { font-size: 1.9rem; }
.member-welcome .alert { margin-top: 1rem; }
.member-welcome .alert a { color: inherit; text-decoration: underline; }

.member-docs, .member-news, .member-info { list-style: none; display: grid; gap: 0.7rem; margin-top: 1rem; }
.member-docs li a {
  display: grid; gap: 0.15rem;
  border: 1px solid var(--line); border-radius: 10px; padding: 0.9rem 1.2rem;
  background: var(--cream); transition: border-color 0.25s, transform 0.25s;
}
.member-docs li a:hover { border-color: var(--gold); transform: translateX(4px); }
.member-docs strong { color: var(--green); }
.doc-desc { font-size: 0.86rem; color: var(--muted); }
.doc-meta { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--gold-deep); font-weight: 700; }

.member-news li { border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.2rem; background: var(--cream); }
.mn-head { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; margin-bottom: 0.3rem; }
.mn-head strong { color: var(--green); font-size: 1.05rem; }
.mn-date { font-size: 0.78rem; color: var(--muted); }
.badge-members {
  font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.12em; font-weight: 700;
  background: var(--green); color: #d9b45a; padding: 0.2rem 0.6rem; border-radius: 999px;
}
.member-news p { font-size: 0.92rem; color: var(--muted); white-space: pre-line; }

.member-info li {
  display: flex; justify-content: space-between; gap: 1rem;
  border: 1px solid var(--line); border-radius: 10px; padding: 0.8rem 1.2rem; background: var(--cream);
}
.member-info span { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--gold-deep); font-weight: 700; }

@media (max-width: 700px) {
  .form-row, .form-row.three { grid-template-columns: 1fr; }
  .carousel-admin-list li { flex-wrap: wrap; }
  .admin-nav { gap: 0.8rem; font-size: 0.85rem; }
}
