/* =========================================================
   ESPACE CLIENT IMMO ÉLITE — feuille de style
   Même charte que la page de vente : crème #FAF7F0 · noir #1A1714 · or #B08D3F
   Typo : Bricolage Grotesque (titres) · Manrope (texte)
   Mobile d'abord : le client ajoute ses logements depuis son téléphone, en visite.
   ========================================================= */

:root {
  --cream: #FAF7F0;
  --sand: #F4EFE3;
  --sand-2: #EDE6D6;
  --ink: #1A1714;
  --ink-2: #221E1A;
  --ink-3: #2C2621;
  --gold: #B08D3F;
  --gold-light: #C9A458;
  --gold-deep: #8A6E2E;
  --gold-text: #7A6128;
  --gold-soft: #F3E9D2;
  --line: #E5DFCF;
  --muted: #6B645A;
  --muted-dark: #B9B0A2;
  --white: #FFFFFF;
  --ok: #2F6B4F;
  --ok-bg: #E6F0E9;
  --warn: #8F5412;
  --warn-bg: #FBEEDA;
  --no: #A23B2E;
  --no-bg: #F8E5E1;

  --font-display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Manrope", "Helvetica Neue", Arial, sans-serif;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 10px 30px rgba(26, 23, 20, 0.05), 0 2px 6px rgba(26, 23, 20, 0.04);
  --shadow-lift: 0 24px 50px rgba(26, 23, 20, 0.14), 0 6px 14px rgba(26, 23, 20, 0.06);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --side: 264px;
  --tabs: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; overflow-x: clip; font-family: var(--font-body); font-size: 1rem; line-height: 1.55; color: var(--ink); background: var(--cream); -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
ul, ol, dl, dd { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p { margin: 0; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--gold); color: var(--ink); }
[hidden] { display: none !important; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; line-height: 1.12; text-wrap: balance; }
h1 { font-size: clamp(1.75rem, 1.4rem + 1.8vw, 2.5rem); letter-spacing: -0.03em; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1.05rem; letter-spacing: -0.01em; line-height: 1.25; }

.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); font-size: 0.92rem; }
.lead { color: var(--muted); font-size: 1.02rem; max-width: 62ch; margin-top: 0.5rem; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase; font-weight: 700; color: var(--gold-text); margin-bottom: 0.6rem; }
.eyebrow::before { content: ""; width: 24px; height: 1px; background: var(--gold); }
.eyebrow--light { color: var(--gold-light); }
.eyebrow--light::before { background: var(--gold-light); }
.link { color: var(--gold-text); font-weight: 700; font-size: 0.9rem; text-decoration: underline; text-decoration-color: rgba(176, 141, 63, 0.4); text-underline-offset: 3px; }
.link:hover { text-decoration-color: currentColor; }
.link--danger { color: var(--no); text-decoration-color: rgba(162, 59, 46, 0.35); }
.brand { font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; letter-spacing: -0.02em; color: var(--ink); }
.brand em { font-style: normal; color: var(--gold-deep); }
.brand--dark { color: var(--cream); }
.brand--dark em { color: var(--gold-light); }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 50px; padding: 0 22px; border-radius: 999px; font-weight: 700; font-size: 0.95rem; white-space: nowrap; background: var(--ink); color: var(--cream); transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), background-color 0.2s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.6; cursor: progress; transform: none; }
.btn--gold { background: var(--gold); color: var(--ink); box-shadow: 0 8px 20px rgba(176, 141, 63, 0.22); }
.btn--gold:hover { background: var(--gold-light); }
.btn--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn--ghost:hover { box-shadow: inset 0 0 0 1.5px var(--gold); }
.btn--danger { background: var(--no); color: var(--white); }
.btn--danger-text { color: var(--no); }
.btn--sm { min-height: 42px; padding: 0 16px; font-size: 0.86rem; }
.btn--sm .ic { width: 17px; height: 17px; }
.btn--block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: var(--muted); flex: none; transition: background-color 0.2s ease, color 0.2s ease; }
.icon-btn:hover { background: var(--sand); color: var(--ink); }
.icon-btn--sm { width: 32px; height: 32px; }
.icon-btn--sm .ic { width: 15px; height: 15px; }

.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.01em; background: var(--sand-2); color: var(--ink); white-space: nowrap; font-family: var(--font-body); }
.badge--gold { background: var(--gold-soft); color: var(--gold-text); }
.badge--wait { background: var(--white); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.badge--ok { background: var(--ok-bg); color: var(--ok); }
.badge--warn { background: var(--warn-bg); color: var(--warn); }
.badge--no { background: var(--no-bg); color: var(--no); }
.badge--dark { background: var(--ink); color: var(--cream); }
.count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--gold); color: var(--ink); font-size: 0.7rem; font-weight: 800; font-style: normal; }
.dot { display: inline-block; width: 9px; height: 9px; margin-left: 8px; border-radius: 50%; background: var(--gold); vertical-align: middle; }

.notice { padding: 12px 16px; border-radius: var(--radius-sm); background: var(--sand); font-size: 0.92rem; margin: 0 0 1rem; }
.notice--error { background: var(--no-bg); color: var(--no); }
.notice--ok { background: var(--ok-bg); color: var(--ok); }

/* ---------- Écran d'ouverture ---------- */
.boot { min-height: 100dvh; display: grid; place-content: center; gap: 10px; text-align: center; }
.boot-mark { font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; letter-spacing: -0.02em; }
.boot-mark em { font-style: normal; color: var(--gold-deep); }
.boot-text { color: var(--muted); font-size: 0.92rem; }

/* ---------- Connexion ---------- */
.login { min-height: 100dvh; display: grid; }
.login-panel { display: none; }
.login-main { display: grid; place-items: center; padding: 28px 20px 40px; }
.login-card { width: 100%; max-width: 420px; }
.login-card h1 { margin-bottom: 0.35rem; }
.login-card .lead { margin: 0 0 1.5rem; }
.login-brand-mobile { margin-bottom: 2.2rem; }
.login-form { display: grid; gap: 14px; margin-top: 1.25rem; }
.login-sent { font-size: 0.95rem; color: var(--muted); }
.login-sent strong { color: var(--ink); overflow-wrap: anywhere; }
.login-demo { padding: 10px 14px; border-radius: var(--radius-sm); background: var(--gold-soft); color: var(--gold-text); font-size: 0.9rem; }
.login-form .link { justify-self: center; margin-top: 4px; }
.login-foot { display: flex; gap: 10px; margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.82rem; }
.login-foot .ic { color: var(--gold-deep); margin-top: 1px; }
.input--code { font-size: 1.5rem; letter-spacing: 0.35em; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- Structure ---------- */
.shell { min-height: 100dvh; }
.side { display: none; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; height: 58px; padding: 0 8px 0 18px; background: rgba(250, 247, 240, 0.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-back { display: grid; place-items: center; width: 36px; height: 36px; margin-left: -8px; color: var(--muted); }
.top-tag { margin-left: auto; font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 700; color: var(--gold-text); }
.main { padding: 22px 18px calc(var(--tabs) + env(safe-area-inset-bottom) + 34px); }
.page { max-width: 1040px; margin: 0 auto; display: grid; gap: 18px; }
.page > * { min-width: 0; }

.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; height: calc(var(--tabs) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--ink); }
.tab { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--muted-dark); font-size: 0.66rem; font-weight: 600; }
.tab .ic { width: 22px; height: 22px; }
.tab.active { color: var(--gold-light); }
.tab .count { position: absolute; top: 8px; left: calc(50% + 6px); min-width: 17px; height: 17px; font-size: 0.62rem; }

/* ---------- En-tête de page ---------- */
.page-head { display: grid; gap: 12px; margin-bottom: 4px; }
.page-head-row { display: grid; gap: 14px; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.back { display: inline-flex; align-items: center; gap: 8px; width: fit-content; color: var(--muted); font-size: 0.88rem; font-weight: 600; }
.back:hover { color: var(--ink); }
.back .ic { width: 17px; height: 17px; }
.section-title { font-size: 0.74rem; font-family: var(--font-body); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-top: 10px; }
.quick { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 10px; }
.quick > :first-child { grid-column: 1 / -1; }
.quick > :last-child:nth-child(2) { grid-column: 1 / -1; }
.quick .btn--ghost { min-width: 0; padding: 8px 12px; white-space: normal; text-align: center; line-height: 1.15; }

/* ---------- Cartes ---------- */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); display: grid; gap: 14px; align-content: start; }
.card--flush { padding: 0; gap: 0; overflow: hidden; }
.card-pad { padding: 18px 20px 4px; }
p.card-pad { padding-bottom: 18px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.grid { display: grid; gap: 18px; }
.grid--top { align-items: start; }
.stack { display: grid; gap: 18px; }
.empty { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 22px 12px; }
.empty-ic { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--sand); color: var(--gold-deep); }
.empty-title { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }
.empty-text { color: var(--muted); font-size: 0.92rem; max-width: 46ch; }
.empty .btn { margin-top: 8px; }
.secure, .quota { display: flex; gap: 10px; align-items: flex-start; color: var(--muted); font-size: 0.86rem; }
.secure .ic, .quota .ic { color: var(--gold-deep); width: 18px; height: 18px; margin-top: 2px; }
.quota strong { color: var(--ink); }
.private { padding: 10px 14px; border-radius: var(--radius-sm); background: var(--sand); font-size: 0.88rem; color: var(--muted); }
.danger-zone { text-align: center; padding-top: 6px; }

/* ---------- Parcours ---------- */
.bar { height: 8px; border-radius: 999px; background: var(--sand-2); overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--gold-deep), var(--gold-light)); }
.bar--sm { height: 5px; }
.phases { display: grid; gap: 4px; }
.phase { display: grid; grid-template-columns: 38px 1fr; gap: 12px; padding: 12px; border-radius: var(--radius-sm); }
.phase-n { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; font-family: var(--font-display); font-weight: 700; font-size: 0.86rem; background: var(--sand); color: var(--muted); }
.phase-body { display: grid; gap: 2px; }
.phase-body strong { font-family: var(--font-display); font-size: 1.02rem; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.phase-body em { font-style: normal; font-size: 0.78rem; font-weight: 700; color: var(--gold-text); }
.phase-body > span { font-size: 0.88rem; color: var(--muted); }
.phase.is-todo strong { color: var(--muted); }
.phase.is-current { background: var(--cream); box-shadow: inset 0 0 0 1px var(--line); }
.phase.is-current .phase-n { background: var(--ink); color: var(--gold-light); }
.phase.is-done .phase-n { background: var(--gold-soft); color: var(--gold-deep); }
.phase.is-done .phase-body > span { display: none; }

/* ---------- Chiffres clés ---------- */
.stat { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); display: grid; gap: 6px; align-content: start; }
.stat-value { font-family: var(--font-display); font-weight: 700; font-size: 2.4rem; line-height: 1; letter-spacing: -0.03em; }
.stat-value span { font-size: 1.1rem; color: var(--muted); letter-spacing: 0; }
.stat-label { font-weight: 600; font-size: 0.92rem; }
.stat-sub { color: var(--muted); font-size: 0.84rem; }
.segments { display: flex; gap: 3px; margin: 4px 0 2px; }
.segments i { flex: 1; height: 6px; border-radius: 3px; background: var(--sand-2); }
.segments i.on { background: var(--gold); }
.segments--lg i { height: 10px; border-radius: 5px; }

.next { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: start; }
.next-date { display: grid; justify-items: center; align-content: center; width: 68px; height: 76px; border-radius: 14px; background: var(--ink); color: var(--cream); }
.next-date span { font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-light); font-weight: 700; }
.next-date strong { font-family: var(--font-display); font-size: 1.9rem; line-height: 1; }
.next-body { display: grid; gap: 3px; justify-items: start; }
.next-when { font-weight: 700; }
.next-when::first-letter { text-transform: uppercase; }
.next-title { font-family: var(--font-display); font-size: 1.05rem; }
.next-body .btn { margin-top: 10px; }

/* ---------- Actions à faire ---------- */
.todos { display: grid; }
.todo { display: flex; align-items: flex-start; gap: 6px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.todos .todo:last-child { border-bottom: 0; }
.todo-main { display: flex; gap: 12px; flex: 1; cursor: pointer; }
.todo input[type="checkbox"] { appearance: none; -webkit-appearance: none; flex: none; width: 22px; height: 22px; margin: 1px 0 0; border-radius: 7px; border: 1.5px solid var(--muted-dark); background: var(--white); cursor: pointer; display: grid; place-items: center; transition: background-color 0.15s ease, border-color 0.15s ease; }
.todo input[type="checkbox"]::after { content: ""; width: 10px; height: 6px; border-left: 2px solid var(--white); border-bottom: 2px solid var(--white); transform: rotate(-45deg) translateY(-1px); opacity: 0; }
.todo input[type="checkbox"]:checked { background: var(--gold-deep); border-color: var(--gold-deep); }
.todo input[type="checkbox"]:checked::after { opacity: 1; }
.todo input[type="checkbox"]:disabled { background: var(--sand); border-color: var(--line); cursor: default; }
.todo-text { display: grid; gap: 1px; font-size: 0.95rem; }
.todo-text em { font-style: normal; font-size: 0.8rem; color: var(--muted); }
.todo-text em.late { color: var(--no); font-weight: 700; }
.todo--done .todo-text { color: var(--muted); text-decoration: line-through; }
.todo-group { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700; color: var(--muted); margin-top: 4px; }
.todo-add { display: flex; flex-wrap: wrap; gap: 8px; }
.todo-add .input { flex: 1 1 160px; min-height: 42px; padding: 8px 12px; font-size: 0.9rem; }
.todo-add select.input, .todo-add input[type="date"] { flex: 0 1 150px; }
.todo-add .btn { padding: 0; width: 42px; }
.todo-done summary, .more summary { cursor: pointer; font-size: 0.88rem; font-weight: 700; color: var(--gold-text); padding: 4px 0; }
.todo-done[open] summary, .more[open] summary { margin-bottom: 8px; }

.cap-list { display: grid; gap: 12px; }
.cap-list dt { font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 700; color: var(--gold-text); }
.cap-list dd { font-size: 0.96rem; }

.feed li > a, .feed li > div, .inbox li > a { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.feed li:last-child > *, .inbox li:last-child > a { border-bottom: 0; }
.inbox li > a { padding: 12px 20px; }
.inbox li > a:hover, .feed li > a:hover { color: var(--gold-text); }
.feed-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--sand); color: var(--gold-deep); flex: none; }
.feed-ic .ic { width: 17px; height: 17px; }
.feed-text { display: grid; gap: 1px; flex: 1; min-width: 0; font-size: 0.93rem; }
.feed-text em { font-style: normal; font-size: 0.8rem; color: var(--muted); }
.feed-go { width: 16px; height: 16px; color: var(--muted-dark); }

/* ---------- Sessions ---------- */
.counter { gap: 16px; }
.counter-main { display: flex; align-items: center; gap: 16px; }
.counter-value { font-family: var(--font-display); font-weight: 700; font-size: 3.4rem; line-height: 0.9; letter-spacing: -0.04em; }
.counter-value span { font-size: 1.4rem; color: var(--muted); letter-spacing: 0; }
.counter-label { font-weight: 700; }
.counter-left { color: var(--gold-text); font-weight: 700; font-size: 0.92rem; }
.inclus { display: grid; gap: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.inclus li { display: flex; gap: 12px; }
.inclus .ic { color: var(--gold-deep); margin-top: 2px; }
.inclus span { display: grid; font-size: 0.88rem; color: var(--muted); }
.inclus strong { color: var(--ink); font-size: 0.95rem; }

.sessions { display: grid; gap: 12px; }
.session { display: grid; grid-template-columns: 38px 1fr; gap: 14px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.session-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--sand); color: var(--muted); }
.session--done .session-mark { background: var(--gold-soft); color: var(--gold-deep); }
.session-body { display: grid; gap: 12px; min-width: 0; }
.session-top { display: flex; justify-content: space-between; gap: 10px; }
.session-kicker { font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700; color: var(--gold-text); margin-bottom: 3px; }
.session-top .muted::first-letter { text-transform: uppercase; }
.session-resume { font-size: 0.95rem; padding: 12px 14px; background: var(--cream); border-radius: var(--radius-sm); }
.session-links { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Documents ---------- */
.segs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--sand); border-radius: 999px; }
.seg { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border-radius: 999px; font-weight: 700; font-size: 0.9rem; color: var(--muted); }
.seg.active { background: var(--white); color: var(--ink); box-shadow: var(--shadow); }
.seg-n { font-size: 0.78rem; color: var(--muted); font-weight: 600; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 7px 14px; border-radius: 999px; font-size: 0.84rem; font-weight: 600; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); background: var(--white); }
.chip.active { background: var(--ink); color: var(--cream); box-shadow: none; }

.docs { display: grid; }
.doc { display: flex; align-items: center; gap: 4px; padding: 6px 10px 6px 20px; border-bottom: 1px solid var(--line); }
.docs .doc:last-child { border-bottom: 0; }
.doc--new { background: linear-gradient(90deg, rgba(243, 233, 210, 0.55), transparent 70%); }
.doc-main { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; padding: 8px 0; }
.doc-main:hover .doc-name { color: var(--gold-text); }
.doc-kind { display: grid; place-items: center; width: 42px; height: 48px; border-radius: 8px; font-size: 0.62rem; font-weight: 800; letter-spacing: 0.06em; background: var(--sand); color: var(--muted); flex: none; }
.doc-kind--pdf { background: var(--no-bg); color: var(--no); }
.doc-kind--img { background: var(--gold-soft); color: var(--gold-text); }
.doc-kind--xls { background: var(--ok-bg); color: var(--ok); }
.doc-kind--doc { background: #E4ECF7; color: #2F4F86; }
.doc-text { display: grid; gap: 1px; min-width: 0; }
.doc-name { font-weight: 700; font-size: 0.95rem; overflow-wrap: anywhere; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.doc-meta { font-size: 0.8rem; color: var(--muted); }
.doc-note { font-size: 0.84rem; color: var(--muted); font-style: italic; }
.doc-actions { display: flex; flex: none; }
.docs--inline { border: 1px solid var(--line); border-radius: var(--radius-sm); }
.docs--inline .doc { padding-left: 12px; }

/* ---------- Formulaires ---------- */
.form { display: grid; gap: 16px; }
.form-row { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field-label { font-size: 0.84rem; font-weight: 700; }
.field-hint { font-size: 0.8rem; color: var(--muted); }
.input { width: 100%; min-height: 50px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--white); font: inherit; font-size: 1rem; color: var(--ink); transition: border-color 0.2s ease, box-shadow 0.2s ease; appearance: none; -webkit-appearance: none; }
.input::placeholder { color: var(--muted-dark); }
.input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(176, 141, 63, 0.16); }
textarea.input { resize: vertical; line-height: 1.5; }
select.input { padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B645A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 0.92rem; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--gold-deep); }
.form-submit { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.bien-form fieldset { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); display: grid; gap: 16px; }
.bien-form legend { float: left; width: 100%; padding: 0; font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; letter-spacing: -0.015em; }
.bien-form legend + * { clear: both; }
.fieldset-hint { font-size: 0.86rem; color: var(--muted); margin-top: -8px; }
.bien-form .form-submit { position: sticky; bottom: calc(var(--tabs) + env(safe-area-inset-bottom)); padding: 12px 0; background: linear-gradient(to top, var(--cream) 70%, transparent); z-index: 5; }
.bien-form .form-submit .btn { flex: 1; }

.picker { display: grid; gap: 8px; }
.picker-drop { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; align-items: center; padding: 14px 16px; border: 1.5px dashed var(--muted-dark); border-radius: var(--radius-sm); background: var(--cream); cursor: pointer; transition: border-color 0.2s ease, background-color 0.2s ease; }
.picker-drop:hover, .picker-drop:focus-within { border-color: var(--gold); background: var(--gold-soft); }
.file-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.picker-ic { grid-row: span 2; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--white); color: var(--gold-deep); }
.picker-label { font-weight: 700; font-size: 0.95rem; }
.picker-hint { font-size: 0.8rem; color: var(--muted); grid-column: 2; }
.picked { display: grid; gap: 4px; }
.picked li { display: flex; align-items: center; gap: 8px; font-size: 0.86rem; padding: 6px 10px; background: var(--sand); border-radius: 8px; }
.picked li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picked li em { font-style: normal; color: var(--muted); font-size: 0.78rem; }
.picked .ic { width: 16px; height: 16px; color: var(--muted); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.thumbs li { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--sand); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.thumb-x { position: absolute; top: 5px; right: 5px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: rgba(26, 23, 20, 0.78); color: var(--white); }
.thumb-x .ic { width: 14px; height: 14px; }

/* ---------- Fenêtres ---------- */
dialog { color: var(--ink); }
.dlg { width: 100%; max-width: 100%; max-height: 100dvh; height: 100dvh; margin: 0; padding: 0; border: 0; background: var(--cream); }
.dlg::backdrop, .lb::backdrop { background: rgba(26, 23, 20, 0.6); }
.dlg-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 12px 14px 20px; background: var(--cream); border-bottom: 1px solid var(--line); }
.dlg-head h2 { font-size: 1.2rem; }
.dlg-body { padding: 20px 20px calc(24px + env(safe-area-inset-bottom)); }
.dlg-text { font-size: 1rem; margin-bottom: 20px; }
.dlg-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding-top: 6px; }
.dlg-actions .btn--danger-text { margin-right: auto; }

.toasts { position: fixed; left: 50%; bottom: calc(var(--tabs) + env(safe-area-inset-bottom) + 14px); transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; width: min(92vw, 440px); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-radius: 14px; background: var(--ink); color: var(--cream); font-size: 0.92rem; font-weight: 600; box-shadow: var(--shadow-lift); animation: toast-in 0.35s var(--ease); }
.toast .ic { color: var(--gold-light); width: 18px; height: 18px; }
.toast--error { background: var(--no); }
.toast--error .ic { color: var(--white); }
.toast.out { opacity: 0; transform: translateY(8px); transition: opacity 0.3s ease, transform 0.3s ease; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Logements ---------- */
.biens { display: grid; gap: 16px; }
.biens > li, .clients > li, .contacts > li { min-width: 0; }
.bien { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease); height: 100%; }
.bien:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.bien-cover { position: relative; aspect-ratio: 16 / 9; background: var(--sand); }
.bien-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bien-nophoto { display: grid; place-items: center; width: 100%; height: 100%; color: var(--muted-dark); }
.bien-nophoto .ic { width: 40px; height: 40px; stroke-width: 1.3; }
.bien-badges { position: absolute; left: 12px; top: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.bien-badges .badge { box-shadow: 0 2px 8px rgba(26, 23, 20, 0.14); }
.bien-body { display: grid; gap: 8px; padding: 16px 18px 18px; align-content: start; }
.bien-figures { display: flex; flex-wrap: wrap; gap: 8px 22px; padding-top: 10px; border-top: 1px solid var(--line); }
.bien-figures span { display: grid; }
.bien-figures em { font-style: normal; font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.bien-figures strong { font-family: var(--font-display); font-size: 1.1rem; }
.bien-foot { font-size: 0.8rem; color: var(--muted); }

.facts { display: flex; flex-wrap: wrap; gap: 6px; }
.facts li { padding: 5px 12px; border-radius: 999px; background: var(--sand); font-size: 0.82rem; font-weight: 600; }

.verdict { border-left: 5px solid var(--muted-dark); }
.verdict--ok { border-left-color: var(--ok); background: linear-gradient(180deg, var(--ok-bg), var(--white) 120px); }
.verdict--warn { border-left-color: #C98A2B; background: linear-gradient(180deg, var(--warn-bg), var(--white) 120px); }
.verdict--no { border-left-color: var(--no); background: linear-gradient(180deg, var(--no-bg), var(--white) 120px); }
.verdict--wait { border-left-color: var(--gold); background: var(--cream); }
.verdict-head { display: grid; gap: 2px; }
.verdict-kicker { font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700; color: var(--muted); }
.verdict-avis { font-family: var(--font-display); font-weight: 700; font-size: 1.7rem; letter-spacing: -0.025em; line-height: 1.1; }
.verdict--ok .verdict-avis { color: var(--ok); }
.verdict--warn .verdict-avis { color: var(--warn); }
.verdict--no .verdict-avis { color: var(--no); }
.verdict-prix { font-size: 1rem; margin-top: 4px; }
.verdict-prix strong { font-family: var(--font-display); font-size: 1.2rem; }
.verdict-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.verdict .btn { justify-self: start; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.gallery li { aspect-ratio: 4 / 3; border-radius: var(--radius-sm); overflow: hidden; background: var(--sand); }
.gallery button { display: block; width: 100%; height: 100%; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease); }
.gallery button:hover img { transform: scale(1.04); }
.lb { width: 100vw; height: 100dvh; max-width: 100vw; max-height: 100dvh; margin: 0; padding: 0; border: 0; background: rgba(26, 23, 20, 0.94); }
.lb[open] { display: grid; place-items: center; }
.lb img { max-width: 100vw; max-height: 100dvh; object-fit: contain; }
.lb-btn { position: absolute; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: rgba(250, 247, 240, 0.14); color: var(--cream); }
.lb-btn:hover { background: rgba(250, 247, 240, 0.28); }
.lb-close { top: 14px; right: 14px; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); color: var(--cream); font-size: 0.85rem; font-weight: 600; }

.figures { display: grid; gap: 14px; }
.figures-top { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kpi { display: grid; gap: 2px; padding: 12px 10px; border-radius: var(--radius-sm); background: var(--cream); text-align: center; }
.kpi em { font-style: normal; font-size: 0.66rem; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 700; color: var(--muted); }
.kpi strong { font-family: var(--font-display); font-size: 1.25rem; letter-spacing: -0.02em; white-space: nowrap; }
.kpi--pos strong { color: var(--ok); }
.kpi--neg strong { color: var(--no); }
.fig { display: flex; justify-content: space-between; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.fig span { color: var(--muted); }
.fig strong { white-space: nowrap; font-variant-numeric: tabular-nums; }
.fig--total { font-size: 1rem; }
.fig--total span { color: var(--ink); font-weight: 700; }
.figures-list .fig:last-child { border-bottom: 0; }
.figures-note { font-size: 0.8rem; color: var(--muted); }
.form-live { padding: 16px; border-radius: var(--radius-sm); background: var(--white); border: 1px solid var(--line); }

.note { display: grid; gap: 4px; }
.note + .note { padding-top: 12px; border-top: 1px solid var(--line); }
.note-k { font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 700; color: var(--gold-text); }
.note-k--plus { color: var(--ok); }
.note-k--moins { color: var(--no); }
.note .pre { font-size: 0.95rem; }

.thread { display: grid; gap: 10px; }
.msg { max-width: 88%; padding: 10px 14px; border-radius: 16px 16px 16px 4px; background: var(--sand); justify-self: start; }
.msg--me { justify-self: end; background: var(--ink); color: var(--cream); border-radius: 16px 16px 4px 16px; }
.msg-who { font-size: 0.74rem; font-weight: 700; color: var(--muted); margin-bottom: 2px; }
.msg--me .msg-who { color: var(--gold-light); }
.msg .pre { font-size: 0.94rem; }
.msg-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
.msg-form .input { min-height: 46px; }

.avis-choice { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.avis { position: relative; }
.avis input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.avis span { display: grid; place-items: center; min-height: 52px; padding: 6px; border-radius: var(--radius-sm); font-weight: 700; font-size: 0.9rem; text-align: center; box-shadow: inset 0 0 0 1.5px var(--line); background: var(--white); transition: box-shadow 0.2s ease, background-color 0.2s ease; }
.avis input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
.avis--ok input:checked + span { background: var(--ok-bg); color: var(--ok); box-shadow: inset 0 0 0 2px var(--ok); }
.avis--warn input:checked + span { background: var(--warn-bg); color: var(--warn); box-shadow: inset 0 0 0 2px #C98A2B; }
.avis--no input:checked + span { background: var(--no-bg); color: var(--no); box-shadow: inset 0 0 0 2px var(--no); }

/* ---------- Carnet ---------- */
.contacts, .clients { display: grid; gap: 14px; }
.contact { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-content: start; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.contact-top { display: flex; justify-content: space-between; gap: 10px; }
.contact-zone { display: flex; align-items: center; gap: 6px; font-size: 0.84rem; color: var(--muted); margin-top: 4px; }
.contact-zone .ic { width: 15px; height: 15px; }
.contact-note { font-size: 0.9rem; color: var(--muted); }
.contact-links { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Vue de Mattéo ---------- */
.client { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease); }
.client:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.client--off { opacity: 0.6; }
.client-top { display: flex; align-items: center; gap: 12px; }
.client-top > div { flex: 1; min-width: 0; }
.avatar { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--ink); color: var(--gold-light); font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; flex: none; }
.client-figs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.client-figs dt { font-size: 0.64rem; letter-spacing: 0.04em; text-transform: uppercase; font-weight: 700; color: var(--muted); }
.client-figs dd { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }
.diag-list { display: grid; gap: 10px; }
.diag-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 0.92rem; }
.diag-list span { display: grid; }
.diag-list em { font-style: normal; font-size: 0.82rem; color: var(--muted); overflow-wrap: anywhere; }
.diag-list .ok .ic { color: var(--ok); }
.diag-list .ko .ic { color: var(--no); }
.more { border-top: 1px solid var(--line); padding-top: 12px; }
.more > *:not(summary) { margin-top: 14px; }

/* ---------- Téléphone : chiffres clés compacts ---------- */
@media (max-width: 619px) {
  .grid--3 { gap: 10px; }
  .stat { grid-template-columns: auto 1fr; column-gap: 16px; row-gap: 2px; align-items: center; padding: 14px 18px; }
  .stat-value { grid-row: span 2; min-width: 92px; font-size: 2.1rem; }
  .stat .segments { grid-column: 1 / -1; grid-row: 3; margin-top: 8px; }
  .stat-sub { grid-column: 2; }
}

/* ---------- À partir de 620 px ---------- */
@media (min-width: 620px) {
  .main { padding-left: 28px; padding-right: 28px; }
  .form-row { grid-template-columns: 1fr 1fr; }
  .form-row--3 { grid-template-columns: repeat(3, 1fr); }
  .quick { display: flex; flex-wrap: wrap; }
  .quick .btn--ghost { padding: 0 22px; white-space: nowrap; }
  .page-head-row { grid-template-columns: 1fr auto; align-items: end; }
  .page-actions { justify-content: flex-end; }
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .biens, .contacts, .clients { grid-template-columns: repeat(2, 1fr); }
  .phases { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .phase { grid-template-columns: 1fr; align-content: start; }
  .phase.is-done .phase-body > span { display: block; }
  .inclus { grid-template-columns: 1fr 1fr; gap: 14px 24px; }
  .dlg { width: min(560px, calc(100vw - 40px)); height: auto; max-height: calc(100dvh - 48px); margin: auto; border-radius: 22px; box-shadow: var(--shadow-lift); }
  .dlg--wide { width: min(680px, calc(100vw - 40px)); }
  .dlg-head { padding: 18px 16px 16px 26px; border-radius: 22px 22px 0 0; }
  .dlg-body { padding: 24px 26px 26px; }
  .bien-form .form-submit .btn { flex: none; }
  .gallery { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .kpi strong { font-size: 1.45rem; }
  .kpi em { font-size: 0.7rem; }
}

/* ---------- Grand écran : menu latéral ---------- */
@media (min-width: 1000px) {
  .top, .tabs { display: none; }
  .side { position: fixed; inset: 0 auto 0 0; width: var(--side); display: flex; flex-direction: column; gap: 6px; padding: 28px 18px 22px; background: var(--ink); color: var(--cream); overflow-y: auto; }
  .side .brand { padding: 0 12px; font-size: 1.45rem; }
  .side-tag { padding: 0 12px; margin-bottom: 22px; font-size: 0.66rem; letter-spacing: 0.18em; text-transform: uppercase; font-weight: 700; color: var(--gold-light); }
  .side-back { display: flex; align-items: center; gap: 8px; padding: 8px 12px; font-size: 0.86rem; font-weight: 600; color: var(--muted-dark); border-radius: 10px; }
  .side-back:hover { color: var(--cream); }
  .side-back .ic { width: 16px; height: 16px; }
  .side-client { padding: 4px 12px 14px; font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; border-bottom: 1px solid rgba(201, 164, 88, 0.22); margin-bottom: 10px; }
  .side-nav { display: grid; gap: 2px; }
  .side-link { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; font-weight: 600; font-size: 0.95rem; color: var(--muted-dark); transition: background-color 0.2s ease, color 0.2s ease; }
  .side-link:hover { color: var(--cream); background: rgba(250, 247, 240, 0.05); }
  .side-link.active { color: var(--ink); background: var(--gold-light); }
  .side-link .count { margin-left: auto; }
  .side-link.active .count { background: var(--ink); color: var(--gold-light); }
  .side-foot { margin-top: auto; display: grid; gap: 10px; padding: 16px 12px 0; border-top: 1px solid rgba(201, 164, 88, 0.22); }
  .side-who { display: grid; font-size: 0.8rem; color: var(--muted-dark); }
  .side-who strong { color: var(--cream); font-size: 0.92rem; }
  .side-who span { overflow: hidden; text-overflow: ellipsis; }
  .side-logout { display: flex; align-items: center; gap: 8px; font-size: 0.86rem; font-weight: 600; color: var(--muted-dark); }
  .side-logout:hover { color: var(--cream); }
  .side-logout .ic { width: 17px; height: 17px; }
  .main { margin-left: var(--side); padding: 44px 44px 64px; }
  .page { gap: 22px; }
  .grid--2 { grid-template-columns: 1fr 1fr; }
  .biens, .clients { grid-template-columns: repeat(3, 1fr); }
  .toasts { bottom: 28px; left: calc(50% + var(--side) / 2); }
  .bien-form .form-submit { bottom: 0; }
  .card { padding: 24px; }
  .card--flush { padding: 0; }
  .card-pad { padding: 22px 24px 6px; }
  p.card-pad { padding-bottom: 22px; }
  .doc { padding-left: 24px; padding-right: 14px; }
  .inbox li > a { padding: 12px 24px; }

  .login { grid-template-columns: minmax(380px, 0.9fr) 1.1fr; }
  .login-panel { display: flex; flex-direction: column; justify-content: space-between; padding: 44px 48px; background: var(--ink); color: var(--cream); }
  .login-panel-body { display: grid; gap: 18px; max-width: 420px; }
  .login-quote { font-family: var(--font-display); font-weight: 700; font-size: 2.3rem; line-height: 1.08; letter-spacing: -0.03em; }
  .login-points { display: grid; gap: 18px; margin-top: 14px; }
  .login-points li { display: flex; gap: 14px; }
  .login-points .ic { color: var(--gold-light); margin-top: 3px; }
  .login-points span { display: grid; gap: 2px; color: var(--muted-dark); font-size: 0.92rem; }
  .login-points strong { color: var(--cream); font-size: 1rem; }
  .login-panel-foot { font-size: 0.82rem; color: var(--muted-dark); }
  .login-brand-mobile { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
