/* Espace client — style « premium » : encre profonde, accent or, beaucoup d'air. */
:root {
  --fond: #f6f5f1; --surface: #ffffff; --surface-2: #fbfaf7; --texte: #14171f; --doux: #6b6f7b;
  --bord: #e6e2d8; --bord-fort: #d6d0c2;
  --encre: #121826; --encre-2: #1e2638; --or: #b8924a; --or-clair: #e9d9b4; --or-fond: #f7f0e1;
  --primaire: #121826; --primaire-texte: #f6f1e6;
  --ok: #2f7d55; --ok-fond: #e7f3ec; --new: #9a6a1c; --new-fond: #f8eedb; --arch: #6b6f7b; --arch-fond: #efeee9;
  --erreur: #b3261e;
  --ombre: 0 1px 2px rgba(18, 24, 38, .04), 0 8px 24px -12px rgba(18, 24, 38, .12);
  --ombre-haute: 0 2px 4px rgba(18, 24, 38, .05), 0 18px 40px -16px rgba(18, 24, 38, .22);
  --r: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #0d1017; --surface: #151a24; --surface-2: #11151e; --texte: #ece8de; --doux: #9a9fab;
    --bord: #252c3a; --bord-fort: #323a4b;
    --encre: #ece8de; --encre-2: #d8d2c4; --or: #d4b26e; --or-clair: #5c4a26; --or-fond: #2a2416;
    --primaire: #d4b26e; --primaire-texte: #14171f;
    --ok: #6fca97; --ok-fond: #15291f; --new: #e0b46a; --new-fond: #2c2414; --arch: #9a9fab; --arch-fond: #1f2430;
    --erreur: #ff8a80;
    --ombre: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 10px 30px -14px rgba(0, 0, 0, .6);
    --ombre-haute: 0 20px 44px -18px rgba(0, 0, 0, .75);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fond); color: var(--texte);
  font: 15px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; }
a { color: inherit; text-decoration-color: var(--or); text-underline-offset: 3px; overflow-wrap: anywhere; }
a:hover { color: var(--or); }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
[hidden] { display: none !important; }

/* ─── marque ─── */
.marque { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none;
  background: linear-gradient(145deg, var(--encre-2), var(--encre)); color: var(--or); font-size: 17px;
  box-shadow: inset 0 0 0 1px rgba(212, 178, 110, .35); }
@media (prefers-color-scheme: dark) { .logo { background: linear-gradient(145deg, #222a3b, #161b26); } }
.marque h1 { font-size: 18px; font-weight: 600; }
.sous { margin: 0; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--or); font-weight: 600; }

/* ─── boutons, champs ─── */
.btn { font: inherit; font-weight: 550; border: 1px solid var(--bord-fort); background: var(--surface); color: var(--texte);
  border-radius: 11px; padding: 9px 16px; cursor: pointer; min-height: 42px;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s; }
.btn:hover { border-color: var(--or); }
.btn:active { transform: translateY(1px); }
.btn.primaire { background: var(--primaire); color: var(--primaire-texte); border-color: var(--primaire);
  box-shadow: 0 6px 16px -8px rgba(18, 24, 38, .55); }
.btn.primaire:hover { background: var(--encre-2); border-color: var(--or); }
@media (prefers-color-scheme: dark) { .btn.primaire:hover { background: #e0c285; } }
.btn.discret { background: transparent; }
.btn.lien { border: 0; background: none; color: var(--doux); padding: 8px 0; font-weight: 500; text-decoration: underline;
  text-decoration-color: var(--bord-fort); min-height: 0; }
.btn.lien:hover { color: var(--or); }
.btn.large { width: 100%; min-height: 50px; font-size: 15.5px; }
.btn:disabled { opacity: .55; cursor: wait; }
input, select, textarea { font: inherit; color: var(--texte); background: var(--surface);
  border: 1px solid var(--bord-fort); border-radius: 11px; padding: 10px 13px; min-height: 44px; width: 100%;
  transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--or); box-shadow: 0 0 0 4px var(--or-fond); }
textarea { resize: vertical; min-height: 0; background: var(--surface-2); }
select { -webkit-appearance: none; appearance: none; padding-right: 38px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23b8924a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 14px center; }
input[type="date"] { -webkit-appearance: none; appearance: none; display: block; min-width: 0; max-width: 100%; }
input[type="date"]::-webkit-date-and-time-value { text-align: left; }
input[type="date"]::-webkit-calendar-picker-indicator { opacity: .55; cursor: pointer; }
@media (prefers-color-scheme: dark) { input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(1); } }
.filtres-plus > label, .filtres-plus > * { min-width: 0; }
:focus-visible { outline: 2px solid var(--or); outline-offset: 2px; }
label { display: grid; gap: 6px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--doux); }

/* ─── connexion ─── */
body.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px;
  background:
    radial-gradient(1100px 600px at 10% -10%, rgba(184, 146, 74, .16), transparent 60%),
    radial-gradient(900px 600px at 110% 110%, rgba(18, 24, 38, .10), transparent 60%),
    var(--fond); }
.auth-carte { width: 100%; max-width: 420px; background: var(--surface); border-radius: 22px;
  padding: 34px 30px 26px; box-shadow: var(--ombre-haute); border: 1px solid var(--bord); position: relative; overflow: hidden; }
.auth-carte::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--or), transparent); }
.auth-carte .marque { margin-bottom: 22px; }
.auth-carte .marque h1 { font-size: 21px; }
.auth-carte form { display: grid; gap: 16px; }
.aide { color: var(--doux); margin: 0 0 2px; }
.code { font-size: 28px; letter-spacing: 10px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; }
.msg { color: var(--erreur); min-height: 1.4em; margin: 14px 0 0; font-size: 14px; }
.msg.ok { color: var(--doux); }
.pied { margin: 18px 0 0; padding-top: 16px; border-top: 1px solid var(--bord); font-size: 12px; color: var(--doux); text-align: center; }

/* ─── barre ─── */
.barre { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--surface) 86%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(14px); backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--bord); }
.barre-in { max-width: 1320px; margin: auto; padding: 12px 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.moi { display: flex; align-items: center; gap: 12px; color: var(--doux); font-size: 13px; min-width: 0; }
.moi span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page { max-width: 1320px; margin: auto; padding: 22px 24px 110px; }

/* ─── résumé ─── */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.stat { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--r); padding: 16px 18px;
  box-shadow: var(--ombre); display: grid; gap: 4px; position: relative; overflow: hidden; }
.stat:first-child { background: linear-gradient(150deg, var(--encre-2), var(--encre)); border-color: transparent; }
.stat:first-child .stat-k { color: var(--or-clair); }
.stat:first-child .stat-v { color: #f6f1e6; }
@media (prefers-color-scheme: dark) {
  .stat:first-child { background: linear-gradient(150deg, #2a2416, #1b1810); border-color: var(--or-clair); }
  .stat:first-child .stat-k { color: var(--or); } .stat:first-child .stat-v { color: var(--texte); }
}
.stat-k { font-size: 11.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--doux); }
.stat-v { font-size: 30px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }

/* ─── onglets et puces ─── */
.onglets, .rapides { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.onglets::-webkit-scrollbar, .rapides::-webkit-scrollbar { display: none; }
.onglets { border-bottom: 1px solid var(--bord); gap: 4px; margin-bottom: 14px; padding-bottom: 0; }
.onglets button { font: inherit; font-weight: 550; border: 0; background: none; color: var(--doux); padding: 10px 14px 12px;
  white-space: nowrap; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s, border-color .15s; }
.onglets button:hover { color: var(--texte); }
.onglets button[aria-selected="true"] { color: var(--texte); border-bottom-color: var(--or); }
.nb { display: inline-block; min-width: 22px; padding: 0 7px; margin-left: 4px; border-radius: 999px; font-size: 12px;
  line-height: 20px; text-align: center; background: var(--arch-fond); color: var(--doux); font-weight: 600; font-variant-numeric: tabular-nums; }
.onglets button[aria-selected="true"] .nb { background: var(--or-fond); color: var(--new); }
.rapides button { font: inherit; font-size: 14px; font-weight: 550; border: 1px solid var(--bord-fort); background: var(--surface);
  color: var(--texte); border-radius: 999px; padding: 7px 14px; white-space: nowrap; cursor: pointer; min-height: 38px;
  transition: background .15s, border-color .15s, color .15s; }
.rapides button:hover { border-color: var(--or); }
.rapides button[aria-pressed="true"] { background: var(--primaire); color: var(--primaire-texte); border-color: var(--primaire); }
.rapides button[aria-pressed="true"] .nb { background: rgba(233, 217, 180, .2); color: inherit; }

/* ─── filtres ─── */
.filtres { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 10px; }
.filtres #q { flex: 1 1 260px; padding-left: 40px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='8' cy='8' r='6'/%3E%3Cpath d='m13 13 4 4'/%3E%3C/svg%3E") no-repeat 14px center; }
.filtres-plus { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 12px; width: 100%; align-items: end;
  background: var(--surface-2); border: 1px solid var(--bord); border-radius: var(--r); padding: 14px; }
.filtres-bascule { display: none; }
.outils { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 8px 0 4px; }
.tout { display: flex; flex-direction: row; align-items: center; gap: 10px; font-size: 13px; text-transform: none; letter-spacing: 0; }
.tout input, .choix { width: 20px; height: 20px; min-height: 0; margin: 0; accent-color: var(--encre); flex: none; cursor: pointer; }
@media (prefers-color-scheme: dark) { .tout input, .choix { accent-color: var(--or); } }

/* ─── liste ─── */
.jour { display: flex; align-items: center; gap: 12px; font-size: 12px; text-transform: uppercase; letter-spacing: .14em;
  color: var(--or); margin: 28px 0 12px; font-weight: 600; }
.jour::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--bord-fort), transparent); }
.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 16px; }
.carte { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--r); padding: 18px;
  box-shadow: var(--ombre); display: grid; gap: 14px; align-content: start; min-width: 0;
  transition: box-shadow .2s, transform .2s, border-color .2s; }
.carte:hover { box-shadow: var(--ombre-haute); border-color: var(--bord-fort); transform: translateY(-2px); }
.carte.est-archive { opacity: .7; }
.carte-tete { display: flex; gap: 12px; align-items: flex-start; }
.titre { flex: 1; min-width: 0; }
.titre h2 { font-size: 16.5px; font-weight: 600; overflow-wrap: anywhere; line-height: 1.3; }
.act { margin: 3px 0 0; color: var(--doux); font-size: 13px; }
.pastille { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; border-radius: 999px;
  padding: 4px 10px; white-space: nowrap; }
.p-new { background: var(--new-fond); color: var(--new); box-shadow: inset 0 0 0 1px var(--or-clair); }
.p-ok { background: var(--ok-fond); color: var(--ok); }
.p-arch { background: var(--arch-fond); color: var(--arch); }
.infos { display: grid; gap: 6px; font-size: 14px; padding: 12px 0; border-top: 1px solid var(--bord); border-bottom: 1px solid var(--bord); }
.infos p { margin: 0; display: grid; grid-template-columns: 96px 1fr; gap: 10px; min-width: 0; }
.infos .k { color: var(--doux); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding-top: 2px; }
.infos .maj { display: block; font-size: 12px; color: var(--doux); margin-top: 4px; font-style: italic; }
.tel { font-weight: 600; font-variant-numeric: tabular-nums; font-size: 15px; text-decoration: none;
  border-bottom: 1px solid var(--or); }
.vignette { border: 1px solid var(--bord); border-radius: 12px; padding: 0; background: var(--surface-2);
  cursor: zoom-in; overflow: hidden; display: block; width: 100%; transition: border-color .15s; }
.vignette:hover { border-color: var(--or); }
.vignette img { width: 100%; height: 170px; object-fit: contain; display: block; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.actions .btn { flex: 1 1 auto; }
.vide { text-align: center; color: var(--doux); padding: 60px 0; font-size: 15px; }

/* ─── actions groupées ─── */
.lot { position: fixed; left: 50%; transform: translateX(-50%); bottom: 20px; z-index: 6;
  background: var(--encre); color: #f6f1e6; border-radius: 18px; padding: 10px 12px; border: 1px solid rgba(212, 178, 110, .35);
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: center;
  max-width: calc(100% - 32px); box-shadow: 0 20px 50px -12px rgba(0, 0, 0, .45); }
@media (prefers-color-scheme: dark) { .lot { background: #1d2331; color: var(--texte); } }
.lot #lot-nb { padding: 0 8px; font-weight: 600; font-size: 14px; color: var(--or); }
.lot .btn { background: transparent; color: inherit; border-color: rgba(246, 241, 230, .22); min-height: 38px; padding: 6px 12px; }
.lot .btn:hover { border-color: var(--or); }

.visu { border: 0; border-radius: 18px; padding: 14px; background: var(--surface); max-width: min(96vw, 920px);
  display: grid; gap: 12px; box-shadow: var(--ombre-haute); }
.visu:not([open]) { display: none; }
.visu img { max-width: 100%; max-height: 80vh; object-fit: contain; border-radius: 10px; }
.visu::backdrop { background: rgba(10, 12, 18, .7); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.toast { position: fixed; left: 50%; transform: translateX(-50%); top: 78px; z-index: 9; background: var(--encre);
  color: #f6f1e6; padding: 11px 18px; border-radius: 12px; font-size: 14px; max-width: calc(100% - 32px);
  box-shadow: var(--ombre-haute); border-left: 3px solid var(--or); }
@media (prefers-color-scheme: dark) { .toast { background: #1d2331; color: var(--texte); } }

/* ─── tablette ─── */
@media (max-width: 960px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* ─── téléphone ─── */
@media (max-width: 720px) {
  body { font-size: 15px; }
  .page { padding: 14px 14px 130px; }
  .barre-in { padding: 10px 14px; }
  .moi span { display: none; }
  .marque h1 { font-size: 17px; }
  .stats { gap: 10px; margin-bottom: 16px; }
  .stat { padding: 12px 14px; }
  .stat-v { font-size: 24px; }
  .filtres-bascule { display: inline-block; }
  .filtres-plus { display: none; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px 10px; padding: 14px 12px; }
  .filtres-plus.ouvert { display: grid; }
  .filtres-plus label:nth-child(1), .filtres-plus label:nth-child(2), #raz { grid-column: 1 / -1; }
  .filtres-plus label:nth-child(3) { order: 1; } .filtres-plus label:nth-child(6) { order: 2; }
  .filtres-plus label:nth-child(4) { order: 3; } .filtres-plus label:nth-child(5) { order: 4; }
  #raz { order: 5; }
  input, select, textarea { font-size: 16px; }
  .filtres #q { flex: 1 1 calc(100% - 110px); min-width: 0; }
  .filtres-bascule { flex: none; }
  .grille { grid-template-columns: 1fr; gap: 12px; }
  .carte { padding: 16px; }
  .carte:hover { transform: none; }
  .infos p { grid-template-columns: 88px 1fr; }
  .auth-carte { padding: 28px 22px 22px; }
  .lot { bottom: max(12px, env(safe-area-inset-bottom)); width: calc(100% - 24px); }
  .lot .btn { flex: 1 1 40%; }
  .lot #lot-nb { width: 100%; text-align: center; }
}
