/* =========================================================
   MPK Vérif — feuille de style commune
   Palette : papier froid, encre de plan, stylo rouge de contrôle
   ========================================================= */

:root {
  --paper: #F3F6F7;
  --sheet: #FFFFFF;
  --teal: #2B7F99;         /* bleu du logo MPK */
  --teal-dark: #1F6176;
  --teal-soft: #E6F1F5;
  --grey: #6D6D6D;         /* gris du logo MPK */
  --ink: #173A48;          /* encre de plan, teintée bleu pétrole */
  --ink-soft: #5B6A70;
  --line: #C8D6DC;         /* trait fin */
  --line-soft: #E2EBEE;
  --red: #C8102E;          /* stylo rouge : anomalies */
  --red-soft: #FBE9EC;
  --green: #1D7A52;        /* conforme */
  --green-soft: #E5F3EC;
  --amber: #A9640B;        /* en analyse / mineur */
  --amber-soft: #FBF1E2;

  --font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --hand: "Caveat", "Comic Sans MS", cursive;

  --radius-s: 3px;
  --radius-m: 6px;
  --wrap: 1160px;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
}

img, svg { max-width: 100%; display: block; }

a { color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3 {
  font-stretch: 85%;
  line-height: 1.12;
  margin: 0 0 .5em;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.2rem, 4.6vw, 3.6rem); font-weight: 750; }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 650; }
p  { margin: 0 0 1em; max-width: 66ch; }

.muted { color: var(--ink-soft); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  font: inherit;
  font-weight: 600;
  font-size: .97rem;
  padding: .78em 1.3em;
  border-radius: var(--radius-s);
  border: 1.5px solid var(--teal);
  background: var(--teal);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.btn:hover { background: var(--teal-dark); border-color: var(--teal-dark); }
.btn-ghost { background: transparent; color: var(--teal-dark); }
.btn-ghost:hover { background: var(--teal); color: #fff; }
.btn-small { padding: .5em .9em; font-size: .88rem; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------- En-tête ---------- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--sheet);
  position: sticky;
  top: 0;
  z-index: 20;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-stretch: 80%;
  font-weight: 750;
  font-size: 1.15rem;
  white-space: nowrap;
}
.brand-mark {
  width: 40px; height: 30px;
  border: 2px solid var(--ink);
  display: grid; place-items: center;
  font-size: .78rem;
  font-weight: 800;
}
.brand small {
  font-weight: 500;
  color: var(--ink-soft);
  font-size: .9rem;
  border-left: 1px solid var(--line);
  padding-left: 10px;
}
.nav { display: flex; align-items: center; gap: 26px; }
.nav a {
  text-decoration: none;
  font-size: .95rem;
  font-weight: 500;
  color: var(--ink-soft);
}
.nav a:hover { color: var(--ink); }
.nav .btn { color: #fff; }
.nav .btn-ghost { color: var(--teal-dark); }
.nav .btn-ghost:hover { color: #fff; }

@media (max-width: 860px) {
  .nav .nav-link { display: none; }
  .brand small { display: none; }
}

/* ---------- Hero : la planche contrôlée ---------- */
.hero {
  padding: 64px 0 72px;
  background:
    linear-gradient(var(--line-soft) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px) 0 0 / 28px 28px,
    var(--paper);
  border-bottom: 1px solid var(--line);
}
.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  gap: 56px;
  align-items: center;
}
.hero-lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 46ch; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.hero-facts {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: .92rem;
  color: var(--ink-soft);
}
.hero-facts strong { display: block; color: var(--ink); font-size: 1rem; }

.sheet {
  background: var(--sheet);
  border: 1px solid var(--line);
  box-shadow: 0 1px 0 var(--line), 0 18px 40px -24px rgba(19, 41, 75, .35);
  padding: 14px;
  position: relative;
}
.sheet svg { width: 100%; height: auto; }
.sheet .pen { font-family: var(--hand); fill: var(--red); font-size: 21px; }
.sheet .pen-stroke { stroke: var(--red); fill: none; stroke-width: 2.2; stroke-linecap: round; }

@media (prefers-reduced-motion: no-preference) {
  .pen-draw { stroke-dasharray: 420; stroke-dashoffset: 420; animation: draw 1.1s ease-out forwards; }
  .pen-draw.d2 { animation-delay: .9s; }
  .pen-draw.d3 { animation-delay: 1.7s; }
  .pen-fade { opacity: 0; animation: fade .4s ease-out forwards; }
  .pen-fade.d1 { animation-delay: .9s; }
  .pen-fade.d2 { animation-delay: 1.7s; }
  .pen-fade.d3 { animation-delay: 2.5s; }
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }

@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 40px; }
}

/* ---------- Sections ---------- */
.section { padding: 84px 0; border-bottom: 1px solid var(--line); }
.section-white { background: var(--sheet); }
.section-head { max-width: 640px; margin-bottom: 44px; }

/* Étapes : vraie séquence, donc numérotée */
.steps {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 2px solid var(--teal);
}
.steps li { padding: 22px 22px 6px 0; position: relative; }
.steps li + li { padding-left: 22px; border-left: 1px solid var(--line); }
.step-num {
  font-stretch: 75%;
  font-weight: 800;
  font-size: 2.4rem;
  line-height: 1;
  color: var(--line);
  margin-bottom: 14px;
}
.steps p { font-size: .95rem; color: var(--ink-soft); }
@media (max-width: 860px) {
  .steps { grid-template-columns: 1fr 1fr; }
  .steps li:nth-child(3) { padding-left: 0; border-left: 0; }
  .steps li:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 520px) {
  .steps { grid-template-columns: 1fr; }
  .steps li, .steps li + li { padding-left: 0; border-left: 0; }
  .steps li + li { border-top: 1px solid var(--line); }
}

/* Types de dossiers : tableau, pas des cartes */
.dossier-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--sheet);
  border: 1px solid var(--line);
}
.dossier-table th, .dossier-table td {
  text-align: left;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
.dossier-table th {
  font-stretch: 80%;
  font-size: 1.05rem;
  width: 220px;
  white-space: nowrap;
}
.dossier-table td { color: var(--ink-soft); font-size: .96rem; }
.dossier-table tr:last-child th, .dossier-table tr:last-child td { border-bottom: 0; }
@media (max-width: 640px) {
  .dossier-table, .dossier-table tbody, .dossier-table tr, .dossier-table th, .dossier-table td { display: block; width: auto; }
  .dossier-table th { padding-bottom: 2px; border-bottom: 0; }
  .dossier-table td { padding-top: 0; }
}

/* Aperçu du rapport */
.split {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 56px;
  align-items: start;
}
@media (max-width: 900px) { .split { grid-template-columns: 1fr; gap: 32px; } }

.check-list { list-style: none; padding: 0; margin: 0 0 24px; }
.check-list li {
  padding: 10px 0 10px 30px;
  border-bottom: 1px solid var(--line-soft);
  position: relative;
}
.check-list li::before {
  content: "";
  position: absolute;
  left: 2px; top: 17px;
  width: 12px; height: 7px;
  border-left: 2px solid var(--green);
  border-bottom: 2px solid var(--green);
  transform: rotate(-45deg);
}

/* ---------- Statuts & sévérités ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .82rem;
  font-weight: 600;
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-ok { color: var(--green); background: var(--green-soft); }
.badge-ko { color: var(--red); background: var(--red-soft); }
.badge-wip { color: var(--amber); background: var(--amber-soft); }

.sev { font-size: .8rem; font-weight: 700; padding: 2px 8px; border-radius: var(--radius-s); white-space: nowrap; }
.sev-bloquant { color: #fff; background: var(--red); }
.sev-majeur { color: var(--red); background: var(--red-soft); }
.sev-mineur { color: var(--amber); background: var(--amber-soft); }

/* ---------- Tarifs ---------- */
.pricing {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  background: var(--sheet);
}
.plan { padding: 32px 28px; display: flex; flex-direction: column; }
.plan + .plan { border-left: 1px solid var(--line); }
.plan-featured { box-shadow: inset 0 4px 0 var(--teal); }
.plan-price { font-stretch: 78%; font-weight: 750; font-size: 2.6rem; line-height: 1; margin: 14px 0 4px; }
.plan-price span { font-size: 1rem; font-weight: 500; color: var(--ink-soft); font-stretch: 100%; }
.plan ul { list-style: none; padding: 0; margin: 20px 0 28px; flex: 1; }
.plan li { padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: .95rem; }
.plan .note { font-size: .86rem; color: var(--ink-soft); }
@media (max-width: 860px) {
  .pricing { grid-template-columns: 1fr; }
  .plan + .plan { border-left: 0; border-top: 1px solid var(--line); }
}

/* ---------- FAQ ---------- */
.faq { max-width: 780px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 20px 36px 20px 0;
  font-weight: 600;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute; right: 4px; top: 16px;
  font-size: 1.5rem; font-weight: 400;
}
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--ink-soft); padding-bottom: 12px; }

/* ---------- Bandeau final ---------- */
.cta-band { background: var(--teal-dark); color: #fff; padding: 88px 0; position: relative; overflow: hidden; }
.cta-band .wrap { display: flex; justify-content: space-between; align-items: center; gap: 32px; flex-wrap: wrap; }
.cta-band h2 { margin: 0; max-width: 20ch; }
.cta-band .btn { background: #fff; color: var(--teal-dark); border-color: #fff; }
.cta-band .btn-ghost { background: transparent; color: #fff; }
.cta-band .btn-ghost:hover { background: #fff; color: var(--teal-dark); }

/* ---------- Pied de page ---------- */
.site-footer { padding: 36px 0; font-size: .9rem; color: var(--ink-soft); background: var(--sheet); }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.site-footer a { color: var(--ink-soft); }

/* =========================================================
   Application (connexion, espace client, rapport)
   ========================================================= */

.demo-banner {
  background: var(--amber-soft);
  color: #6B3F05;
  font-size: .86rem;
  text-align: center;
  padding: 8px 16px;
  border-bottom: 1px solid #EED9B8;
}

/* Connexion */
.auth {
  min-height: calc(100vh - 68px - 36px);
  display: grid;
  place-items: center;
  padding: 48px 16px;
  background:
    linear-gradient(var(--line-soft) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px) 0 0 / 28px 28px,
    var(--paper);
}
.auth-box {
  width: 100%;
  max-width: 440px;
  background: var(--sheet);
  border: 1px solid var(--line);
  padding: 32px;
}
.tabs { display: flex; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.tab {
  flex: 1;
  font: inherit;
  font-weight: 600;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 10px 0 12px;
  color: var(--ink-soft);
  cursor: pointer;
  margin-bottom: -1px;
}
.tab[aria-selected="true"] { color: var(--teal-dark); border-bottom-color: var(--teal); }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: .9rem; font-weight: 600; margin-bottom: 6px; }
.field input, .field select {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: #fff;
  color: var(--ink);
}
.field input:focus, .field select:focus { outline: 2px solid var(--teal); outline-offset: 0; border-color: var(--teal); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 520px) { .field-row { grid-template-columns: 1fr; } }
.form-error { color: var(--red); font-size: .9rem; min-height: 1.3em; margin: 4px 0 10px; }
.auth-box .btn { width: 100%; }
.auth-foot { margin-top: 18px; font-size: .88rem; color: var(--ink-soft); text-align: center; }

/* Espace client */
.app { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: calc(100vh - 68px); }
.sidebar { background: var(--sheet); border-right: 1px solid var(--line); padding: 28px 18px; }
.sidebar nav a {
  display: block;
  text-decoration: none;
  padding: 9px 12px;
  border-radius: var(--radius-s);
  color: var(--ink-soft);
  font-weight: 500;
  font-size: .95rem;
}
.sidebar nav a[aria-current="page"] { background: var(--teal-soft); color: var(--teal-dark); font-weight: 650; }
.sidebar nav a:hover { color: var(--ink); }
.quota { margin-top: 32px; padding: 16px 12px; border-top: 1px solid var(--line); font-size: .88rem; color: var(--ink-soft); }
.quota strong { color: var(--ink); }
.meter { height: 6px; background: var(--line-soft); border-radius: 3px; margin: 10px 0 6px; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--teal); }

.main { padding: 36px 40px 64px; min-width: 0; }
.main-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.main-head h1 { font-size: 1.9rem; margin: 0; }

@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); padding: 14px 16px; }
  .sidebar nav { display: flex; gap: 6px; overflow-x: auto; }
  .sidebar nav a { white-space: nowrap; }
  .quota { display: none; }
  .main { padding: 28px 16px 56px; }
}

.panel { background: var(--sheet); border: 1px solid var(--line); margin-bottom: 28px; }
.panel-head { padding: 18px 24px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.panel-head h2 { font-size: 1.2rem; margin: 0; }
.panel-body { padding: 24px; }

.upload-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 28px; }
@media (max-width: 960px) { .upload-grid { grid-template-columns: 1fr; } }

.dropzone {
  border: 2px dashed var(--line);
  border-radius: var(--radius-m);
  padding: 36px 20px;
  text-align: center;
  background: var(--paper);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--teal); background: var(--teal-soft); }
.dropzone svg { margin: 0 auto 10px; }
.dropzone p { margin: 0 auto 4px; }
.dropzone .muted { font-size: .88rem; }

.file-list { list-style: none; padding: 0; margin: 14px 0 0; }
.file-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-s);
  margin-bottom: 6px;
  font-size: .92rem;
}
.file-list .ext { font-weight: 700; font-size: .75rem; padding: 2px 6px; border: 1px solid var(--ink); border-radius: 2px; margin-right: 8px; }
.file-list .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.file-list button { background: none; border: 0; color: var(--ink-soft); cursor: pointer; font-size: 1.1rem; padding: 0 4px; }
.file-list button:hover { color: var(--red); }

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .94rem; }
.data-table th {
  text-align: left;
  font-size: .82rem;
  font-weight: 600;
  color: var(--ink-soft);
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data-table td { padding: 14px 24px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table .ref { font-weight: 650; white-space: nowrap; }
.data-table .site { color: var(--ink-soft); font-size: .86rem; }
.data-table tr.is-new { animation: flash 1.6s ease-out; }
@keyframes flash { from { background: #EAF0F7; } to { background: transparent; } }

.progress { width: 90px; height: 4px; background: var(--line-soft); border-radius: 2px; overflow: hidden; margin-top: 6px; }
.progress span { display: block; height: 100%; background: var(--amber); width: 0; transition: width .3s linear; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff;
  padding: 12px 20px; border-radius: var(--radius-m);
  font-size: .94rem; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 50; max-width: calc(100% - 32px);
}
.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Rapport */
.report { max-width: 980px; margin: 0 auto; padding: 36px 24px 72px; }
.report-actions { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }

.report-sheet { background: var(--sheet); border: 1px solid var(--line); }
.cartouche {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  border-bottom: 2px solid var(--teal);
}
.cartouche > div { padding: 14px 18px; border-right: 1px solid var(--line); }
.cartouche > div:last-child { border-right: 0; }
.cartouche .k { font-size: .78rem; color: var(--ink-soft); display: block; }
.cartouche .v { font-weight: 650; font-stretch: 85%; font-size: 1.05rem; }
.cartouche .title { grid-column: 1 / -1; border-right: 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.cartouche .title h1 { font-size: 1.6rem; margin: 0; }
@media (max-width: 720px) {
  .cartouche { grid-template-columns: 1fr 1fr; }
  .cartouche > div:nth-child(odd):not(.title) { border-right: 0; }
  .cartouche > div:not(.title) { border-bottom: 1px solid var(--line-soft); }
}

.verdict { display: flex; gap: 22px; align-items: center; padding: 26px 24px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.verdict-stamp {
  font-stretch: 75%;
  font-weight: 800;
  font-size: 1.5rem;
  padding: 8px 18px;
  border: 3px solid currentColor;
  transform: rotate(-3deg);
  border-radius: 4px;
}
.verdict-stamp.ok { color: var(--green); }
.verdict-stamp.ko { color: var(--red); }
.verdict p { margin: 0; flex: 1; min-width: 240px; }

.counts { display: flex; gap: 0; border-bottom: 1px solid var(--line); }
.counts div { flex: 1; padding: 16px 24px; border-right: 1px solid var(--line-soft); }
.counts div:last-child { border-right: 0; }
.counts strong { display: block; font-size: 1.8rem; font-stretch: 78%; line-height: 1.1; }
.counts span { font-size: .86rem; color: var(--ink-soft); }

.anomaly { padding: 22px 24px; border-bottom: 1px solid var(--line-soft); display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 16px; }
.anomaly:last-child { border-bottom: 0; }
.anomaly-num {
  width: 40px; height: 40px;
  border: 2px solid var(--red);
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--hand);
  color: var(--red);
  font-size: 1.4rem;
  font-weight: 700;
}
.anomaly h3 { margin: 0 0 6px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.anomaly dl { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 4px 14px; margin: 10px 0 0; font-size: .93rem; }
.anomaly dt { color: var(--ink-soft); }
.anomaly dd { margin: 0; }
@media (max-width: 560px) {
  .anomaly { grid-template-columns: 1fr; }
  .anomaly dl { grid-template-columns: 1fr; }
  .anomaly dt { margin-top: 6px; }
}

.report-foot { padding: 18px 24px; font-size: .84rem; color: var(--ink-soft); border-top: 1px solid var(--line); }

@media print {
  .site-header, .demo-banner, .report-actions, .site-footer { display: none !important; }
  body { background: #fff; font-size: 12pt; }
  .report { padding: 0; max-width: none; }
  .report-sheet { border: 0; }
  .anomaly { break-inside: avoid; }
}

/* Ajustements */
.btn-small { white-space: nowrap; }
.data-table td.c-hide:nth-child(4) { white-space: nowrap; }
.data-table .c-status .muted { white-space: nowrap; }
.panel, .section { scroll-margin-top: 84px; }

.m-only { display: none; }
@media (max-width: 640px) {
  .data-table thead { display: none; }
  .data-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
  .data-table tr:last-child { border-bottom: 0; }
  .data-table td { padding: 0; border: 0; }
  .data-table .c-hide { display: none; }
  .data-table .c-status { grid-column: 1; }
  .data-table .c-action { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .m-only { display: block; }
}

.sheet { margin: 0; }

/* =========================================================
   Identité MPK : logo et photos
   ========================================================= */
.brand-logo { height: 40px; width: auto; }
.brand-product {
  font-stretch: 80%;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--grey);
  border-left: 1px solid var(--line);
  padding-left: 12px;
  margin-left: 2px;
}
.brand small { border-left: 0; padding-left: 0; }
h1, h2 { color: var(--ink); }
a { color: var(--teal-dark); }
.hero {
  background:
    linear-gradient(rgba(43,127,153,.08) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, rgba(43,127,153,.08) 1px, transparent 1px) 0 0 / 28px 28px,
    var(--paper);
}

/* Hero : photo du site + plan contrôlé posé dessus */
.hero-visual { position: relative; padding: 0 0 56px 56px; }
.hero-photo {
  margin: 0;
  aspect-ratio: 4 / 4.4;
  background: var(--teal-soft);
  overflow: hidden;
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; }
.hero-visual .sheet {
  position: absolute;
  left: 0; bottom: 0;
  width: 78%;
}
.photo-credit { font-size: .72rem; color: var(--grey); margin-top: 6px; text-align: right; }
@media (max-width: 900px) {
  .hero-visual { padding: 0 0 0 0; }
  .hero-photo { aspect-ratio: 16 / 10; }
  .hero-visual .sheet { position: relative; width: 92%; margin: -80px auto 0; }
}

/* Section terrain */
.field-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 14px;
  height: 560px;
}
.field-grid figure { margin: 0; position: relative; overflow: hidden; background: var(--teal-soft); }
.field-grid figure:first-child { grid-row: 1 / span 2; }
.field-grid img { width: 100%; height: 100%; object-fit: cover; }
.field-grid figcaption {
  position: absolute; left: 0; bottom: 0;
  background: rgba(23, 58, 72, .82);
  color: #fff;
  padding: 10px 16px;
  font-size: .92rem;
  font-weight: 600;
}
.field-intro { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: end; margin-bottom: 36px; }
.field-intro p { margin: 0; }
@media (max-width: 860px) {
  .field-intro { grid-template-columns: 1fr; gap: 12px; }
  .field-grid { grid-template-columns: 1fr; grid-template-rows: 260px 200px 200px; height: auto; }
  .field-grid figure:first-child { grid-row: auto; }
}

/* Bandeau final avec photo */
.cta-band::before {
  content: "";
  position: absolute; inset: 0;
  background: var(--cta-photo) center 30% / cover no-repeat;
  opacity: .22;
  filter: grayscale(.3);
}
.cta-band .wrap { position: relative; }

/* Connexion : photo à gauche sur grand écran */
.auth-split { display: grid; grid-template-columns: 1fr 1fr; min-height: calc(100vh - 68px - 36px); }
.auth-split .auth { min-height: 0; }
.auth-photo { position: relative; background: var(--teal-dark); overflow: hidden; }
.auth-photo img { width: 100%; height: 100%; object-fit: cover; opacity: .85; }
.auth-photo blockquote {
  position: absolute; left: 32px; right: 32px; bottom: 32px;
  margin: 0;
  color: #fff;
  font-size: 1.35rem;
  font-weight: 650;
  font-stretch: 85%;
  line-height: 1.3;
  text-shadow: 0 1px 12px rgba(0,0,0,.45);
}
@media (max-width: 900px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-photo { display: none; }
}
.cta-band h2 { color: #fff; }

/* =========================================================
   Mode serveur : moteur réel
   ========================================================= */
.live-banner { background: var(--teal-soft); color: var(--teal-dark); border-bottom-color: #CFE3EA; }
.badge-err { color: #fff; background: #8A5A5A; }
.valid-tick { font-size: .78rem; font-weight: 700; color: var(--teal-dark); white-space: nowrap; }
.valid-tick::before { content: "✓ "; }
.progress-indet { width: 110px; }
.progress-indet span { width: 35% !important; background: var(--teal); }
@media (prefers-reduced-motion: no-preference) {
  .progress-indet span { animation: indet 1.4s ease-in-out infinite; }
}
@keyframes indet { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }
.verdict-stamp.wip { color: var(--amber); }
.verdict-stamp.err { color: #8A5A5A; }
.cert { font-size: .78rem; font-weight: 600; color: var(--amber); border: 1px dashed var(--amber); padding: 1px 7px; border-radius: var(--radius-s); }
.report-block { padding: 22px 24px; border-top: 1px solid var(--line); }
.report-block h2 { font-size: 1.15rem; margin-bottom: 10px; }
.report-block .check-list { margin: 0; }
.report-block .check-list li { font-size: .93rem; }
.plain-list { margin: 0; padding-left: 20px; font-size: .93rem; color: var(--ink-soft); }
.plain-list li { padding: 3px 0; }
.data-table.plain th, .data-table.plain td { padding: 8px 12px 8px 0; font-size: .9rem; }
.internal-panel { border-left: 4px solid var(--teal); margin-bottom: 20px; }
.val-textarea { width: 100%; font: inherit; font-size: .95rem; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-s); resize: vertical; }
.val-textarea:focus { outline: 2px solid var(--teal); border-color: var(--teal); }
.valid-ok { margin: 0; font-weight: 600; color: var(--green); }
.valid-ok::before { content: "✓ "; }
@media print {
  #r-internal { display: none !important; }
  .report-block { break-inside: avoid; }
}

/* =========================================================
   Refonte v3 : fonds bleu clair, finitions professionnelles
   Les fonds de page sont bleu clair ; seules les cartes,
   tableaux et documents (rapport) restent blancs pour ressortir.
   ========================================================= */
:root {
  --sky-50: #F0F6F9;        /* fond principal */
  --sky-100: #E2EFF4;       /* sections alternées */
  --sky-200: #CFE3EB;       /* traits, bordures douces */
  --sky-300: #A9CCDA;
  --paper: var(--sky-50);
  --line: #C6DCE5;
  --line-soft: #DDEBF1;
  --radius-s: 6px;
  --radius-m: 10px;
  --radius-l: 14px;
  --shadow-card: 0 1px 2px rgba(23, 58, 72, .06), 0 8px 24px -12px rgba(23, 58, 72, .18);
  --shadow-lift: 0 2px 4px rgba(23, 58, 72, .06), 0 16px 36px -14px rgba(23, 58, 72, .26);
}

body { background: var(--sky-50); }

/* En-tête : bleu très clair translucide */
.site-header {
  background: rgba(240, 246, 249, .9);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--sky-200);
}
.btn { border-radius: var(--radius-s); }
.btn:not(.btn-ghost) { box-shadow: 0 1px 2px rgba(23, 58, 72, .12), 0 6px 14px -8px rgba(43, 127, 153, .55); }
.btn-ghost { background: rgba(255, 255, 255, .55); border-color: var(--sky-300); }
.btn-ghost:hover { border-color: var(--teal); }

/* Hero */
.hero {
  padding: 72px 0 88px;
  background:
    linear-gradient(rgba(43,127,153,.07) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, rgba(43,127,153,.07) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(160deg, #DCEDF4 0%, #EAF4F8 55%, var(--sky-50) 100%);
  border-bottom: 0;
}
.hero-facts { border-top-color: var(--sky-300); }
.hero-photo { border-radius: var(--radius-l); box-shadow: var(--shadow-lift); }
.sheet { border-radius: var(--radius-m); border-color: var(--sky-200); box-shadow: var(--shadow-lift); }

/* Sections : alternance de deux bleus clairs, sans filets */
.section { padding: 96px 0; border-bottom: 0; background: var(--sky-50); }
.section-alt, .section-white { background: var(--sky-100); }
.section-head h2::before, .field-intro h2::before {
  content: "";
  display: block;
  width: 36px; height: 3px;
  border-radius: 2px;
  background: var(--teal);
  margin-bottom: 18px;
}

/* Étapes en cartes blanches */
.steps { border-top: 0; gap: 18px; }
.steps li, .steps li + li {
  background: var(--sheet);
  border: 1px solid var(--sky-200);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-card);
  padding: 26px 24px 14px;
}
.step-num {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-size: 1.35rem;
  font-stretch: 85%;
  margin-bottom: 16px;
}
@media (max-width: 860px) {
  .steps li:nth-child(3), .steps li:nth-child(n+3) { border: 1px solid var(--sky-200); padding-left: 24px; }
}
@media (max-width: 520px) {
  .steps li, .steps li + li { padding-left: 24px; border: 1px solid var(--sky-200); }
}

/* Tableaux en cartes */
.dossier-table {
  border: 1px solid var(--sky-200);
  border-radius: var(--radius-m);
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.dossier-table th { color: var(--teal-dark); }
.dossier-table tr:nth-child(even) th, .dossier-table tr:nth-child(even) td { background: #F8FBFC; }

/* Aperçu du rapport et documents : feuilles blanches */
.report-sheet {
  border: 1px solid var(--sky-200);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

/* Photos terrain */
.field-grid figure { border-radius: var(--radius-m); box-shadow: var(--shadow-card); }
.field-grid figcaption { border-top-right-radius: var(--radius-s); }

/* Tarifs : trois cartes */
.pricing { border: 0; background: transparent; gap: 20px; align-items: stretch; }
.plan, .plan + .plan {
  background: var(--sheet);
  border: 1px solid var(--sky-200);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-card);
  position: relative;
}
.plan-featured {
  border: 2px solid var(--teal);
  box-shadow: var(--shadow-lift);
}
@media (min-width: 861px) { .plan-featured { transform: translateY(-10px); } }
.plan-tag {
  position: absolute;
  top: -13px; left: 26px;
  background: var(--teal);
  color: #fff;
  font-size: .78rem;
  font-weight: 650;
  padding: 4px 12px;
  border-radius: 999px;
}
.plan-price { color: var(--teal-dark); }
.plan li { border-bottom: 1px solid var(--line-soft); padding-left: 24px; position: relative; }
.plan li::before {
  content: "";
  position: absolute; left: 3px; top: 14px;
  width: 10px; height: 5px;
  border-left: 2px solid var(--teal);
  border-bottom: 2px solid var(--teal);
  transform: rotate(-45deg);
}
@media (max-width: 860px) {
  .plan + .plan { border-left: 1px solid var(--sky-200); border-top: 1px solid var(--sky-200); }
  .plan-featured { border-width: 2px; border-color: var(--teal); }
  .pricing { gap: 28px; }
}

/* FAQ en cartes */
.faq details {
  background: var(--sheet);
  border: 1px solid var(--sky-200);
  border-radius: var(--radius-m);
  margin-bottom: 12px;
  padding: 0 22px;
  box-shadow: 0 1px 2px rgba(23, 58, 72, .05);
}
.faq details[open] { box-shadow: var(--shadow-card); }
.faq summary::after { color: var(--teal); top: 15px; right: 0; }

/* Bandeau final et pied de page */
.cta-band { background: linear-gradient(120deg, #1F6176 0%, #2B7F99 100%); }
.site-footer { background: #173A48; color: #C9DCE3; }
.site-footer a { color: #E2EFF4; }

/* ---------- Application ---------- */
.demo-banner { border-bottom-color: #EED9B8; }
.app { background: var(--sky-50); }
.sidebar { background: var(--sky-100); border-right: 1px solid var(--sky-200); }
.sidebar nav a { border-radius: var(--radius-s); }
.sidebar nav a[aria-current="page"] { background: var(--sheet); box-shadow: var(--shadow-card); }
.quota { border-top-color: var(--sky-300); }
.meter { background: var(--sky-200); }
.panel {
  border: 1px solid var(--sky-200);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.panel-head { border-bottom-color: var(--line-soft); background: #F8FBFC; }
.dropzone { background: var(--sky-50); border-color: var(--sky-300); border-radius: var(--radius-m); }
.field input, .field select, .val-textarea { border-color: var(--sky-300); border-radius: var(--radius-s); }
.file-list li { border-color: var(--sky-200); background: var(--sky-50); border-radius: var(--radius-s); }
.data-table tbody tr:hover td { background: #F6FAFC; }
.internal-panel { border-left: 4px solid var(--teal); }

/* Connexion */
.auth {
  background:
    linear-gradient(rgba(43,127,153,.07) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, rgba(43,127,153,.07) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(160deg, #DCEDF4 0%, var(--sky-50) 100%);
}
.auth-box { border: 1px solid var(--sky-200); border-radius: var(--radius-l); box-shadow: var(--shadow-lift); }

/* Rapport : la page est bleu clair, le document reste une feuille blanche */
.report { padding-top: 40px; }
.cartouche .title { background: #F8FBFC; }

@media print {
  body, .app, .section, .report { background: #fff !important; }
  .report-sheet { box-shadow: none; border-radius: 0; }
}

/* Alerte clé API manquante */
.api-missing { border: 1px solid #EED9B8; border-left: 4px solid var(--amber); background: #FFFBF4; }
.api-missing h2 { font-size: 1.15rem; margin-bottom: 8px; color: #6B3F05; }
.api-missing p { margin-bottom: 8px; color: var(--ink-soft); }
.api-missing ol { margin: 0; padding-left: 20px; }
.api-missing li { padding: 3px 0; font-size: .95rem; }

/* =========================================================
   Espace admin MPK
   ========================================================= */
.admin-banner { background: #173A48; color: #DCEBF1; border-bottom-color: #173A48; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.nav-count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: var(--teal); color: #fff; font-size: .75rem; font-weight: 700; text-align: center; line-height: 1.6; }
.nav-count:empty { display: none; }

.kpis { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 16px; margin-bottom: 28px; }
.kpi {
  background: var(--sheet);
  border: 1px solid var(--sky-200);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-card);
  padding: 18px 20px;
  display: flex; flex-direction: column; gap: 4px;
  text-decoration: none; color: var(--ink);
}
.kpi-label { font-size: .88rem; color: var(--ink-soft); }
.kpi-value { font-size: 2rem; font-weight: 650; line-height: 1.15; font-stretch: 90%; }
.kpi-sub { font-size: .82rem; color: var(--ink-soft); }
.kpi-hero { border: 2px solid var(--teal); }
.kpi-hero .kpi-value { font-size: 3rem; color: var(--teal-dark); }
.kpi-hero:hover, a.kpi:hover { box-shadow: var(--shadow-lift); }
.kpi-alert { border: 2px solid var(--red); }
.kpi-alert .kpi-value { color: var(--red); }
@media (max-width: 1100px) { .kpis { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .kpis { grid-template-columns: 1fr; } .kpi-hero .kpi-value { font-size: 2.4rem; } }

.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters input, .filters select {
  font: inherit; font-size: .9rem;
  padding: 7px 10px;
  border: 1px solid var(--sky-300);
  border-radius: var(--radius-s);
  background: #fff; color: var(--ink);
}
.filters input { min-width: 200px; }
.filters input:focus, .filters select:focus { outline: 2px solid var(--teal); border-color: var(--teal); }

.admin-table td { vertical-align: middle; }
.data-table th.num, .data-table td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.btn-danger { color: var(--red); border-color: #E7B7BF; }
.btn-danger:hover { background: var(--red); border-color: var(--red); color: #fff; }
.badge-valide { color: var(--teal-dark); background: var(--teal-soft); }
.badge-todo { color: #6B3F05; background: var(--amber-soft); }
.tag-sim { font-size: .7rem; font-weight: 600; color: var(--ink-soft); border: 1px solid var(--line); border-radius: 3px; padding: 0 5px; margin-left: 4px; vertical-align: 2px; }
.sev-row { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.err-detail { font-size: .78rem; color: #8A5A5A; margin-top: 4px; max-width: 280px; }
.empty-row { padding: 28px 24px !important; color: var(--ink-soft); text-align: center; }
.table-foot { font-size: .84rem; padding: 12px 24px; margin: 0; border-top: 1px solid var(--line-soft); max-width: none; }
code.file { font-size: .86rem; background: var(--sky-50); border: 1px solid var(--sky-200); border-radius: 4px; padding: 1px 6px; }

.cost-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.cost-grid h3 { font-size: 1rem; margin-bottom: 8px; }
.cost-table th, .cost-table td { padding: 8px 10px 8px 0 !important; }
@media (max-width: 960px) { .cost-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .filters { width: 100%; }
  .filters input, .filters select { flex: 1 1 140px; min-width: 0; }
  .cost-table thead { display: table-header-group !important; }
  .cost-table tr { display: table-row !important; padding: 0 !important; }
  .cost-table td, .cost-table th { display: table-cell !important; }
  .row-actions { justify-content: flex-start; }
  .admin-table .c-action { grid-column: 1 / -1 !important; grid-row: auto !important; }
}
.tag-det { font-size: .68rem; font-weight: 600; color: var(--teal-dark); background: var(--teal-soft); border-radius: 3px; padding: 0 5px; vertical-align: 1px; }
.admin-table .row-actions .btn-small { padding: .4em .7em; font-size: .82rem; }
.admin-table td, .admin-table th { padding-left: 16px; padding-right: 16px; }

/* =========================================================
   Étape 2 : comptes clients
   ========================================================= */
.nav-count-soft { background: var(--sky-200); color: var(--ink); }
.field textarea, .fiche textarea {
  width: 100%; font: inherit; font-size: .95rem; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--radius-s); background: #fff; color: var(--ink); resize: vertical;
}
.field textarea:focus { outline: 2px solid var(--teal); border-color: var(--teal); }
.field-row-3 { grid-template-columns: 1fr 2fr 1.2fr; }
.field-row-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 720px) { .field-row-3, .field-row-4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .field-row-3, .field-row-4 { grid-template-columns: 1fr; } }
.auth-note { font-size: .9rem; background: var(--teal-soft); border-left: 3px solid var(--teal); padding: 10px 12px; margin: 0 0 16px; }

/* Mon compte (espace client) */
.compte-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 40px; }
.compte-grid h3 { font-size: 1rem; margin: 0 0 12px; }
.compte-grid h3 ~ h3 { margin-top: 10px; }
#form-mdp { border-left: 1px solid var(--line-soft); padding-left: 40px; }
.notice-temp { background: var(--amber-soft); color: #6B3F05; border-left: 3px solid var(--amber); padding: 10px 12px; font-size: .92rem; }
@media (max-width: 960px) {
  .compte-grid { grid-template-columns: 1fr; gap: 24px; }
  #form-mdp { border-left: 0; padding-left: 0; border-top: 1px solid var(--line-soft); padding-top: 24px; }
}

/* Clients (admin) */
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--teal-dark); cursor: pointer; text-align: left; text-decoration: underline; text-decoration-color: var(--sky-300); text-underline-offset: 3px; }
.link-btn:hover { text-decoration-color: var(--teal); }
.link-btn.ref { font-weight: 650; color: var(--ink); }
.coord a { color: var(--teal-dark); font-size: .92rem; text-decoration: none; }
.coord a:hover { text-decoration: underline; }
.usage { min-width: 170px; font-size: .92rem; }
.usage-bar { height: 5px; background: var(--sky-200); border-radius: 3px; margin: 6px 0 3px; overflow: hidden; max-width: 180px; }
.usage-bar span { display: block; height: 100%; background: var(--teal); }
.usage-bar.plein span { background: var(--amber); }
.marge-neg { color: var(--red); font-weight: 600; }

/* Fiche client */
.fiche {
  width: min(1000px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  padding: 0; border: 1px solid var(--sky-200); border-radius: var(--radius-m);
  background: var(--sky-50); color: var(--ink); box-shadow: var(--shadow-lift);
  display: none; flex-direction: column; overflow: hidden;
}
.fiche[open] { display: flex; }
.fiche::backdrop { background: rgba(23, 58, 72, .45); }
.fiche-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 18px 24px; background: #fff; border-bottom: 1px solid var(--sky-200); }
.fiche-head h2 { font-size: 1.35rem; margin: 0 0 6px; }
.fiche-tags { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.fiche-close { background: none; border: 1px solid var(--sky-300); border-radius: var(--radius-s); width: 36px; height: 36px; font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--ink); }
.fiche-close:hover { background: var(--teal-soft); }
.fiche-body { overflow-y: auto; padding: 20px 24px 28px; }
.fiche fieldset { border: 1px solid var(--sky-200); border-radius: var(--radius-m); background: #fff; padding: 14px 18px 4px; margin: 0 0 16px; min-width: 0; }
.fiche legend { font-weight: 650; font-size: .95rem; padding: 0 6px; }
.fiche-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.fiche-cols fieldset { margin-bottom: 16px; }
@media (max-width: 760px) { .fiche-cols { grid-template-columns: 1fr; gap: 0; } }
.fiche-liens { display: flex; gap: 8px; margin: -4px 0 14px; }
.fiche-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 18px; }
.fiche-stats:empty { display: none; }
.fiche-stats .fs { background: #fff; border: 1px solid var(--sky-200); border-radius: var(--radius-m); padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; }
.fiche-stats strong { font-size: 1.15rem; }
@media (max-width: 860px) { .fiche-stats { grid-template-columns: 1fr 1fr; } }
.contact-row { display: grid; grid-template-columns: 1.2fr 1fr 1.4fr 1fr auto; gap: 8px; margin-bottom: 8px; }
.contact-row input { font: inherit; font-size: .92rem; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-s); min-width: 0; }
.contact-row input:focus { outline: 2px solid var(--teal); border-color: var(--teal); }
@media (max-width: 760px) { .contact-row { grid-template-columns: 1fr 1fr; } }
#btn-ajout-contact { margin-bottom: 12px; }
.fiche-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.fiche-dossiers { margin-top: 26px; }
.fiche-dossiers h3 { font-size: 1.05rem; margin-bottom: 8px; }
.fiche-dossiers .table-wrap { background: #fff; border: 1px solid var(--sky-200); border-radius: var(--radius-m); padding: 0 14px; }
.mdp-box { background: #fff; border: 2px solid var(--teal); border-radius: var(--radius-m); padding: 14px 18px; margin-bottom: 18px; }
.mdp-box p { margin: 0 0 8px; }
.mdp-line { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.mdp-line code { font-size: 1.25rem; letter-spacing: .06em; background: var(--sky-50); border: 1px solid var(--sky-200); border-radius: 4px; padding: 4px 12px; user-select: all; }

/* Référentiels clients */
.ref-line { padding: 10px 24px; font-size: .9rem; background: var(--amber-soft); border-bottom: 1px solid #EED9B8; }
.ref-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 32px; }
@media (max-width: 960px) { .ref-grid { grid-template-columns: 1fr; gap: 20px; } }
.ref-grid h3 { font-size: 1rem; margin: 0 0 10px; }
.ref-list { list-style: none; margin: 0; padding: 0; }
.ref-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.ref-list li:last-child { border-bottom: 0; }
.ref-list .ext { font-size: .7rem; font-weight: 700; color: var(--teal-dark); background: var(--teal-soft); border-radius: 3px; padding: 3px 6px; }
.ref-list .nom { font-weight: 600; }
.ref-list .site { font-size: .82rem; }
.field-file input[type=file] { font: inherit; font-size: .92rem; padding: 8px; border: 1px dashed var(--sky-300); border-radius: var(--radius-s); background: var(--sky-50); width: 100%; }
.check-line { display: flex; gap: 8px; align-items: flex-start; font-size: .9rem; margin: -6px 0 14px; }
.check-line input { margin-top: 3px; }
.tag-ref { font-size: .7rem; font-weight: 600; color: #6B3F05; background: var(--amber-soft); border-radius: 3px; padding: 0 5px; margin-left: 4px; }
.tag-archive { font-size: .7rem; font-weight: 600; color: var(--ink-soft); border: 1px solid var(--line); border-radius: 3px; padding: 0 5px; margin-left: 4px; }
.label-link { float: right; font-weight: 500; font-size: .85rem; color: var(--teal-dark); }

/* Paiements et factures */
.nav-alert { background: var(--amber); }
.facture-resume { display: flex; gap: 28px; flex-wrap: wrap; align-items: center; padding-top: 14px; padding-bottom: 14px; }
.facture-resume:empty { display: none; }
.facture-resume .fs strong { display: block; font-size: 1.3rem; }
.facture-resume .alerte { flex: 1 1 100%; background: var(--amber-soft); border-left: 3px solid var(--amber); padding: 10px 12px; color: #6B3F05; font-size: .92rem; }
.fs-plain { border: 1px solid var(--sky-200); border-radius: var(--radius-m); padding: 14px 18px 4px; margin: 0 0 16px; min-width: 0; }
.fs-plain legend { font-weight: 650; font-size: .95rem; padding: 0 6px; }
.aide { font-size: .84rem; margin: -4px 0 12px; }
.fiche-petite { width: min(560px, calc(100vw - 32px)); }
.paiement-carte { border: 1px solid var(--sky-200); border-left: 3px solid var(--teal); border-radius: var(--radius-m); padding: 16px 18px; background: var(--sky-50); margin-top: 18px; }
.paiement-carte h3 { font-size: 1rem; margin: 0 0 10px; }
.paiement-carte dl { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 6px 12px; margin: 0; font-size: .94rem; }
.paiement-carte dt { color: var(--ink-soft); }
.paiement-carte dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.paiement-carte .copier { margin-left: 8px; font-size: .78rem; padding: 1px 8px; }
@media (max-width: 520px) { .paiement-carte dl { grid-template-columns: 1fr; } .paiement-carte dt { margin-top: 6px; } }

/* Règlement d'utilisation */
.legal { max-width: 860px; margin: 0 auto; padding: 40px 24px 80px; }
.legal-head h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin-bottom: 4px; }
.legal-resume { background: #fff; border: 1px solid var(--sky-200); border-left: 4px solid var(--teal); border-radius: var(--radius-m); padding: 18px 24px; margin: 24px 0; box-shadow: var(--shadow-card); }
.legal-resume h2 { font-size: 1.1rem; margin: 0 0 10px; }
.legal-resume ol { margin: 0; padding-left: 20px; }
.legal-resume li { padding: 4px 0; }
.legal-sommaire { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .9rem; margin-bottom: 28px; }
.legal-sommaire a { color: var(--teal-dark); text-decoration: none; }
.legal-sommaire a:hover { text-decoration: underline; }
.legal-body { background: #fff; border: 1px solid var(--sky-200); border-radius: var(--radius-m); padding: 8px 32px 24px; box-shadow: var(--shadow-card); }
.legal-body section { padding: 18px 0; border-bottom: 1px solid var(--line-soft); scroll-margin-top: 84px; }
.legal-body section:last-child { border-bottom: 0; }
.legal-body h2 { font-size: 1.15rem; margin: 0 0 10px; color: var(--teal-dark); }
.legal-body p, .legal-body li { line-height: 1.6; max-width: 72ch; }
.legal-body ul, .legal-body ol { padding-left: 20px; }
.legal-body li { padding: 3px 0; }
.legal-dl { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 8px 16px; margin: 0; }
.legal-dl dt { font-weight: 650; }
.legal-dl dd { margin: 0; }
@media (max-width: 600px) { .legal-body { padding: 4px 18px 18px; } .legal-dl { grid-template-columns: 1fr; gap: 2px; } .legal-dl dd { margin-bottom: 8px; } }
.accept-line { margin: 4px 0 6px; }
.accept-line a { color: var(--teal-dark); }

/* ---------- Assistant de l'espace client ---------- */
.mpka-bouton { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: inline-flex; align-items: center; gap: 8px;
  padding: 0 18px; height: 50px; border-radius: 999px; border: 0; background: var(--teal); color: #fff; font: 600 15px/1 var(--font);
  box-shadow: 0 8px 24px -8px rgba(23,58,72,.55); cursor: pointer; }
.mpka-bouton:hover { background: var(--teal-dark); }
.mpka-panneau { position: fixed; right: 20px; bottom: 20px; z-index: 61; width: 380px; max-width: calc(100vw - 32px);
  height: 560px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: #fff;
  border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 16px 48px -12px rgba(23,58,72,.45); overflow: hidden; }
.mpka-panneau[hidden], .mpka-bouton[hidden] { display: none; }
.mpka-tete { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 14px 16px; background: var(--ink); color: #fff; }
.mpka-tete strong { display: block; font-size: 15px; }
.mpka-tete span { display: block; font-size: 12px; color: #B9CFD8; margin-top: 2px; }
.mpka-fermer { background: none; border: 0; color: #fff; font-size: 24px; line-height: 1; cursor: pointer; padding: 0 2px; }
.mpka-fil { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--paper); }
.mpka-msg { max-width: 88%; padding: 9px 12px; border-radius: 12px; font-size: 14px; line-height: 1.45; }
.mpka-msg p { margin: 0 0 6px; } .mpka-msg p:last-child { margin: 0; }
.mpka-assistant { align-self: flex-start; background: #fff; border: 1px solid var(--line-soft); color: var(--ink); }
.mpka-user { align-self: flex-end; background: var(--teal); color: #fff; }
.mpka-err { border-color: #E8B4BD; background: var(--red-soft); }
.mpka-attente { color: var(--ink-soft); }
.mpka-suggestions { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 14px 0; background: var(--paper); }
.mpka-suggestions[hidden] { display: none; }
.mpka-sugg { border: 1px solid var(--line); background: #fff; color: var(--teal-dark); border-radius: 999px; padding: 6px 10px; font: 500 12.5px/1.2 var(--font); cursor: pointer; }
.mpka-sugg:hover { background: var(--teal-soft); }
.mpka-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line-soft); background: #fff; }
.mpka-form textarea { flex: 1; resize: none; border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; font: 14px/1.4 var(--font); color: var(--ink); max-height: 120px; }
.mpka-envoi { border: 0; background: var(--teal); color: #fff; border-radius: 10px; padding: 0 14px; font: 600 14px var(--font); cursor: pointer; }
.mpka-envoi:disabled { opacity: .5; cursor: default; }
.mpka-note { margin: 0; padding: 0 12px 10px; font-size: 11.5px; color: var(--ink-soft); background: #fff; }
@media (max-width: 600px) {
  .mpka-panneau { right: 0; bottom: 0; width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
  .mpka-bouton { right: 14px; bottom: 14px; }
}

/* Mot de passe oublié / nouveau mot de passe */
.auth-titre { font-size: 1.25rem; margin: 0 0 8px; color: var(--ink); }
.auth-intro { font-size: .92rem; margin: 0 0 16px; }
.form-ok { color: var(--green); background: var(--green-soft); border-radius: var(--radius-s); font-size: .92rem; padding: 10px 12px; margin: 4px 0 12px; }

/* Fiabilité de l'agent (vue MPK du rapport) */
.verdict-barre { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: .88rem; }
.verdict-btn { font: inherit; font-size: .85rem; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; }
.verdict-btn:hover { border-color: var(--teal); }
.verdict-btn.v-juste.is-on { background: var(--green-soft); border-color: var(--green); color: var(--green); font-weight: 600; }
.verdict-btn.v-gravite.is-on { background: var(--amber-soft); border-color: var(--amber); color: var(--amber); font-weight: 600; }
.verdict-btn.v-fausse.is-on { background: var(--red-soft); border-color: var(--red); color: var(--red); font-weight: 600; }
.verdict-lien { display: flex; align-items: center; gap: 6px; flex-basis: 100%; margin-top: 4px; }
.verdict-lien select { font: inherit; font-size: .85rem; padding: 4px 6px; max-width: 100%; }
.fiab-panel { border-top: 1px solid var(--line-soft); }
.fiab-panel h3 { font-size: 1rem; margin: 0 0 8px; }
.fiab-panel h4 { font-size: .92rem; margin: 14px 0 6px; }
.fiab-score { margin: 0 0 6px; font-size: .92rem; line-height: 1.7; }
.fiab-liste { margin: 0 0 8px; padding-left: 18px; font-size: .9rem; line-height: 1.5; }
.fiab-liste li { margin-bottom: 6px; }
.fiab-form { display: grid; grid-template-columns: 2fr 1fr auto; gap: 8px; margin-top: 6px; }
.fiab-form input, .fiab-form select { font: inherit; font-size: .9rem; padding: 7px 9px; border: 1px solid var(--line); border-radius: var(--radius-s); min-width: 0; }
.fiab-form #ou-detail { grid-column: 1 / 3; }
@media (max-width: 640px) { .fiab-form { grid-template-columns: 1fr; } .fiab-form #ou-detail { grid-column: auto; } }
@media print { .verdict-barre, .fiab-panel { display: none !important; } }
.verdict-btn.v-regle { border-style: dashed; color: var(--teal-dark); }
.verdict-btn.v-regle:hover { background: var(--teal-soft); }
.tag-regle { display: inline-block; font-size: .78rem; padding: 2px 8px; border-radius: 999px; background: var(--sky-50, #F3F6F7); border: 1px solid var(--line); color: var(--ink-soft); }
.tag-regle.is-actif { background: var(--teal-soft); border-color: var(--teal); color: var(--teal-dark); font-weight: 600; }

/* =========================================================
   Corrections par MPK Structures (devis)
   ========================================================= */
.correction-panel { margin-top: 24px; border-left: 4px solid var(--teal); }
.correction-panel .panel-head h2 { font-size: 1.15rem; }
.correction-panel .panel-body > p:first-child { margin-top: 0; }
.dc-lignes td, .dc-lignes th, .dc-edit td, .dc-edit th { vertical-align: middle; }
.dc-totaux { display: grid; grid-template-columns: 1fr auto; gap: 4px 24px; max-width: 340px; margin: 10px 0 16px auto; font-size: .95rem; }
.dc-totaux dt { color: var(--ink-soft); text-align: right; }
.dc-totaux dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.dc-totaux .dc-ttc { font-weight: 700; color: var(--ink); border-top: 1px solid var(--line); padding-top: 4px; }
.dc-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.dc-note { background: var(--sky-50); border-left: 3px solid var(--teal); padding: 8px 12px; }
.dc-conditions { font-size: .85rem; }
.dc-fichiers { margin: 6px 0 14px; padding-left: 1.2em; }
.dc-fichiers li { margin: 3px 0; }
.dc-alerte { background: var(--amber-soft); border-left: 3px solid var(--amber); padding: 10px 12px; color: #6B3F05; font-size: .92rem; margin: 0 0 12px; }
.dc-h3 { font-size: 1rem; margin: 22px 0 8px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.dc-edit input, .dc-exceptions select {
  font: inherit; font-size: .92rem; color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; width: 100%; min-width: 0;
}
.dc-edit input:focus, .dc-exceptions select:focus { outline: 2px solid var(--teal); outline-offset: 0; border-color: var(--teal); }
.dc-exceptions select { width: auto; }
.dc-edit .dc-qte { width: 70px; }
.dc-edit .dc-pu { width: 110px; text-align: right; }
.dc-edit td.num, .dc-edit th.num { white-space: nowrap; }
.dc-total-live { font-size: 1rem; margin: 0 0 14px; }
.dc-historique { margin-top: 18px; font-size: .88rem; }
.dc-historique ul { margin: 8px 0 0; padding-left: 1.2em; }
.dc-reglages { border-top: 1px solid var(--line-soft); }
.dc-reglages > summary { cursor: pointer; padding: 14px 24px; font-weight: 650; }
.dc-reglages > summary .muted { font-weight: 400; font-size: .88rem; }
.dc-exceptions { list-style: none; margin: 0 0 12px; padding: 0; }
.dc-exceptions li { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line-soft); font-size: .9rem; }
.dc-exceptions li span { flex: 1; }
#dc-resume > div { display: flex; flex-direction: column; }
#dc-resume strong { font-size: 1.3rem; }
@media print { .correction-panel { display: none !important; } }
@media (max-width: 700px) { .dc-edit .dc-pu { width: 80px; } }
.btn-corriger { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn-corriger:hover { background: var(--teal-dark, #1d5f6b); border-color: var(--teal-dark, #1d5f6b); color: #fff; }

/* Une page par rubrique (admin et espace client) */
.page-cachee { display: none !important; }
.page-client .panel { margin-bottom: 20px; }
.page-client-retour { margin: 0 0 12px; }
.page-client-tete { align-items: flex-start; }
.page-client-tete h2 { font-size: 1.35rem; }
.page-client .facture-resume > div { display: flex; flex-direction: column; gap: 2px; }
.page-client .facture-resume > div > .muted { font-size: .85rem; }
.page-client .facture-resume strong { font-size: 1.15rem; }
