/* =========================================================================
   Juvaimmo — back-office
   Réutilise les jetons de site.css (chargé avant celle-ci).
   ========================================================================= */

body.admin {
  background: #f6f2ec;
}

.admin-cadre {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 100vh;
}
@media (max-width: 900px) {
  .admin-cadre { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------- barre latérale */

.aside {
  background: var(--encre);
  color: #c8bbaf;
}
.aside__interieur {
  position: sticky;
  top: 0;
  min-height: 100vh;
  max-height: 100vh;
  overflow-y: auto;
  padding: 1.5rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}
@media (max-width: 900px) {
  .aside__interieur { position: static; min-height: 0; max-height: none; }
}
.aside__logo img { height: 38px; }
.aside__menu { display: grid; gap: 0.2rem; }
.aside__menu a {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--r-sm);
  color: #cdc0b3;
  font-size: 0.93rem;
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition);
}
.aside__menu a:hover { background: rgba(251, 247, 242, 0.08); color: #fff; }
.aside__menu a.est-actif { background: var(--terre); color: #fff; }
.aside__menu .pastille-nb {
  margin-left: auto;
  background: var(--terre);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: var(--r-full);
  padding: 0.1rem 0.45rem;
  min-width: 20px;
  text-align: center;
}
.aside__menu a.est-actif .pastille-nb { background: rgba(0, 0, 0, 0.25); }
.aside__bas {
  margin-top: auto;
  border-top: 1px solid rgba(251, 247, 242, 0.14);
  padding-top: 1.1rem;
  font-size: 0.85rem;
}
.aside__bas a { color: #cdc0b3; text-decoration: none; display: block; padding: 0.4rem 0; }
.aside__bas a:hover { color: #fff; }
.aside__titre {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8b7c6f;
  padding: 0 0.85rem;
  margin-bottom: 0.55rem;
  font-weight: 600;
}

/* ------------------------------------------------------------- contenu */

.admin-contenu { padding: clamp(1.25rem, 3vw, 2.25rem); min-width: 0; }

.admin-entete {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 1.75rem;
}
.admin-entete h1 {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  margin: 0;
}
.admin-entete p { color: var(--encre-2); font-size: 0.93rem; margin: 0.35rem 0 0; }
.admin-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }

.panneau-admin {
  background: #fff;
  border: 1px solid var(--ligne);
  border-radius: var(--r-md);
  padding: clamp(1.15rem, 2.2vw, 1.75rem);
  margin-bottom: 1.5rem;
}
.panneau-admin > h2 {
  font-size: 1.15rem;
  margin-bottom: 0.35rem;
}
.panneau-admin__intro {
  color: var(--encre-2);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

/* -------------------------------------------------------------- stats */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.stat {
  background: #fff;
  border: 1px solid var(--ligne);
  border-radius: var(--r-md);
  padding: 1.25rem 1.35rem;
}
.stat__libelle {
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--encre-3);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}
.stat__valeur {
  font-family: var(--serif);
  font-variation-settings: 'SOFT' 40;
  font-size: 2rem;
  font-weight: 600;
  line-height: 1;
  color: var(--encre);
}

/* ------------------------------------------------------------ tableau */

.tableau-enveloppe {
  overflow-x: auto;
  border: 1px solid var(--ligne);
  border-radius: var(--r-md);
  background: #fff;
}
table.tableau {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  min-width: 720px;
}
.tableau th {
  text-align: left;
  font-size: 0.74rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--encre-3);
  font-weight: 600;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--ligne);
  background: #fbf8f4;
  white-space: nowrap;
}
.tableau td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--ligne);
  vertical-align: middle;
}
.tableau tr:last-child td { border-bottom: 0; }
.tableau tbody tr:hover { background: #fdfbf8; }
.tableau a { text-decoration: none; }
.tableau__vignette {
  width: 74px;
  height: 52px;
  object-fit: cover;
  border-radius: var(--r-xs);
  background: var(--sable);
}
.tableau__titre { font-weight: 600; color: var(--encre); display: block; }
.tableau__meta { font-size: 0.82rem; color: var(--encre-3); }
.tableau__actions { display: flex; gap: 0.35rem; justify-content: flex-end; }

.puce {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.24rem 0.6rem;
  border-radius: var(--r-full);
  white-space: nowrap;
}
.puce--vert { background: #e6f2e8; color: #2c5c35; }
.puce--gris { background: #efe9e1; color: #6b5d53; }
.puce--terre { background: var(--terre-claire); color: var(--terre-fonce); }
.puce--jaune { background: #fbf0d8; color: #7a5514; }
.puce--rouge { background: #fbe9e7; color: #8c2019; }

.bouton-icone {
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  border: 1px solid var(--ligne);
  background: #fff;
  color: var(--encre-2);
  display: inline-grid;
  place-content: center;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  padding: 0;
}
.bouton-icone:hover { border-color: var(--encre); color: var(--encre); }
.bouton-icone--danger:hover { border-color: #b3261e; color: #b3261e; background: #fdf5f4; }

/* --------------------------------------------------------- formulaires */

.grille-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0 1.25rem;
}
.grille-form--3 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

.groupe-titre {
  font-size: 0.74rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--encre-3);
  font-weight: 600;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--ligne);
  margin: 2rem 0 1.35rem;
}
.groupe-titre:first-of-type { margin-top: 0; }

.barre-actions {
  position: sticky;
  bottom: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--ligne);
  padding: 1rem 0;
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 1.5rem;
  z-index: 10;
}
.barre-actions .repousse { margin-left: auto; }

/* -------------------------------------------------------------- médias */

.grille-medias {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}
.media-carte {
  border: 1px solid var(--ligne);
  border-radius: var(--r-sm);
  overflow: hidden;
  background: #fff;
  position: relative;
}
.media-carte.est-couverture { border-color: var(--terre); box-shadow: 0 0 0 2px var(--terre-claire); }
.media-carte img,
.media-carte video {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  background: var(--sable);
  display: block;
}
.media-carte__barre {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.5rem;
  border-top: 1px solid var(--ligne);
  background: #fdfbf8;
}
.media-carte__barre form { display: contents; }
.media-carte__poignee {
  cursor: grab;
  color: var(--encre-3);
  padding: 0 0.15rem;
}
.media-carte__badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  background: var(--terre);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: var(--r-full);
}
.media-carte.est-glissee { opacity: 0.35; }

.depose {
  display: block;
  border: 2px dashed var(--ligne-forte);
  border-radius: var(--r-md);
  padding: 2rem 1.5rem;
  text-align: center;
  background: #fdfbf8;
  transition: var(--transition);
  cursor: pointer;
}
.depose.est-survolee { border-color: var(--terre); background: var(--terre-claire); }
.depose p { margin: 0.5rem 0 0; color: var(--encre-2); font-size: 0.9rem; }
.depose strong { color: var(--encre); }
.depose input[type='file'] { display: none; }
.depose > svg { margin: 0 auto 0.35rem; color: var(--encre-3); }

/* champs de fichier natifs */
input[type='file'] {
  font: inherit;
  font-size: 0.88rem;
  color: var(--encre-2);
  background: #fdfbf8;
  border: 1px solid var(--ligne-forte);
  border-radius: var(--r-sm);
  padding: 0.55rem 0.7rem;
  width: 100%;
}
input[type='file']::file-selector-button {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--encre);
  background: var(--sable);
  border: 1px solid var(--ligne-forte);
  border-radius: var(--r-full);
  padding: 0.4rem 0.9rem;
  margin-right: 0.75rem;
  cursor: pointer;
}
input[type='file']::file-selector-button:hover { background: var(--sable-fonce); }
.liste-fichiers {
  margin-top: 0.85rem;
  font-size: 0.85rem;
  color: var(--encre-2);
  text-align: left;
}

/* --------------------------------------------------------- connexion */

.page-connexion {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem;
  background:
    radial-gradient(1200px 500px at 50% -10%, #f7e6dd 0%, transparent 60%),
    #f6f2ec;
}
.boite-connexion {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border: 1px solid var(--ligne);
  border-radius: var(--r-lg);
  padding: clamp(1.75rem, 4vw, 2.5rem);
  box-shadow: var(--ombre-2);
}
.boite-connexion img { height: 42px; margin-bottom: 1.75rem; }
.boite-connexion h1 { font-size: 1.5rem; margin-bottom: 0.35rem; }
.boite-connexion p.sous { color: var(--encre-2); font-size: 0.92rem; margin-bottom: 1.75rem; }

/* ---------------------------------------------------------- messages */

.fil-messages { display: grid; gap: 0.75rem; }
.message-ligne {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  background: #fff;
  border: 1px solid var(--ligne);
  border-radius: var(--r-md);
  padding: 1rem 1.15rem;
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}
.message-ligne:hover { border-color: var(--ligne-forte); box-shadow: var(--ombre-1); }
.message-ligne.est-nouveau { border-left: 3px solid var(--terre); }
.message-ligne__avatar {
  width: 42px;
  height: 42px;
  border-radius: var(--r-full);
  background: var(--terre-claire);
  color: var(--terre-fonce);
  display: grid;
  place-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}
.message-ligne__objet { font-weight: 600; display: block; color: var(--encre); }
.message-ligne__extrait {
  display: block;
  color: var(--encre-2);
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.message-ligne__date { font-size: 0.82rem; color: var(--encre-3); white-space: nowrap; }

.journal {
  background: #241d19;
  color: #cdc0b3;
  border-radius: var(--r-sm);
  padding: 1rem 1.1rem;
  font: 400 0.82rem/1.6 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 260px;
  overflow: auto;
}

.aide-encadre {
  background: var(--terre-claire);
  border: 1px solid #e6c3b4;
  border-radius: var(--r-sm);
  padding: 1rem 1.15rem;
  font-size: 0.88rem;
  color: var(--terre-fonce);
  line-height: 1.65;
}
.aide-encadre strong { color: #6f2c15; }
.aide-encadre code {
  background: rgba(255, 255, 255, 0.6);
  padding: 0.1em 0.35em;
  border-radius: 3px;
  font-size: 0.92em;
}

.onglets {
  display: flex;
  gap: 0.35rem;
  border-bottom: 1px solid var(--ligne);
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.onglets a {
  padding: 0.7rem 1.1rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--encre-2);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.onglets a:hover { color: var(--encre); }
.onglets a.est-actif { color: var(--terre); border-bottom-color: var(--terre); font-weight: 600; }
