:root {
  --black: #070708;
  --ink: #0a0a0c;
  --coal: #0e0e11;
  --graphite: #141418;
  --stone: #1a1a1f;
  --gold: #f7d209;
  --gold-soft: #ffe35c;
  --champagne: #dcc9a3;
  --ivory: #f4f1ea;
  --bone: #d9d5cb;
  --muted: #8d8b84;
  --line: #f4f1ea1a;
  --line-soft: #f4f1ea0f;
  --line-strong: #f4f1ea33;
  --line-gold: #f7d20947;
  --font-display: "Cormorant Garamond", "Times New Roman", serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --radius: 2px;
  --pad: clamp(16px, 3vw, 40px);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 80% -10%, #1a1a1f 0%, transparent 60%),
    var(--black);
  color: var(--ivory);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }
a { color: inherit; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.86em;
  background: #f4f1ea14;
  border: 1px solid var(--line);
  padding: 1px 6px;
  border-radius: var(--radius);
}

.kicker {
  margin: 0 0 8px;
  font-size: 10.5px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--gold);
}

h1 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(32px, 4.4vw, 54px);
  line-height: 1.05;
  letter-spacing: -0.01em;
}

h1 em { font-style: italic; color: var(--champagne); }

.lede { margin: 0; max-width: 68ch; color: var(--bone); font-size: 14px; }

/* ---------------- boutons ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ivory);
  font: inherit;
  font-size: 13px;
  letter-spacing: 0.03em;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.btn:hover { border-color: var(--line-gold); background: #f7d2090f; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: progress; }

.btn--gold {
  background: var(--gold);
  border-color: var(--gold);
  color: #0a0a0c;
  font-weight: 500;
}
.btn--gold:hover { background: var(--gold-soft); border-color: var(--gold-soft); }

.btn--ghost { border-color: transparent; color: var(--muted); }
.btn--ghost:hover { color: var(--ivory); background: #f4f1ea0a; border-color: var(--line); }

.btn--danger { border-color: #f8717155; color: #fca5a5; }
.btn--danger:hover { background: #f8717114; border-color: #f8717188; }

.btn--sm { padding: 7px 11px; font-size: 12px; }
.btn--block { width: 100%; }

.btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------------- connexion ---------------- */

.auth {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(20px, 5vw, 60px) var(--pad);
  overflow: hidden;
}

.auth__glow {
  position: absolute;
  inset: -20% -10% auto;
  height: 70vh;
  background: radial-gradient(closest-side, #f7d2091f, transparent 70%);
  pointer-events: none;
}

.auth__card {
  position: relative;
  width: min(430px, 100%);
  padding: clamp(26px, 4vw, 42px);
  background: linear-gradient(180deg, #121216 0%, #0b0b0e 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 50px 120px -50px #000;
}

.auth__brand { display: inline-block; margin-bottom: 26px; }
.auth__brand img { display: block; width: min(240px, 70%); height: auto; }

.auth__lede { margin: 0 0 22px; color: var(--bone); font-size: 13.5px; }

.auth__form { display: grid; gap: 14px; }

.auth__back {
  display: inline-block;
  margin-top: 22px;
  font-size: 12.5px;
  color: var(--muted);
  text-decoration: none;
}
.auth__back:hover { color: var(--ivory); }

/* ---------------- champs ---------------- */

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 11.5px; color: var(--muted); letter-spacing: 0.02em; }
.field small { color: var(--muted); font-size: 11px; }
.field--wide { grid-column: 1 / -1; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="number"],
input[type="search"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  /* Fond blanc et texte noir : lisibles sur iPhone comme sur ordinateur,
     y compris pendant la saisie au clavier. */
  background: #ffffff;
  color: #101013;
  -webkit-text-fill-color: #101013;
  caret-color: #101013;
  color-scheme: light;
  -webkit-appearance: none;
  appearance: none;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input::placeholder,
textarea::placeholder {
  color: #6d6d74;
  -webkit-text-fill-color: #6d6d74;
  opacity: 1;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--gold);
  background: #ffffff;
  box-shadow: 0 0 0 3px #f7d20926;
}

textarea { resize: vertical; min-height: 84px; line-height: 1.5; }

select option { background: #ffffff; color: #101013; }

/* Cases à cocher des options */
.options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 6px;
  margin: 4px 0 14px;
}

.option {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  background: var(--coal);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.option:hover { border-color: var(--line-gold); }

.option input {
  flex: none;
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--gold);
  cursor: pointer;
}

.option:has(input:checked) {
  border-color: var(--line-gold);
  background: #f7d2090f;
  color: var(--ivory);
}

.group__hint {
  margin: -4px 0 12px;
  font-size: 12px;
  color: var(--muted);
}

/* Import d’annonce */
.import__row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: stretch;
}

.import__row .field { flex: 1 1 240px; }
.import__row .btn { align-self: flex-end; min-height: 42px; }

.import__status {
  margin: 10px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}

.import__status.is-ok { color: #86efac; }
.import__status.is-error { color: #fca5a5; }

.import__or {
  margin: 12px 0;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.import__text { min-height: 74px; }

.switch {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--coal);
  cursor: pointer;
  font-size: 13px;
}
.switch input { width: 16px; height: 16px; accent-color: var(--gold); }
.switch small { color: var(--muted); font-size: 11.5px; }

/* ---------------- messages ---------------- */

.flash {
  margin: 0 0 16px;
  padding: 11px 14px;
  font-size: 13px;
  border: 1px solid var(--line-gold);
  border-left: 2px solid var(--gold);
  background: #f7d2090d;
  color: var(--bone);
}

.flash--error {
  border-color: #f8717155;
  border-left-color: #f87171;
  background: #f8717110;
  color: #fecaca;
}

.notice {
  margin: 22px 0 0;
  padding: 14px 16px;
  border: 1px solid var(--line-gold);
  border-left: 2px solid var(--gold);
  background: #f7d2090d;
  font-size: 13px;
  color: var(--bone);
  max-width: 92ch;
}
.notice p { margin: 6px 0 0; }
.notice strong { color: var(--ivory); font-weight: 500; }

/* ---------------- en-tête ---------------- */

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px var(--pad);
  background: #0a0a0ceb;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.top__brand img { display: block; width: 132px; height: auto; }

.top__label {
  margin: 0;
  font-size: 10.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  padding-left: 14px;
  border-left: 1px solid var(--line-strong);
}

.top__side { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.top__side form { margin: 0; }

/* ---------------- mise en page ---------------- */

.wrap { padding: clamp(24px, 4vw, 48px) var(--pad) 70px; max-width: 1500px; margin: 0 auto; }

.overview {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-top: 18px;
}

.stats {
  display: flex;
  gap: 10px;
  margin: 0;
  flex-wrap: wrap;
}

.stats > div {
  min-width: 104px;
  padding: 12px 16px;
  background: linear-gradient(180deg, #121216, #0c0c0f);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.stats dt {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.stats dd {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1;
  color: var(--ivory);
  font-variant-numeric: tabular-nums;
}

.tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 28px 0 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.search { position: relative; flex: 1 1 260px; max-width: 380px; }
.search svg {
  position: absolute;
  left: 11px;
  top: 50%;
  translate: 0 -50%;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.6;
  stroke-linecap: round;
}
.search input { padding-left: 34px; }

.filters { display: flex; gap: 4px; flex-wrap: wrap; }

.filter {
  padding: 7px 12px;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.filter:hover { color: var(--ivory); border-color: var(--line-gold); }
.filter.is-active { color: var(--gold); border-color: var(--line-gold); background: #f7d20910; }

.count { color: var(--muted); font-size: 12.5px; white-space: nowrap; }

.tools .btn--gold { margin-left: auto; }

/* ---------------- cartes ---------------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
}

.card {
  display: flex;
  gap: 14px;
  padding: 12px;
  background: linear-gradient(180deg, #121216 0%, #0d0d10 100%);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  transition: border-color 0.2s ease;
}
.card:hover { border-color: var(--line); }
.card[hidden] { display: none; }
.card.is-sold { opacity: 0.74; }

.card__thumb {
  flex: 0 0 112px;
  width: 112px;
  height: 84px;
  object-fit: cover;
  background: var(--stone);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
}

.card__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }

.card__brand {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}

.tag {
  font-size: 9.5px;
  letter-spacing: 0.14em;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
}
.tag--sold { color: #fca5a5; border-color: #f8717155; }

.card__title {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card__meta { margin: 0; font-size: 12px; color: var(--muted); }
.card__price { margin: 0; font-size: 13px; color: var(--champagne); font-variant-numeric: tabular-nums; }

.card__actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.card__actions form { margin: 0; }

.empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 44px 20px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  font-size: 13.5px;
}

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin-top: 34px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  font-size: 11.5px;
  color: var(--muted);
}
.foot p { margin: 0; }

/* ---------------- éditeur ---------------- */

.editor {
  width: min(920px, calc(100vw - 24px));
  max-height: min(92vh, 1000px);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--ivory);
  box-shadow: 0 40px 120px -40px #000;
}

.editor::backdrop { background: #000000c4; backdrop-filter: blur(3px); }
.editor[open] { display: flex; flex-direction: column; }
.editor form { display: flex; flex-direction: column; min-height: 0; }

.editor__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.editor__head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 26px;
  line-height: 1.1;
}

.editor__close {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ivory);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.editor__close:hover { border-color: var(--line-gold); color: var(--gold); }

.editor__body { padding: 20px 22px; overflow-y: auto; min-height: 0; }

.group { margin-bottom: 22px; }
.group__title {
  display: block;
  margin-bottom: 10px;
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.thumbs img {
  width: 84px;
  height: 62px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--stone);
}

.upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 20px 14px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: #f4f1ea05;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.upload:hover { border-color: var(--line-gold); background: #f7d2090a; }
.upload input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.upload svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.upload span { font-size: 13px; }
.upload small { color: var(--muted); font-size: 11px; }

.editor__foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  background: var(--coal);
  flex-wrap: wrap;
}

/* ---------------- responsive ---------------- */

@media (max-width: 700px) {
  .grid { grid-template-columns: 1fr; }
  .card__thumb { flex-basis: 92px; width: 92px; height: 70px; }
  .tools .btn--gold { margin-left: 0; width: 100%; }
  .tools { gap: 8px; }
  .search { max-width: none; }
  .overview { align-items: flex-start; }
  .stats { width: 100%; }
  .stats > div { flex: 1 1 0; min-width: 0; padding: 10px 12px; }
  .stats dd { font-size: 24px; }
  .top__label { display: none; }
}
