/* ISODECO — feuille de style commune aux trois outils
   Modifiez les variables ci-dessous pour coller à votre charte. */

:root {
  --bleu:      #0b3d6b;
  --bleu-clair:#1b6ca8;
  --vert:      #16a34a;
  --vert-fonce:#15803d;
  --orange:    #ea580c;
  --rouge:     #dc2626;
  --gris-900:  #0f172a;
  --gris-700:  #334155;
  --gris-500:  #64748b;
  --gris-300:  #cbd5e1;
  --gris-100:  #f1f5f9;
  --gris-50:   #f8fafc;
  --blanc:     #ffffff;
  --radius:    10px;
  --ombre:     0 1px 3px rgba(15,23,42,.08), 0 4px 16px rgba(15,23,42,.06);
  --police:    system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--police);
  color: var(--gris-900);
  background: var(--gris-50);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 24px 20px 64px; }
.wrap-etroit { max-width: 760px; }

/* ---------- En-tête ---------- */
header.app {
  background: var(--bleu);
  color: #fff;
  padding: 18px 20px;
}
header.app .inner {
  max-width: 1180px; margin: 0 auto;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
header.app h1 { font-size: 1.15rem; margin: 0; font-weight: 650; letter-spacing: -.01em; }
header.app .sous { font-size: .82rem; opacity: .78; margin: 0; }
header.app nav { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
header.app nav a {
  color: #fff; text-decoration: none; font-size: .85rem;
  padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.12);
  transition: background .15s;
}
header.app nav a:hover { background: rgba(255,255,255,.24); }
header.app nav a.actif { background: #fff; color: var(--bleu); font-weight: 600; }

/* ---------- Cartes ---------- */
.carte {
  background: var(--blanc);
  border: 1px solid var(--gris-300);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: var(--ombre);
}
.carte h2 {
  margin: 0 0 4px; font-size: 1.02rem; font-weight: 650;
  display: flex; align-items: center; gap: 8px;
}
.carte h2 .num {
  background: var(--bleu); color: #fff; width: 24px; height: 24px;
  border-radius: 50%; display: inline-grid; place-items: center;
  font-size: .78rem; font-weight: 700; flex: none;
}
.carte .aide { color: var(--gris-500); font-size: .85rem; margin: 0 0 16px; }

/* ---------- Formulaires ---------- */
.grille { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }

label { display: block; font-size: .8rem; font-weight: 600; margin-bottom: 5px; color: var(--gris-700); }
label .opt { font-weight: 400; color: var(--gris-500); }

input, select, textarea {
  width: 100%; padding: 9px 11px; font: inherit; font-size: .92rem;
  border: 1px solid var(--gris-300); border-radius: 8px;
  background: #fff; color: var(--gris-900); transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--bleu-clair);
  box-shadow: 0 0 0 3px rgba(27,108,168,.15);
}
input[type=checkbox], input[type=radio] { width: auto; }

.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; font: inherit; font-size: .92rem; font-weight: 600;
  border: none; border-radius: 8px; cursor: pointer;
  background: var(--bleu); color: #fff; transition: background .15s, transform .05s;
}
.bouton:hover { background: var(--bleu-clair); }
.bouton:active { transform: translateY(1px); }
.bouton:disabled { opacity: .5; cursor: not-allowed; }
.bouton.vert { background: var(--vert); }
.bouton.vert:hover { background: var(--vert-fonce); }
.bouton.fant {
  background: transparent; color: var(--bleu);
  border: 1px solid var(--gris-300);
}
.bouton.fant:hover { background: var(--gris-100); }
.bouton.pt { padding: 7px 13px; font-size: .84rem; }

/* ---------- Autocomplétion d'adresse ---------- */
.autoc { position: relative; }
.autoc ul {
  position: absolute; z-index: 40; top: calc(100% + 4px); left: 0; right: 0;
  margin: 0; padding: 4px; list-style: none; max-height: 260px; overflow-y: auto;
  background: #fff; border: 1px solid var(--gris-300); border-radius: 8px;
  box-shadow: 0 10px 30px rgba(15,23,42,.14);
}
.autoc ul:empty { display: none; }
.autoc li { padding: 9px 11px; cursor: pointer; font-size: .9rem; border-radius: 6px; }
.autoc li:hover, .autoc li.sel { background: var(--gris-100); }
.autoc li .ctx { display: block; font-size: .78rem; color: var(--gris-500); }

/* ---------- Étiquettes DPE ---------- */
.dpe {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; border-radius: 7px;
  font-weight: 800; font-size: 1rem; color: #fff; flex: none;
}
.dpe.gd { width: 60px; height: 60px; font-size: 1.8rem; border-radius: 10px; }
.dpe-A { background: #319834; } .dpe-B { background: #33cc31; }
.dpe-C { background: #cbfc34; color: #14532d; } .dpe-D { background: #fbfe06; color: #713f12; }
.dpe-E { background: #fbcc05; color: #713f12; } .dpe-F { background: #fc9935; }
.dpe-G { background: #fc0205; } .dpe-NA { background: var(--gris-300); color: var(--gris-700); }

/* ---------- Résultats / chiffres ---------- */
.tuiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(165px,1fr)); }
.tuile {
  background: var(--gris-50); border: 1px solid var(--gris-300);
  border-radius: var(--radius); padding: 14px;
}
.tuile .lib { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--gris-500); font-weight: 600; }
.tuile .val { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; }
.tuile .det { font-size: .76rem; color: var(--gris-500); }
.tuile.pri { background: #ecfdf5; border-color: #a7f3d0; }
.tuile.pri .val { color: var(--vert-fonce); }
.tuile.rac { background: #eff6ff; border-color: #bfdbfe; }
.tuile.rac .val { color: var(--bleu); }

/* ---------- Tableaux ---------- */
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th {
  text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--gris-500); font-weight: 700; padding: 9px 10px;
  border-bottom: 2px solid var(--gris-300); white-space: nowrap;
}
td { padding: 9px 10px; border-bottom: 1px solid var(--gris-100); vertical-align: middle; }
tbody tr:hover { background: var(--gris-50); }
.num-col { text-align: right; font-variant-numeric: tabular-nums; }
.tbl-scroll { overflow-x: auto; margin: 0 -22px; padding: 0 22px; }

/* ---------- Encadrés ---------- */
.note {
  border-radius: 8px; padding: 12px 14px; font-size: .85rem;
  margin: 14px 0; border-left: 4px solid;
}
.note.info  { background: #eff6ff; border-color: var(--bleu-clair); color: #1e3a5f; }
.note.warn  { background: #fffbeb; border-color: #f59e0b; color: #78350f; }
.note.alerte{ background: #fef2f2; border-color: var(--rouge); color: #7f1d1d; }
.note.ok    { background: #ecfdf5; border-color: var(--vert); color: #14532d; }
.note strong { font-weight: 700; }
.note ul { margin: 6px 0 0; padding-left: 18px; }

.puce {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: .72rem; font-weight: 700; letter-spacing: .01em;
}
.puce.ok    { background: #dcfce7; color: #14532d; }
.puce.ko    { background: #fee2e2; color: #7f1d1d; }
.puce.neutre{ background: var(--gris-100); color: var(--gris-700); }

/* ---------- Divers ---------- */
.spin {
  display: inline-block; width: 15px; height: 15px; vertical-align: -2px;
  border: 2px solid var(--gris-300); border-top-color: var(--bleu);
  border-radius: 50%; animation: tourne .7s linear infinite;
}
@keyframes tourne { to { transform: rotate(360deg); } }

.pied {
  margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--gris-300);
  font-size: .76rem; color: var(--gris-500);
}
.pied ul { padding-left: 18px; margin: 6px 0; }

.cache { display: none !important; }

@media print {
  header.app nav, .bouton, .no-print { display: none !important; }
  body { background: #fff; }
  .carte { break-inside: avoid; box-shadow: none; }
}
