/* Portail public MineCad-GB — allure inspirée des portails de cadastre
   minier Landfolio (bandeau ardoise, liseré vert, panneaux blancs). */

:root {
  --ardoise: #37474f;
  --ardoise-fonce: #263238;
  --vert: #43a047;
  --jaune: #fbc02d;
  --rouge: #c62828;
  --fond: #f4f2e9;
  --texte: #263238;
  --bordure: #d7d4c8;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  color: var(--texte);
  background: var(--fond);
  display: flex;
  flex-direction: column;
}

/* ---------- En-tête ---------- */
.entete {
  background: var(--ardoise);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.2rem;
  border-bottom: 4px solid var(--vert);
  flex: 0 0 auto;
}
.entete-titre { display: flex; align-items: center; gap: .8rem; padding: .55rem 0; }
.entete-titre h1 { margin: 0; font-size: 1.12rem; font-weight: 600; letter-spacing: .2px; }
.entete-titre p { margin: 0; font-size: .74rem; color: #b8c6cc; }
.drapeau {
  width: 34px; height: 24px; border-radius: 2px; flex: 0 0 auto;
  background: linear-gradient(to bottom, var(--jaune) 50%, var(--vert) 50%);
  border-left: 12px solid var(--rouge);
}
.entete-nav { display: flex; align-items: center; gap: 1rem; }
.entete-nav a { color: #eceff1; text-decoration: none; font-size: .9rem; padding: .3rem 0; }
.entete-nav a:hover { color: #fff; border-bottom: 2px solid var(--vert); }
.langues { display: flex; gap: .25rem; margin: 0; }
.langues button {
  background: transparent; color: #b8c6cc; border: 1px solid #56707b;
  border-radius: 3px; padding: .15rem .5rem; font-size: .78rem; cursor: pointer;
}
.langues button.active, .langues button:hover { background: var(--vert); color: #fff; border-color: var(--vert); }

/* ---------- Carte ---------- */
.conteneur-carte { position: relative; flex: 1 1 auto; min-height: 0; }
#carte { position: absolute; inset: 0; background: #cfe3ea; }

.panneau {
  position: absolute; z-index: 1000; background: #fff;
  border-radius: 6px; box-shadow: 0 2px 10px rgba(0,0,0,.25);
  font-size: .82rem;
}
.panneau-legende {
  top: 12px; left: 12px; width: 265px; max-height: calc(100% - 70px);
  overflow-y: auto; padding: .7rem .8rem;
}
.panneau-legende h2 { margin: .2rem 0 .4rem; font-size: .85rem; color: var(--ardoise); }
.groupe-legende { margin-bottom: .55rem; }
.groupe-legende > label { font-weight: 600; display: flex; gap: .4rem; align-items: center; cursor: pointer; }
.groupe-legende ul { list-style: none; margin: .25rem 0 0 1.35rem; padding: 0; }
.groupe-legende li { display: flex; align-items: center; gap: .45rem; padding: .11rem 0; color: #455a64; }
.pastille {
  width: 20px; height: 13px; border: 1px solid rgba(0,0,0,.45); flex: 0 0 auto;
}
.pastille.demande { background-image: repeating-linear-gradient(45deg, transparent 0 3px, rgba(0,0,0,.35) 3px 5px); }
.pastille.inactif { opacity: .35; }

.panneau-recherche { top: 12px; right: 12px; width: 300px; }
.panneau-recherche input {
  width: 100%; border: 0; border-radius: 6px; padding: .55rem .8rem .55rem 2rem;
  font-size: .85rem; outline: none;
  background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23607d8b' stroke-width='2'><circle cx='11' cy='11' r='8'/><line x1='21' y1='21' x2='16.65' y2='16.65'/></svg>") .6rem center no-repeat;
}
.resultats-recherche { margin-top: 6px; max-height: 320px; overflow-y: auto; display: none; }
.resultats-recherche.visible { display: block; }
.resultats-recherche h3 {
  margin: 0; padding: .45rem .7rem; font-size: .8rem; font-style: italic;
  background: #eceff1; border-bottom: 1px solid var(--bordure); border-radius: 6px 6px 0 0;
}
.resultats-recherche a {
  display: block; padding: .5rem .7rem; text-decoration: none; color: var(--texte);
  border-bottom: 1px solid #f0efe8;
}
.resultats-recherche a:hover { background: #f1f8e9; }
.resultats-recherche .num { font-weight: 700; }
.resultats-recherche .det { font-size: .78rem; color: #546e7a; }

.barre-coordonnees {
  position: absolute; z-index: 1000; left: 0; bottom: 0;
  background: rgba(255,255,255,.88); padding: .18rem .7rem;
  font-size: .74rem; color: #37474f; border-top-right-radius: 5px;
}

/* Popup Leaflet façon fiche Landfolio */
.leaflet-popup-content-wrapper { border-radius: 5px; padding: 0; }
.leaflet-popup-content { margin: 0; min-width: 250px; font-size: .82rem; }
.fiche-popup-entete {
  background: var(--ardoise-fonce); color: #fff; padding: .45rem .7rem;
  border-radius: 5px 5px 0 0; font-weight: 700;
}
.fiche-popup-corps { padding: .55rem .7rem .7rem; }
.fiche-popup-corps .ligne-type { display: flex; justify-content: space-between; margin-bottom: .3rem; }
.fiche-popup-corps .statut { font-weight: 700; }
.fiche-popup-corps .detenteur { font-weight: 700; margin-bottom: .4rem; }
.fiche-popup-corps dl { margin: 0; }
.fiche-popup-corps dt { float: left; clear: left; color: #546e7a; margin-right: .35rem; }
.fiche-popup-corps dd { margin: 0 0 .15rem 0; font-weight: 600; }
.fiche-popup-corps a.lien-fiche { display: inline-block; margin-top: .5rem; color: var(--vert); font-weight: 600; }
.popup-multi { list-style: none; margin: 0; padding: 0; }
.popup-multi li { border-bottom: 1px solid #eee; padding: .35rem .7rem; cursor: pointer; }
.popup-multi li:hover { background: #f1f8e9; }

/* ---------- Pages registre / fiche ---------- */
.page { max-width: 1080px; margin: 1.4rem auto; padding: 0 1rem; width: 100%; }
.page h2 { color: var(--ardoise); margin-top: 0; }
.carte-blanche {
  background: #fff; border: 1px solid var(--bordure); border-radius: 6px;
  padding: 1.1rem 1.3rem; box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.filtres { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1rem; }
.filtres input[type="text"], .filtres select {
  padding: .45rem .6rem; border: 1px solid var(--bordure); border-radius: 4px; font-size: .87rem;
}
.filtres input[type="text"] { flex: 1 1 220px; }
.filtres button {
  background: var(--vert); color: #fff; border: 0; border-radius: 4px;
  padding: .45rem 1.1rem; font-size: .87rem; cursor: pointer;
}
table.registre { width: 100%; border-collapse: collapse; font-size: .86rem; }
table.registre th, table.registre td {
  text-align: left; padding: .5rem .6rem; border-bottom: 1px solid #eceae0;
}
table.registre th { background: #eceff1; color: var(--ardoise); font-size: .78rem; text-transform: uppercase; }
table.registre tr:hover td { background: #f9fbe7; }
table.registre a { color: var(--ardoise); font-weight: 700; text-decoration: none; }
.badge {
  display: inline-block; padding: .1rem .55rem; border-radius: 10px;
  font-size: .74rem; font-weight: 700; color: #fff; background: #90a4ae;
}
.badge.actif { background: var(--vert); }
.badge.deposee, .badge.en_instruction { background: var(--jaune); color: #5d4037; }
.badge.suspendu { background: #ef6c00; }
.badge.expire, .badge.annule { background: #90a4ae; }
.badge.octroye { background: #00897b; }
.pagination { margin-top: 1rem; display: flex; gap: .5rem; align-items: center; font-size: .85rem; }
.pagination a { color: var(--vert); font-weight: 700; text-decoration: none; }

.fiche-grille { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem 1.5rem; margin: .8rem 0; }
.fiche-grille dt { color: #546e7a; font-size: .8rem; }
.fiche-grille dd { margin: 0 0 .5rem; font-weight: 600; }
#mini-carte { height: 330px; border: 1px solid var(--bordure); border-radius: 6px; margin-top: 1rem; }

.pied-note { color: #78909c; font-size: .76rem; margin: 1rem auto 1.4rem; max-width: 1080px; padding: 0 1rem; }

@media (max-width: 720px) {
  .panneau-legende { width: 210px; }
  .panneau-recherche { width: 220px; }
  .fiche-grille { grid-template-columns: 1fr; }
  .entete { flex-direction: column; align-items: flex-start; gap: .2rem; padding-bottom: .5rem; }
}
