/* =========================================================
   Liste de Noël — feuille de style
   ========================================================= */
:root {
  --bg: #FDF3E1;
  --surface: #FFFBF3;
  --line: #EADFCB;
  --green: #1E4D40;
  --green-2: #2B6553;
  --green-soft: #E2EAE3;
  --red: #B3313F;
  --red-dark: #962534;
  --red-soft: #F7E1E3;
  --text: #1E3B33;
  --muted: #6B7A72;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(30, 77, 64, .04), 0 6px 18px rgba(30, 77, 64, .05);
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Figtree', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
}
a { color: var(--green); }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }
.ico { flex-shrink: 0; vertical-align: middle; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* ---------- Barre supérieure ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 14px 4vw;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}
.logo {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 700;
  font-size: 2rem;
  line-height: 1;
  color: var(--red);
  text-decoration: none;
  letter-spacing: -.5px;
  text-shadow: 0 1px 0 #fff;
}
.logo::first-letter { color: var(--green); }
.logo-center { display: block; text-align: center; margin-bottom: 18px; }
.topnav { display: flex; gap: 6px; flex-wrap: wrap; }
.navlink {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  border-radius: 12px;
  color: var(--green);
  font-weight: 600;
  font-size: 1.05rem;
  text-decoration: none;
  transition: background .15s;
}
.navlink:hover, .navlink.active { background: var(--green-soft); }
.topright { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.topright form { margin: 0; }
.iconbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border: 0; border-radius: 10px;
  background: transparent; color: var(--green);
}
.iconbtn:hover { background: var(--green-soft); }

/* ---------- Mise en page ---------- */
.layout {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 38px;
  max-width: 1420px;
  margin: 0 auto;
  padding: 48px 4vw 80px;
}
.side-label, .eyebrow {
  font-size: .82rem;
  color: var(--muted);
  letter-spacing: .4px;
}
.side-label { text-transform: uppercase; font-weight: 600; letter-spacing: 1.2px; margin: 50px 0 12px; }
.side-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 7px;
  box-shadow: var(--shadow);
}
.side-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  font-size: 1.08rem;
}
.side-item + .side-item { margin-top: 3px; }
.side-item:hover { background: #F4EEE2; }
.side-item.active { background: var(--green-soft); }
.side-name { flex: 1; }
.side-name small { color: var(--muted); font-weight: 500; font-size: .8rem; margin-left: 4px; }
.avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  flex-shrink: 0;
}

.main { min-width: 0; }
.title {
  font-family: var(--serif);
  font-weight: 800;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -.5px;
  color: var(--green);
  margin: 6px 0 22px;
}
.title span { color: var(--red); }
.title-sm { font-size: clamp(1.7rem, 3vw, 2.4rem); }

.banner {
  display: flex; align-items: center; gap: 14px;
  background: var(--green-soft);
  border-radius: 12px;
  padding: 14px 20px;
  margin-bottom: 20px;
  font-size: .97rem;
}
.banner-red { background: var(--red-soft); color: var(--red-dark); }
.banner-red span { flex: 1; }
.banner-red a { color: var(--red-dark); }

.flash {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 18px;
  border-radius: 12px;
  margin-bottom: 14px;
  font-weight: 500;
}
.flash-ok { background: #DCEFE3; color: #14532D; border: 1px solid #B9DEC6; }
.flash-err { background: var(--red-soft); color: var(--red-dark); border: 1px solid #EDC2C7; }

/* ---------- Cartes cadeaux ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 16px;
}
.card {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .18s, box-shadow .18s;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(30, 77, 64, .10); }
.card-media {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  height: 245px;
  border: 0; padding: 0;
  background: var(--green-soft);
  color: var(--green-2);
  width: 100%;
}
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.media-ph { display: inline-flex; opacity: .9; }
.media-count {
  position: absolute; right: 12px; bottom: 12px;
  background: rgba(30, 59, 51, .78); color: #fff;
  font-size: .8rem; font-weight: 600;
  padding: 4px 10px; border-radius: 999px;
}
.card.is-reserved .card-media { filter: grayscale(.55); opacity: .75; }
.card-body {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  padding: 20px 20px 20px;
  flex: 1;
}
.card-title { margin: 0; font-size: 1.4rem; font-weight: 600; line-height: 1.3; color: var(--green); }
.card-title button {
  all: unset; cursor: pointer;
}
.card-title button:hover { text-decoration: underline; text-underline-offset: 3px; }
.badge {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--green-soft);
  color: var(--green);
  font-weight: 600; font-size: .93rem;
  padding: 4px 12px;
  border-radius: 999px;
}
.badge-reserved { background: var(--red-soft); color: var(--red-dark); }
.badge-reserved a { color: inherit; }
.price { font-weight: 700; font-size: 1.05rem; }
.for { color: var(--muted); font-size: 1.02rem; }
.shops { display: flex; flex-wrap: wrap; gap: 6px; }
.shops a {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .85rem; font-weight: 600;
  color: var(--green);
  text-decoration: none;
  border: 1px solid var(--line);
  background: #fff;
  padding: 3px 10px; border-radius: 8px;
}
.shops a:hover { border-color: var(--green); }
.card-actions { margin-top: auto; padding-top: 12px; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border: 0;
  border-radius: 10px;
  padding: 13px 24px;
  font-weight: 700; font-size: 1.08rem;
  text-decoration: none;
  transition: background .15s, transform .1s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }
.btn-ghost { background: var(--green-soft); color: var(--green); }
.btn-ghost:hover { background: #D3DFD6; }
.btn-danger { background: var(--red-soft); color: var(--red-dark); }
.btn-danger:hover { background: #F0C9CE; }
.btn-disabled { background: #E7E1D6; color: #8A8F86; cursor: not-allowed; }
.btn-sm { padding: 8px 14px; font-size: .92rem; gap: 7px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .85; }

.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty .ico { color: var(--green-2); }

/* ---------- Fenêtres modales ---------- */
.dialog {
  border: 0; padding: 0;
  border-radius: 22px;
  background: var(--surface);
  color: var(--text);
  width: min(480px, calc(100vw - 24px));
  max-height: calc(100vh - 40px);
  box-shadow: 0 30px 80px rgba(20, 40, 34, .35);
}
.dialog-wide { width: min(920px, calc(100vw - 24px)); }
.dialog::backdrop { background: rgba(22, 44, 37, .55); backdrop-filter: blur(3px); }
.dialog[open] { animation: pop .18s ease-out; }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } }
.dlg-close {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .85); color: var(--green);
}
.dlg-close:hover { background: var(--green-soft); }
.dialog > form, #detail-content { padding: 30px; }
.dlg-icon {
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--red-soft); color: var(--red);
  display: flex; align-items: center; justify-content: center;
}
.dlg-title { font-family: var(--serif); font-size: 1.6rem; color: var(--green); margin: 8px 0 0; }
.dlg-gift { margin: 0; font-weight: 600; color: var(--red-dark); }
.dlg-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 6px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.detail { display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; }
.gal-main {
  aspect-ratio: 1 / 1;
  background: var(--green-soft); color: var(--green-2);
  border-radius: 16px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.gal-main img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.gal-thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.gal-thumbs button {
  width: 64px; height: 64px; padding: 0;
  border: 2px solid transparent; border-radius: 10px; overflow: hidden; background: #fff;
}
.gal-thumbs button.on { border-color: var(--red); }
.gal-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.detail-info { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.detail-info h2 { font-family: var(--serif); font-size: 1.9rem; line-height: 1.15; color: var(--green); margin: 0; padding-right: 30px; }
.detail-info h3 { margin: 10px 0 0; font-size: 1rem; color: var(--green); }
.detail-info p { margin: 0; }
.desc { line-height: 1.55; }
.detail-links { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Formulaires ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .95rem; }
.form label.check { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 500; }
.form label.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--red); flex-shrink: 0; }
input[type=text], input[type=email], input[type=url], input[type=password], input[type=number], select, textarea {
  font: inherit; font-weight: 400;
  color: var(--text);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 11px 13px;
  width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--green-2);
  box-shadow: 0 0 0 3px rgba(43, 101, 83, .15);
}
textarea { resize: vertical; }
input[type=color] { width: 48px; height: 42px; padding: 2px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; }
.hint { margin: 0; color: var(--muted); font-size: .87rem; }
.mt { margin-top: 10px; }

/* ---------- Administration ---------- */
.admin-main { max-width: 1100px; margin: 0 auto; padding: 36px 4vw 80px; }
.admin-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.admin-head .title { margin-bottom: 18px; }
.back { display: inline-flex; align-items: center; gap: 8px; color: var(--green); font-weight: 600; text-decoration: none; margin-bottom: 10px; }
.back:hover { text-decoration: underline; }
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.panel summary { cursor: pointer; font-weight: 600; color: var(--green); }
.log { background: #1E2A26; color: #D6E6DD; padding: 14px; border-radius: 10px; overflow: auto; font-size: .8rem; }
fieldset { border: 0; border-top: 1px solid var(--line); padding: 18px 0 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
legend { display: inline-flex; align-items: center; gap: 8px; font-family: var(--serif); font-size: 1.25rem; font-weight: 600; color: var(--green); padding-right: 12px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.span2 { grid-column: span 2; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 18px; }

.stats { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 20px; min-width: 140px; display: flex; align-items: baseline; gap: 8px;
}
.stat strong { font-family: var(--serif); font-size: 1.8rem; color: var(--green); }
.stat-red strong { color: var(--red); }
.stat span { color: var(--muted); }

.rows { display: flex; flex-direction: column; gap: 10px; }
.row {
  display: flex; align-items: center; gap: 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 12px; box-shadow: var(--shadow);
}
.row-thumb {
  width: 76px; height: 76px; border-radius: 12px; overflow: hidden; flex-shrink: 0;
  background: var(--green-soft); color: var(--green-2);
  display: flex; align-items: center; justify-content: center;
}
.row-thumb img { width: 100%; height: 100%; object-fit: cover; }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.row-title { font-weight: 700; font-size: 1.1rem; text-decoration: none; color: var(--green); }
.row-title:hover { text-decoration: underline; }
.row-meta { color: var(--muted); font-size: .9rem; }
.row-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.row-actions form { margin: 0; }

.thumbs { display: flex; flex-wrap: wrap; gap: 10px; }
.thumbs:empty { display: none; }
.thumb { position: relative; width: 120px; height: 120px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #fff; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-new { outline: 2px dashed var(--green-2); outline-offset: -2px; }
.thumb-del {
  position: absolute; top: 6px; right: 6px;
  width: 30px; height: 30px; border: 0; border-radius: 8px;
  background: rgba(255, 255, 255, .92); color: var(--red);
  display: flex; align-items: center; justify-content: center;
}
.thumb-del:hover { background: var(--red); color: #fff; }
.drop {
  position: relative;
  border: 2px dashed #CFC3AC; border-radius: 14px;
  padding: 22px; text-align: center; color: var(--green);
  background: #fff; cursor: pointer;
}
.drop:hover { border-color: var(--green-2); background: #F8FBF8; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop span { display: inline-flex; align-items: center; gap: 8px; justify-content: center; }

.link-row { display: grid; grid-template-columns: 220px 1fr 40px; gap: 8px; margin-bottom: 8px; }

.child-row {
  display: grid;
  grid-template-columns: 48px 1fr 56px 80px 110px auto auto;
  align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.child-row:last-of-type { border-bottom: 0; }
.child-new { margin-top: 8px; }
.w-num { width: 80px; }

.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-card {
  width: min(420px, 100%);
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px;
  padding: 34px; box-shadow: 0 20px 60px rgba(30, 77, 64, .12);
}
.auth-card .back { margin: 18px 0 0; }
.h2 { font-family: var(--serif); color: var(--green); margin: 0 0 6px; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; gap: 10px; padding-top: 20px; }
  .side-label { margin-top: 0; }
  .side-box { display: flex; gap: 6px; overflow-x: auto; }
  .side-item { flex-shrink: 0; padding: 8px 14px 8px 8px; }
  .side-item + .side-item { margin-top: 0; }
  .side-item > .ico:last-child { display: none; }
  .avatar { width: 38px; height: 38px; font-size: .9rem; }
  .detail { grid-template-columns: 1fr; }
  .child-row { grid-template-columns: 40px 1fr 50px auto auto; }
  .child-row .w-num, .child-row > .muted, .child-row > span:empty { display: none; }
}
@media (max-width: 640px) {
  .topbar { gap: 12px; padding: 10px 16px; flex-wrap: wrap; }
  .logo { font-size: 1.6rem; }
  .navlink { padding: 8px 10px; font-size: .95rem; }
  .cols { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .row { flex-wrap: wrap; }
  .row-actions { width: 100%; justify-content: flex-start; }
  .link-row { grid-template-columns: 1fr 40px; }
  .link-row input[type=text] { grid-column: span 2; }
  .dialog > form, #detail-content { padding: 22px; }
  .card-media { height: 210px; }
  .btn { font-size: 1rem; }
}
