/* VMC Solutions · outil apporteur d'affaires. Palette reprise de vmc-solutions.fr. */
:root {
  --bg: #f7f4f4;
  --ink: #323f4b;
  --muted: #6b6459;
  --line: #e2dace;
  --card: #ffffff;
  --brand: #d7263d;
  --brand-dark: #a61d30;
  --brand-soft: #fbe9eb;
  --ok: #1f7a4d;
  --ok-soft: #e4f3ea;
  --warn: #8a6f12;
  --warn-soft: #fbf3d9;
  --info: #2d7da4;
  --info-soft: #e3f0f6;
  --cream: #f0eae0;
  --whatsapp: #1c8a4c;
  --radius: 14px;
  --font: 'Poppins', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Teko', 'Poppins', ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font);
}
a { color: var(--brand-dark); }
img { max-width: 100%; height: auto; }
h1, h2 { font-family: var(--font-display); font-weight: 600; letter-spacing: .01em; line-height: 1.05; margin: 0 0 .4em; }
h2 { font-size: 1.55rem; }
p { margin: 0 0 .6em; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.prewrap { white-space: pre-wrap; }

/* ---------- En-tête et navigation ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
  background: var(--card); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand span { font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; padding-top: 4px; }
.tabs {
  position: sticky; top: 0; z-index: 10;
  display: flex; gap: 4px; align-items: center;
  padding: 6px 12px; overflow-x: auto;
  background: rgba(247, 244, 244, .96); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.tabs a, .tabs button {
  flex: none; padding: 8px 14px; border-radius: 999px;
  color: var(--ink); text-decoration: none; font: 500 .92rem var(--font);
  background: none; border: 0; cursor: pointer;
}
.tabs a[aria-current="page"] { background: var(--ink); color: #fff; }
.tabs-logout { margin-left: auto; }
.tabs-logout button { color: var(--muted); }

.page { max-width: 1080px; margin: 0 auto; padding: 18px 16px 64px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.page-title { font-size: 2.2rem; margin: 0; }

/* ---------- Cartes ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 14px;
}
.card-accent { border: 2px solid var(--brand); background: linear-gradient(0deg, var(--card), var(--card)); }
.card-off { opacity: .6; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font: 500 .93rem var(--font); text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--ink); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-danger { color: var(--brand-dark); border-color: var(--brand); }
.btn-whatsapp { background: var(--whatsapp); border-color: var(--whatsapp); color: #fff; }
.btn-small { min-height: 36px; padding: 0 12px; font-size: .85rem; }
.btn-block { width: 100%; }
.btn-new { min-height: 40px; }

/* ---------- Formulaires ---------- */
.stack > * + * { margin-top: 12px; }
.form-grid { display: grid; gap: 0; }
.form-narrow { max-width: 620px; }
.row-2 { display: grid; gap: 0 12px; grid-template-columns: 1fr; }
.field { display: block; margin: 0 0 12px; border: 0; padding: 0; min-width: 0; }
.field > span, .field > legend { display: block; font-size: .85rem; font-weight: 500; color: var(--muted); margin-bottom: 4px; padding: 0; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=search],
input[type=date], input[type=time], input[type=datetime-local], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
  font: 16px var(--font); /* 16 px : évite le zoom automatique sur iPhone */
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: transparent; }
[aria-invalid="true"] { border-color: var(--brand); background: var(--brand-soft); }
.field-error { color: var(--brand-dark); font-size: .82rem; margin: 4px 0 0; }
.check { display: flex; gap: 10px; align-items: center; }
.check input { width: 20px; height: 20px; accent-color: var(--brand); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips label {
  padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: #fff; cursor: pointer; font-size: .92rem; user-select: none;
}
.chips input:checked + label { background: var(--ink); border-color: var(--ink); color: #fff; }
.chips input:focus-visible + label { outline: 2px solid var(--brand); outline-offset: 2px; }

.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-bottom: 10px; }
.inline-form > select, .inline-form > input[type=text], .inline-form > input[type=email] { flex: 1 1 200px; width: auto; }
.inline-form .field { margin: 0; flex: 1 1 150px; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.form-actions { position: sticky; bottom: 0; padding: 12px 0 calc(env(safe-area-inset-bottom) + 12px); background: linear-gradient(transparent, var(--bg) 30%); }
.filters { display: grid; gap: 8px; grid-template-columns: 1fr; margin-bottom: 14px; }

.dup-alert { background: var(--warn-soft); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-size: .9rem; }

/* ---------- Messages ---------- */
.flash { padding: 12px 14px; border-radius: 10px; margin: 0 0 14px; background: var(--ok-soft); color: var(--ok); font-weight: 500; }
.flash-error { background: var(--brand-soft); color: var(--brand-dark); }
.flash-warn { background: var(--warn-soft); color: var(--warn); }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.badge-brand { background: var(--brand-soft); color: var(--brand-dark); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-muted { background: var(--cream); color: var(--muted); }

/* ---------- Tableau de bord ---------- */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.stat {
  display: flex; flex-direction: column; padding: 14px 16px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--line); color: var(--ink); text-decoration: none;
}
.stat b { font-family: var(--font-display); font-size: 2.6rem; line-height: 1; font-weight: 600; }
.stat span { color: var(--muted); font-size: .88rem; }
.stat-brand b { color: var(--brand); }
.stat-warn b { color: var(--warn); }
.stat-ok b { color: var(--ok); }

.lead-row {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  padding: 12px 0; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none;
}
.card > h2 + .lead-row, .card > .card-head + .lead-row, .card > p + .lead-row { border-top: 0; }
.lead-main { display: flex; flex-direction: column; min-width: 0; }
.lead-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.late-row { border-top: 1px solid var(--line); padding-bottom: 12px; }
.late-row .lead-row { border-top: 0; }

.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { padding: 8px 6px; text-align: left; border-top: 1px solid var(--line); }
.table th { color: var(--muted); font-weight: 500; border-top: 0; }

/* ---------- Fiche contact ---------- */
.quick-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.cols { display: grid; gap: 0 14px; grid-template-columns: 1fr; }
.details { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; margin: 0; }
.details dt { color: var(--muted); font-size: .85rem; padding-top: 2px; }
.details dd { margin: 0; overflow-wrap: anywhere; }
.note-internal { margin-top: 12px; padding: 10px 12px; background: var(--cream); border-radius: 10px; font-size: .9rem; }

.steps { list-style: none; margin: 8px 0 12px; padding: 0; }
.steps li { position: relative; padding: 0 0 14px 30px; display: flex; flex-direction: column; }
.steps li::before {
  content: ''; position: absolute; left: 0; top: 3px; width: 16px; height: 16px;
  border-radius: 50%; border: 2px solid var(--line); background: #fff;
}
.steps li::after { content: ''; position: absolute; left: 8px; top: 22px; bottom: 0; width: 2px; background: var(--line); }
.steps li:last-child::after { display: none; }
.steps li.done::before { background: var(--ok); border-color: var(--ok); }
.steps li.current::before { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.steps span { color: var(--muted); font-size: .88rem; }

.update-box { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 6px; }
.update-box summary { cursor: pointer; font-weight: 500; padding: 6px 0 10px; }

.timeline { list-style: none; margin: 10px 0 0; padding: 0; }
.timeline li { display: flex; flex-direction: column; padding: 8px 0; border-top: 1px solid var(--line); font-size: .92rem; }

/* ---------- Partenaires ---------- */
.partner-grid { display: grid; gap: 0 14px; grid-template-columns: 1fr; }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 0; }
.mini-stats div { background: var(--bg); border-radius: 10px; padding: 8px 10px; }
.mini-stats dt { font-size: .75rem; color: var(--muted); }
.mini-stats dd { margin: 0; font-weight: 600; }

/* ---------- Connexion ---------- */
.auth { max-width: 380px; margin: 8vh auto 0; text-align: center; }
.auth form { text-align: left; }
.auth h1 { font-size: 2.2rem; margin-top: 10px; }

/* ---------- Écrans plus larges ---------- */
@media (min-width: 720px) {
  .row-2 { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .filters { grid-template-columns: 2fr 1fr 1fr auto; }
  .partner-grid { grid-template-columns: 1fr 1fr; }
  .form-actions { position: static; background: none; }
  .form-actions .btn-block { width: auto; min-width: 260px; }
}
@media (min-width: 960px) {
  .cols { grid-template-columns: minmax(0, 1fr) 320px; }
  .form-grid { grid-template-columns: 1fr 1fr; gap: 0 14px; align-items: start; }
  .form-grid .form-actions { grid-column: 1 / -1; }
}

/* ---------- Page partenaire ---------- */
.partner-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.partner-head img { margin-top: 4px; }
.files { margin: 0 0 10px; }
input[type=file] { width: 100%; padding: 10px; border: 1px dashed var(--line); border-radius: 10px; background: #fff; font: 15px var(--font); }

/* ---------- Interventions ---------- */
.form-wide { grid-column: 1 / -1; }
.room-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 10px 0; border-top: 1px solid var(--line); }
.room-row:first-child { border-top: 0; }
.room-row [data-room-remove] { justify-self: end; }
.checks { display: grid; gap: 10px; }
.obs-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; font-size: .92rem; }
.conclusion-line { font-weight: 500; }
.photo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 12px; }
.photo-grid figure { margin: 0; }
.photo-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; display: block; }
.photo-grid figcaption { font-size: .82rem; color: var(--muted); display: flex; justify-content: space-between; gap: 6px; padding-top: 4px; }
.inline { display: inline; }
.link-btn { background: none; border: 0; padding: 0; color: var(--brand-dark); font: inherit; text-decoration: underline; cursor: pointer; }
.doc-list { list-style: none; padding: 0; margin: 12px 0 0; }
.doc-list li { display: flex; flex-direction: column; padding: 8px 0; border-top: 1px solid var(--line); }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 1.05rem; letter-spacing: .04em; }

/* ---------- Devis ---------- */
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; }
.line-head { display: none; }
.line-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; padding: 10px 0; border-top: 1px solid var(--line); align-items: center; }
.line-row textarea { grid-column: 1 / -1; min-height: 60px; }
.line-total { font-weight: 600; text-align: right; }
.line-row [data-line-remove] { justify-self: end; }
.add-lines { margin-top: 12px; }
.add-lines select { flex: 1 1 220px; width: auto; }
.totals-box { width: 100%; border-collapse: collapse; margin-top: 8px; }
.totals-box td { padding: 6px 0; border-top: 1px solid var(--line); }
.totals-box td:last-child { text-align: right; font-weight: 600; }
.totals-box .grand td { font-size: 1.15rem; border-top: 2px solid var(--ink); }
.quote-lines { list-style: none; padding: 0; margin: 0; }
.quote-lines li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.quote-lines li:first-child { border-top: 0; }
.preset-grid { display: grid; grid-template-columns: 1fr; gap: 6px; }

@media (min-width: 720px) {
  .room-row { grid-template-columns: 1.1fr 1.4fr .7fr 1.1fr auto; }
  .line-head { display: grid; grid-template-columns: 3fr .7fr .9fr 1fr 1fr 40px; gap: 6px; font-size: .8rem; color: var(--muted); }
  .line-row { grid-template-columns: 3fr .7fr .9fr 1fr 1fr 40px; }
  .line-row textarea { grid-column: auto; min-height: 46px; }
  .photo-grid { grid-template-columns: repeat(4, 1fr); }
  .preset-grid { grid-template-columns: 3fr 1fr 1fr; }
}

/* Les listes déroulantes aux libellés longs ne doivent jamais élargir la page */
select { max-width: 100%; min-width: 0; text-overflow: ellipsis; }
.add-lines .inline-form > select { flex: 1 1 100%; width: 100%; }
@media (min-width: 720px) { .add-lines .inline-form > select { flex: 1 1 260px; width: auto; } }
.cols > *, .form-grid > *, .row-2 > * { min-width: 0; }
input[type=file] { max-width: 100%; }
.quote-lines b { white-space: nowrap; }

/* ---------- Ce qui attend ---------- */
.section-title { font-family: var(--font-display); font-size: 1.9rem; font-weight: 600; margin: 26px 0 2px; }
.money-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 12px 0 14px; }
.tile {
  display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--line); color: var(--ink); text-decoration: none; min-width: 0;
}
.tile b { font-family: var(--font-display); font-size: 2.3rem; line-height: 1.05; font-weight: 600; }
.tile-alert { border-left: 4px solid var(--brand); }
.tile-label { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.tile-sub { font-size: .82rem; color: var(--muted); }
.rev-figures { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0 12px; }
.rev-figures > div { display: flex; flex-direction: column; gap: 2px; background: var(--bg); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.rev-figures b { font-family: var(--font-display); font-size: 2rem; line-height: 1.05; font-weight: 600; }
.var { font-size: .8rem; color: var(--muted); }
.var-up { color: var(--ok); }
.var-down { color: var(--brand-dark); }
.legend { display: flex; gap: 16px; font-size: .82rem; color: var(--muted); margin-bottom: 4px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.key-now, .rev-chart .bar-now { background: #d7263d; fill: #d7263d; }
.key-prev, .rev-chart .bar-prev { background: #948a7e; fill: #948a7e; }
.rev-chart { width: 100%; height: auto; display: block; }
.rev-chart .grid { stroke: var(--line); stroke-width: 1; }
.rev-chart .axis { fill: var(--muted); font-family: inherit; }
.rev-chart .axis-current { fill: var(--ink); font-weight: 600; }
.rev-chart .hit { fill: transparent; }
.rev-chart .month:hover .hit { fill: rgba(50, 63, 75, .05); }
.table-compact { width: 100%; border-collapse: collapse; margin-top: 6px; }
.table-compact th, .table-compact td { text-align: right; padding: 3px 6px; border-bottom: 1px solid var(--line); }
.table-compact th:first-child, .table-compact td:first-child { text-align: left; }
.wait-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.card > h2 + .wait-row { border-top: 0; }
.wait-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; color: var(--ink); text-decoration: none; }
.wait-main strong { overflow-wrap: anywhere; }
.wait-amount { font-weight: 600; white-space: nowrap; font-size: .92rem; }
.wait-action { margin: 0; flex: 0 0 auto; }
.row-3 { display: grid; gap: 0 12px; grid-template-columns: 1fr; }
.row-3 > * { min-width: 0; }
.month-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 10px; }
.month-grid > * { min-width: 0; }
@media (max-width: 480px) { .wait-row { flex-wrap: wrap; } .wait-main { flex-basis: 100%; } .wait-amount { margin-right: auto; } }
@media (min-width: 720px) {
  .money-tiles { grid-template-columns: repeat(4, 1fr); }
  .row-3 { grid-template-columns: 1fr 1fr 1fr; }
  .month-grid { grid-template-columns: repeat(4, 1fr); }
}
.rev-chart .axis { font-size: 12px; }
.rev-chart { max-height: 300px; }
.rev-chart .lbl-short { display: none; }
@media (max-width: 560px) {
  .rev-chart .axis { font-size: 22px; }
  .rev-chart .lbl-long { display: none; }
  .rev-chart .lbl-short { display: inline; }
}

/* ---------- Réglementation ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.reg-search input { font-size: 1rem; padding: 12px 14px; }
.reg-row { display: flex; flex-direction: column; gap: 3px; padding: 12px 0; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.card > h2 + .reg-row { border-top: 0; }
.reg-row .badge { align-self: flex-start; }
.reg-row[hidden], [data-reg-group][hidden] { display: none !important; }
.reg-quote { font-size: 1.08rem; line-height: 1.5; margin: 0 0 12px; }
.reg-points { margin: 0; padding-left: 1.1em; }
.reg-points li { margin: 0 0 8px; line-height: 1.5; }
.reg-sources { margin: 0; padding-left: 1.1em; }
.reg-sources li { margin-bottom: 6px; overflow-wrap: anywhere; }
.table-scroll { overflow-x: auto; margin-top: 10px; }
.reg-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: .92rem; }
.reg-table th, .reg-table td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); }
.reg-table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; }
.chips-nav { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink); font: 500 .92rem var(--font); cursor: pointer; }
.chip-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.reg-link { display: inline-block; margin-top: 4px; }

/* ---------- Demande collée depuis un mail ---------- */
.paste-card { margin-bottom: 14px; }
.paste-card summary { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.paste-card summary::-webkit-details-marker { display: none; }
.paste-card summary::before { content: "+"; font-weight: 600; color: var(--brand); width: 14px; }
.paste-card[open] summary::before { content: "−"; }
.paste-card[open] summary { margin-bottom: 10px; }
.paste-card textarea { font-size: .9rem; }

/* Fiche contact : diagnostic, entretien, devis faits par l'admin */
.doc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -4px 0 14px; }
.doc-date { flex: 0 0 42px; display: flex; flex-direction: column; align-items: center; line-height: 1.1; font-size: .72rem; color: var(--muted); text-transform: uppercase; }
.doc-date b { font-family: var(--font-display); font-size: 1.5rem; color: var(--ink); }
@media (max-width: 480px) { .wait-row:has(.doc-date) { flex-wrap: nowrap; } .doc-date + .wait-main { flex: 1 1 auto; } }
.doc-buttons { display: flex; gap: 6px; align-items: center; flex: 0 0 auto; }
.doc-buttons form { margin: 0; }
.btn-icon { padding-left: 10px; padding-right: 10px; }
.delete-doc { margin: 18px 0 0; text-align: right; }

/* ---------- Revue UX (octobre 2026) ---------- */
/* Champs date : même hauteur que les autres, sans débordement sur iPhone */
input[type=date], input[type=time], input[type=datetime-local] { -webkit-appearance: none; appearance: none; display: block; min-width: 0; }
/* Navigation mobile : tous les onglets visibles sur deux lignes, plus de défilement caché */
@media (max-width: 1023px) {
  .tabs { position: static; flex-wrap: wrap; overflow: visible; gap: 4px 2px; padding: 6px 10px; }
  .tabs a { padding: 6px 8px; font-size: .85rem; }
  .tabs-logout { display: none; }
}
.app-footer { max-width: 1080px; margin: 0 auto; padding: 0 16px 32px; display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--muted); font-size: .85rem; }
.app-footer form { margin: 0; }
.app-footer button { background: none; border: 0; color: var(--brand-dark); font: 500 .85rem var(--font); text-decoration: underline; cursor: pointer; padding: 6px 0; }
@media (min-width: 1024px) { .app-footer { display: none; } }
/* Note de l'historique : le champ ne déborde plus de la carte */
.inline-form > input[type=text], .inline-form > input[type=email], .inline-form > input[type=search] { min-width: 0; }
/* Forfaits (Paramètres) : libellé sur toute la largeur, unité et prix côte à côte */
@media (max-width: 719px) {
  .preset-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
  .preset-grid > input[name^="preset_label"] { grid-column: 1 / -1; margin-top: 10px; }
}
/* Suppression dans la liste Documents : discrète, pour éviter les clics par erreur */
.doc-buttons .btn-danger { color: var(--muted); border-color: var(--line); }
.doc-buttons .btn-danger:hover { color: var(--brand-dark); border-color: var(--brand); }

/* ---------- Historique du client ---------- */
.history-summary { background: var(--bg); border-radius: 10px; padding: 8px 12px; margin: 10px 0; }
.history-filter { margin: 4px 0 6px; }
.history-filter .chip { padding: 5px 11px; font-size: .82rem; }
.timeline.history li[hidden] { display: none; }
.history-tag { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 999px; font-size: .72rem; font-weight: 600; background: var(--cream); color: var(--muted); }
.history-intervention { background: var(--info-soft); color: var(--info); }
.history-devis { background: var(--warn-soft); color: var(--warn); }
.history-argent { background: var(--ok-soft); color: var(--ok); }

/* Bouton Waze (bleu Waze, texte foncé pour rester lisible) */
.btn-waze { background: #33ccff; border-color: #33ccff; color: #0b2a3a; }
.btn-waze:hover { background: #1fb8ec; border-color: #1fb8ec; }
.auth-link { text-align: center; margin-top: 14px; }
.consent-box { background: var(--bg); border-radius: 10px; padding: 10px 12px; margin: 4px 0 12px; }
.consent-box p { margin: 0 0 8px; }
.consent-box .field { margin-bottom: 4px; }
.client-mail { padding: 10px 0; border-top: 1px solid var(--line); }
.card > p + .client-mail { border-top: 0; }
.client-mail p { margin: 0 0 4px; }
.mail-excerpt { white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.client-mail .button-row form { margin: 0; }
.seen-line { margin: 2px 0 10px; }

/* ---------- Audit mobile (octobre 2026) : cibles tactiles d'au moins 40 px, textes lisibles ---------- */
@media (max-width: 1023px) {
  .tabs a { min-height: 40px; display: inline-flex; align-items: center; }
  .history-filter .chip, .chips-nav .chip { min-height: 40px; }
  .btn-icon { min-width: 40px; min-height: 40px; }
  .app-footer button { padding: 11px 0; }
  details > summary { padding: 9px 0; }
}
input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--brand); flex: none; }
input[type=file] { font-size: 16px; }
.history-tag { font-size: .78rem; }

/* Petits téléphones (320 à 380 px) : en-tête sur une ligne, titres moins hauts, lignes de contact empilées */
@media (max-width: 380px) {
  .brand span { font-size: 1.3rem; white-space: nowrap; }
  .brand img { width: 28px; height: auto; }
  .topbar .btn-new { padding-left: 12px; padding-right: 12px; }
  .page-title { font-size: 1.8rem; }
}
@media (max-width: 420px) {
  .lead-row { flex-wrap: wrap; }
  .lead-row .lead-main { flex: 1 1 100%; }
  .lead-row .lead-side { flex: 1 1 100%; flex-direction: row; flex-wrap: wrap; justify-content: flex-start; align-items: center; gap: 4px 6px; text-align: left; }
}

/* Actions de terrain : icônes (appeler, Waze, plan, Street View, WhatsApp) */
.icon-actions .btn { gap: 6px; }
.icon-actions .ico { flex: none; }
.btn-icon-only { width: 48px; padding: 0; }

/* Mes contacts (partenaire) */
.partner-tabs { margin: 0 0 14px; }
.partner-tabs .chip { text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.partner-tabs .chip-on .muted { color: inherit; opacity: .75; }
