:root {
  color-scheme: light;
  --bg: #fffbf7; --card: #ffffff; --text: #2b2140; --muted: #6d6482; --line: #f4e4e6;
  --primary: #db2750; --primary-ink: #fff; --ok: #1f9d55; --warn: #d98a00; --bad: #d62839;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Nunito", system-ui, sans-serif; background: var(--bg); color: var(--text); line-height: 1.45; }
a { color: var(--primary); }
h1, h2, h3 { margin: 0 0 .5rem; }
button, .btn { font: inherit; cursor: pointer; border: 0; border-radius: 12px; padding: .65rem 1rem; background: var(--primary); color: var(--primary-ink); font-weight: 700; text-decoration: none; display: inline-block; }
button.ghost, .btn.ghost { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
button.small { padding: .35rem .7rem; font-size: .85rem; border-radius: 9px; }
button.ok { background: var(--ok); } button.bad { background: var(--bad); } button.warn { background: var(--warn); }
button:disabled { opacity: .5; cursor: not-allowed; }
input, select, textarea { font: inherit; width: 100%; padding: .6rem .8rem; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--text); }
label { display: block; font-weight: 700; font-size: .85rem; margin: .7rem 0 .25rem; color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 1rem; }
.grid { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.stat b { display: block; font-size: 1.7rem; } .stat span { color: var(--muted); font-size: .85rem; }
.badge { display: inline-block; padding: .1rem .55rem; border-radius: 99px; font-size: .75rem; font-weight: 800; background: var(--line); }
.badge.pending, .badge.requested, .badge.open, .badge.awaiting_consent { background: #f7e2b8; color: #6b4600; }
.badge.approved, .badge.active, .badge.paid, .badge.succeeded, .badge.consented { background: #c8ecd5; color: #0f5a2c; }
.badge.rejected, .badge.suspended, .badge.failed, .badge.declined { background: #f4c9c3; color: #7a1d12; }
.badge.disabled, .badge.refunded, .badge.credited { background: #ddd; color: #444; }

/* Admin layout */
.layout { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
nav.side { background: var(--card); border-right: 1px solid var(--line); padding: 1rem; position: sticky; top: 0; height: 100vh; overflow: auto; }
nav.side h2 { color: var(--primary); }
nav.side a { display: block; padding: .6rem .8rem; border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 700; }
nav.side a.active, nav.side a:hover { background: var(--bg); color: var(--primary); }
main { padding: 1.2rem; overflow-x: hidden; }
.topbar { display: none; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: .78rem; text-transform: uppercase; }
.thumbs { display: flex; gap: .4rem; flex-wrap: wrap; }
.thumbs img, .thumbs video { height: 90px; border-radius: 10px; object-fit: cover; }
.toolbar { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: .6rem 0 1rem; }
.toolbar select, .toolbar input { width: auto; }
.row-actions { display: flex; gap: .3rem; flex-wrap: wrap; }
dialog { border: 0; border-radius: 18px; padding: 1.2rem; max-width: min(640px, 95vw); width: 100%; background: var(--card); color: var(--text); }
dialog::backdrop { background: rgba(0,0,0,.5); }
.login { max-width: 380px; margin: 12vh auto; }
.toast { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: .7rem 1.1rem; border-radius: 12px; z-index: 99; max-width: 92vw; }
.toast.err { background: var(--bad); color: #fff; }
@media (max-width: 800px) {
  .layout { grid-template-columns: 1fr; }
  nav.side { position: fixed; z-index: 20; inset: 0 25% 0 0; transform: translateX(-100%); transition: transform .2s; height: 100%; }
  nav.side.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .topbar { display: flex; align-items: center; gap: .8rem; padding: .7rem 1rem; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
}

/* Pages publiques */
.public { max-width: 920px; margin: 0 auto; padding: 1rem; }
.hero { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.hero img.logo { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; border: 3px solid var(--primary); }
.cards { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); margin-top: 1rem; }
.pcard { border-radius: 16px; overflow: hidden; position: relative; aspect-ratio: 3/4; background: var(--line); text-decoration: none; color: #fff; }
.pcard img { width: 100%; height: 100%; object-fit: cover; }
.pcard div { position: absolute; inset: auto 0 0 0; padding: 2rem .7rem .6rem; background: linear-gradient(transparent, rgba(0,0,0,.8)); font-weight: 800; }
