:root {
  --bg: #f6f4ed; --fg: #20362e; --primary: #265f4b; --primary-fg: #f6f4ed; --accent: #d8794d; --secondary: #f0e0c4;
  --muted: #e9e5da; --muted-fg: #6a7a73; --card: #fdfcf8; --border: #ddd6c6; --danger: #b8312f; --radius: 14px;
  --shadow: 0 1px 2px rgba(32, 54, 46, 0.06), 0 4px 16px rgba(32, 54, 46, 0.05);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--fg); line-height: 1.5; }
h1, h2, h3 { font-family: "Manrope", "DM Sans", system-ui, sans-serif; line-height: 1.2; margin: 0 0 0.6rem; }
h1 { font-size: clamp(1.5rem, 4vw, 2.1rem); } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
a { color: var(--primary); text-decoration: none; } a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
.container { width: min(1120px, 100% - 2rem); margin-inline: auto; }
.container.narrow { width: min(680px, 100% - 2rem); }
.page { padding: 1.5rem 0 3rem; }
.main { min-height: 60vh; }
.muted { color: var(--muted-fg); } .small { font-size: 0.85rem; } .center { text-align: center; } .right { text-align: right; }
.prewrap { white-space: pre-wrap; overflow-wrap: anywhere; } .nowrap { white-space: nowrap; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0; }
.stack { display: grid; gap: 0.9rem; } .two { display: grid; gap: 0.9rem; grid-template-columns: repeat(2, 1fr); }
.row-between { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.pad { padding: 1.1rem; } .soft { background: var(--muted); box-shadow: none; }
.spacer { flex: 1; }

/* Boutons et champs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; border: 1px solid var(--border); background: var(--card); color: var(--fg); padding: 0.6rem 1rem; border-radius: 999px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; transition: transform 0.05s, background 0.15s; }
.btn:hover { background: var(--muted); text-decoration: none; } .btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); color: var(--primary-fg); border-color: var(--primary); } .btn.primary:hover { background: #1d4d3c; }
.btn.whatsapp { background: #1f9d55; border-color: #1f9d55; color: #fff; } .btn.danger { color: var(--danger); border-color: #e9c3c2; }
.btn.small { padding: 0.35rem 0.8rem; font-size: 0.88rem; } .btn.ghost { background: transparent; border-color: transparent; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: 2px; }
.link { background: none; border: 0; padding: 0; color: var(--primary); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; }
input, select, textarea { width: 100%; font: inherit; color: inherit; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 0.6rem 0.75rem; }
input[type="checkbox"] { width: auto; } textarea { resize: vertical; } .narrow-input { width: 5rem; }
.field { display: grid; gap: 0.3rem; } .field-label { font-weight: 600; font-size: 0.92rem; } .field-hint { color: var(--muted-fg); font-size: 0.82rem; }
.check { display: flex; gap: 0.5rem; align-items: flex-start; }
.alert { border-radius: 10px; padding: 0.7rem 0.9rem; display: flex; gap: 0.8rem; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--secondary); }
.alert.error { background: #f9e3e2; color: #7e1f1d; } .alert.success { background: #dcefe4; color: #1c5a3a; } .alert.info { background: #e7eef0; }

/* Cartes et grilles */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.listing-card, .shop-card { color: inherit; overflow: hidden; display: flex; flex-direction: column; } .listing-card:hover, .shop-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(32, 54, 46, 0.12); }
.thumb { aspect-ratio: 4 / 3; background: var(--muted); position: relative; display: grid; place-items: center; overflow: hidden; } .thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-empty { color: var(--muted-fg); font-size: 0.85rem; }
.card-body { padding: 0.8rem; display: grid; gap: 0.2rem; } .card-title { overflow-wrap: anywhere; }
.price { font-weight: 700; color: var(--primary); } .price.big { font-size: 1.5rem; margin: 0.3rem 0; }
.badge { display: inline-block; background: var(--secondary); color: var(--fg); border-radius: 999px; padding: 0.1rem 0.6rem; font-size: 0.78rem; font-weight: 600; width: fit-content; } .badge.sold { position: absolute; top: 8px; left: 8px; background: var(--accent); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; } .chip { background: var(--card); border: 1px solid var(--border); border-radius: 999px; padding: 0.4rem 0.9rem; color: var(--fg); font-weight: 500; } .chip:hover { background: var(--secondary); text-decoration: none; }
.section-title { margin: 2rem 0 0.8rem; }
.cta-row { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-top: 2.2rem; }
.cta-card { display: grid; gap: 0.2rem; padding: 1.2rem; border-radius: var(--radius); background: var(--primary); color: var(--primary-fg); } .cta-card span { opacity: 0.85; } .cta-card:hover { text-decoration: none; background: #1d4d3c; }
.empty { text-align: center; padding: 2.5rem 1rem; display: grid; gap: 0.5rem; justify-items: center; background: var(--card); border: 1px dashed var(--border); border-radius: var(--radius); }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--primary); animation: spin 0.8s linear infinite; margin: 2rem auto; } @keyframes spin { to { transform: rotate(360deg); } }
.pager { display: flex; gap: 1rem; align-items: center; justify-content: center; margin: 1.5rem 0; }

/* En-tête, pied de page */
.header { position: sticky; top: 0; z-index: 20; background: rgba(246, 244, 237, 0.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.header-in { display: flex; align-items: center; gap: 1rem; min-height: 60px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 0.5rem; font-family: "Manrope", sans-serif; font-weight: 800; font-size: 1.2rem; color: var(--primary); } .logo:hover { text-decoration: none; }
.nav { display: flex; align-items: center; gap: 0.9rem; flex: 1; flex-wrap: wrap; } .nav a:not(.btn) { color: var(--fg); font-weight: 500; } .nav a.on { color: var(--primary); font-weight: 700; }
.burger { display: none; margin-left: auto; } .msg-link { position: relative; } .dot { background: var(--accent); color: #fff; border-radius: 999px; font-size: 0.7rem; padding: 0.05rem 0.4rem; margin-left: 0.3rem; }
.footer { border-top: 1px solid var(--border); margin-top: 3rem; padding: 1.5rem 0 2.5rem; background: var(--muted); } .footer-in { display: grid; gap: 0.3rem; margin-top: 1rem; }
.ad-banner { position: relative; display: grid; place-items: center; width: 100%; min-height: 80px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); cursor: pointer; overflow: hidden; padding: 0; font: inherit; color: inherit; } .ad-banner img { width: 100%; max-height: 160px; object-fit: cover; }
.ad-tag { position: absolute; top: 6px; right: 8px; font-size: 0.68rem; background: rgba(255, 255, 255, 0.85); border-radius: 6px; padding: 0 0.4rem; }

/* Accueil */
.hero { background: linear-gradient(135deg, #265f4b, #1b4636); color: var(--primary-fg); padding: 3rem 0 3.2rem; } .hero-inner { display: grid; gap: 0.9rem; } .hero h1 { font-size: clamp(1.9rem, 6vw, 3rem); margin: 0; } .hero em { font-family: Georgia, serif; font-weight: 400; color: #f0a77f; } .hero p { margin: 0; opacity: 0.9; max-width: 36rem; }
.search-bar { display: flex; gap: 0.5rem; max-width: 640px; } .search-bar input { flex: 1; border-radius: 999px; padding-inline: 1.1rem; }
.filters { display: grid; gap: 0.6rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); padding: 0.9rem; margin-bottom: 1rem; align-items: center; }

/* Fiche annonce */
.listing-page { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; }
.gallery-main { aspect-ratio: 4 / 3; background: var(--muted); border-radius: var(--radius); overflow: hidden; display: grid; place-items: center; } .gallery-main img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.gallery-thumbs { display: flex; gap: 0.5rem; margin-top: 0.6rem; flex-wrap: wrap; } .gallery-thumbs button { border: 2px solid transparent; border-radius: 8px; padding: 0; width: 64px; height: 64px; overflow: hidden; cursor: pointer; background: none; } .gallery-thumbs button.on { border-color: var(--primary); } .gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.detail { display: grid; gap: 0.6rem; } .actions, .contact-buttons { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }
.shop-mini { padding: 0.8rem 1rem; display: grid; color: inherit; } .shop-head { padding: 1.2rem; display: grid; gap: 0.5rem; margin-bottom: 1rem; }
.job-row { display: flex; justify-content: space-between; gap: 1rem; color: inherit; } .job-row:hover { text-decoration: none; background: #fff; }

/* Espace vendeur et administration */
.shell { display: grid; gap: 1.2rem; grid-template-columns: 210px minmax(0, 1fr); align-items: start; }
.side { padding: 0.5rem; display: grid; gap: 0.1rem; position: sticky; top: 76px; } .side a { padding: 0.55rem 0.8rem; border-radius: 10px; color: var(--fg); } .side a:hover { background: var(--muted); text-decoration: none; } .side a.on { background: var(--primary); color: var(--primary-fg); }
.stats { display: grid; gap: 0.8rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 1rem; } .stats .card { display: grid; gap: 0.2rem; } .stats strong { font-size: 1.8rem; font-family: "Manrope", sans-serif; color: var(--primary); }
.tabs { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 1.2rem; border-bottom: 1px solid var(--border); padding-bottom: 0.6rem; } .tabs button, .tab-link { border: 0; background: none; padding: 0.45rem 0.9rem; border-radius: 999px; font: inherit; font-weight: 600; cursor: pointer; color: var(--fg); } .tabs button.on { background: var(--primary); color: var(--primary-fg); } .tabs button:hover:not(.on), .tab-link:hover { background: var(--muted); text-decoration: none; }
.table-wrap { overflow-x: auto; margin-bottom: 1rem; } table { width: 100%; border-collapse: collapse; font-size: 0.93rem; } th, td { text-align: left; padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--border); vertical-align: top; } th { background: var(--muted); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.03em; }
.chart { width: 100%; height: 160px; } .chart rect { fill: var(--primary); } .chart rect:hover { fill: var(--accent); }
.photo-row { display: flex; flex-wrap: wrap; gap: 0.6rem; } .photo { width: 88px; height: 88px; border-radius: 10px; overflow: hidden; position: relative; border: 1px solid var(--border); background: var(--muted); } .photo img { width: 100%; height: 100%; object-fit: cover; } .photo.add { display: grid; place-items: center; font-size: 1.8rem; color: var(--muted-fg); cursor: pointer; border-style: dashed; } .photo-x { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, 0.6); color: #fff; cursor: pointer; line-height: 1; }
.modal-back { position: fixed; inset: 0; background: rgba(20, 30, 26, 0.5); display: grid; place-items: center; padding: 1rem; z-index: 50; } .modal { background: var(--card); border-radius: var(--radius); width: min(620px, 100%); max-height: 90vh; overflow: auto; padding: 1.2rem; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3); } .modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.6rem; }

/* Messagerie */
.messages-layout { display: grid; gap: 1rem; grid-template-columns: 320px minmax(0, 1fr); align-items: start; } .conv-list { max-height: 70vh; overflow: auto; } .conv-item { display: grid; gap: 0.1rem; padding: 0.75rem 0.9rem; border-bottom: 1px solid var(--border); color: inherit; } .conv-item:hover { background: var(--muted); text-decoration: none; } .conv-item.on { background: var(--secondary); }
.thread { display: grid; grid-template-rows: minmax(300px, 60vh) auto; } .msgs { overflow: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.5rem; } .bubble { max-width: 78%; background: var(--muted); padding: 0.55rem 0.8rem; border-radius: 14px 14px 14px 4px; display: grid; gap: 0.15rem; align-self: flex-start; } .bubble.mine { align-self: flex-end; background: var(--primary); color: var(--primary-fg); border-radius: 14px 14px 4px 14px; } .bubble time { font-size: 0.7rem; opacity: 0.7; }
.composer { display: flex; gap: 0.5rem; padding: 0.7rem; border-top: 1px solid var(--border); }

@media (max-width: 520px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.7rem; } .card-body { padding: 0.6rem; } }
@media (max-width: 860px) {
  .listing-page, .shell, .messages-layout { grid-template-columns: 1fr; } .side { position: static; grid-auto-flow: column; overflow-x: auto; } .side a { white-space: nowrap; }
  .burger { display: inline-flex; } .nav { display: none; width: 100%; flex-direction: column; align-items: stretch; gap: 0.4rem; padding-bottom: 0.8rem; } .nav.open { display: flex; } .spacer { display: none; }
  .two { grid-template-columns: 1fr; } .thread { grid-template-rows: minmax(260px, 55vh) auto; }
}
