/* Nana — démo. Ludique, touche féminine inspirée du wax ; trois palettes à faire choisir. */

:root,
[data-palette="prune"] {
  --primaire: #7b2d5b;      /* prune */
  --primaire-fonce: #5a1f42;
  --accent: #e9573f;        /* corail */
  --doux: #fbe4ea;          /* rose poudré */
  --or: #e8a93a;
  --eau: #5fb3a6;           /* vert d'eau */
  --fond: #fff8f4;
  --carte: #ffffff;
  --encre: #2b1630;
  --discret: #6f5a6b;
  --bordure: #f0dfe4;
}
[data-palette="framboise"] {
  --primaire: #b02e5a;
  --primaire-fonce: #861f43;
  --accent: #f08a24;
  --doux: #fde9d9;
  --or: #f2b134;
  --eau: #4fae9b;
  --fond: #fffaf3;
  --carte: #ffffff;
  --encre: #331a20;
  --discret: #75585e;
  --bordure: #f5e2d6;
}
[data-palette="indigo"] {
  --primaire: #3d3a96;
  --primaire-fonce: #2a2870;
  --accent: #e2507a;
  --doux: #e9e8fb;
  --or: #f2b134;
  --eau: #5fb3a6;
  --fond: #f9f8ff;
  --carte: #ffffff;
  --encre: #1d1b3a;
  --discret: #5e5c7a;
  --bordure: #e2e0f5;
}

:root {
  --succes: #1f8a5b;
  --danger: #c02a3c;
  --rayon: 22px;
  --ombre: 0 6px 18px rgba(43, 22, 48, 0.08);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--doux);
  color: var(--encre);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.cadre {
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--fond);
  padding-bottom: 92px;
  position: relative;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.06);
}
h1, h2, h3 { line-height: 1.2; }
a { color: var(--primaire); }
button { font: inherit; cursor: pointer; }
.discret { color: var(--discret); }
.petit { font-size: 0.88rem; }

/* ---------- En-tête wax ---------- */
.entete {
  position: relative;
  overflow: hidden;
  background: var(--primaire);
  color: #fff;
  padding: 14px 16px 12px;
  border-radius: 0 0 28px 28px;
}
.motif { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.22; }
.motif .m1 { fill: var(--or); }
.motif .m2 { fill: #fff; }
.motif .m3 { fill: var(--accent); }
.entete-contenu { position: relative; display: flex; align-items: center; justify-content: space-between; }
.marque { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 800; font-size: 1.45rem; letter-spacing: 0.5px; }
.marque-logo {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 13px;
  background: #fff; color: var(--primaire); font-size: 1.2rem; box-shadow: 3px 3px 0 var(--or);
}
.bouton-rond {
  width: 42px; height: 42px; border-radius: 50%; border: 0; font-size: 1.2rem;
  background: rgba(255, 255, 255, 0.92);
}
.bandeau-demo {
  position: relative; display: inline-block; margin: 8px 0 0; padding: 2px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.2); font-size: 0.75rem; font-weight: 600;
}

/* ---------- Écrans ---------- */
.ecran { padding: 16px; outline: none; }
.ecran > * { animation: monter 0.35s ease both; }
.ecran > *:nth-child(2) { animation-delay: 0.04s; }
.ecran > *:nth-child(3) { animation-delay: 0.08s; }
.ecran > *:nth-child(4) { animation-delay: 0.12s; }
@keyframes monter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ecran > * { animation: none; } }

.salut { margin: 4px 0 14px; }
.salut h1 { margin: 0; font-size: 1.5rem; }
.salut p { margin: 2px 0 0; color: var(--discret); }

.titre-page { display: flex; align-items: center; gap: 10px; margin: 4px 0 14px; }
.titre-page h1 { margin: 0; font-size: 1.4rem; }
.retour { text-decoration: none; font-size: 1.3rem; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 14px; background: var(--doux); }

.section { display: flex; align-items: baseline; justify-content: space-between; margin: 22px 0 10px; }
.section h2 { margin: 0; font-size: 1.1rem; }
.section a { font-weight: 700; font-size: 0.92rem; text-decoration: none; }

/* Carte « ce mois-ci » */
.mois {
  background: linear-gradient(135deg, var(--primaire), var(--primaire-fonce));
  color: #fff; border-radius: var(--rayon); padding: 18px; box-shadow: var(--ombre);
  position: relative; overflow: hidden;
}
.mois::after {
  content: ""; position: absolute; right: -30px; top: -30px; width: 120px; height: 120px;
  border-radius: 50%; border: 18px solid var(--or); opacity: 0.35;
}
.mois small { opacity: 0.85; }
.mois .grand { display: block; font-size: 2rem; font-weight: 800; margin: 2px 0 12px; }
.mois-ligne { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mois-ligne div { background: rgba(255, 255, 255, 0.14); border-radius: 14px; padding: 8px 10px; }
.mois-ligne strong { display: block; font-size: 1.05rem; }

.bravo {
  display: flex; gap: 12px; align-items: center; margin-top: 12px; padding: 12px 14px;
  background: var(--carte); border: 2px dashed var(--or); border-radius: var(--rayon);
}
.bravo .gros-emoji { font-size: 1.8rem; }
.bravo p { margin: 0; }

/* Tuiles de liste */
.liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tuile {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--carte);
  border: 1px solid var(--bordure); border-radius: 18px; text-decoration: none; color: inherit;
  box-shadow: 0 2px 0 var(--bordure);
}
a.tuile:active { transform: scale(0.99); }
.avatar {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--doux); color: var(--primaire); font-weight: 800;
}
.avatar.produit { border-radius: 14px; font-size: 1.5rem; }
.tuile-corps { flex: 1; min-width: 0; }
.tuile-corps strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tuile-corps small { display: block; color: var(--discret); }
.tuile-fin { text-align: right; flex: none; }
.tuile-fin strong { display: block; white-space: nowrap; }
.montant-du { color: var(--danger); }

.pastille { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; white-space: nowrap; }
.p-solde { background: #dcf3e7; color: #17663f; }
.p-acompte { background: #fff0d1; color: #8a5300; }
.p-rien { background: #fde2e4; color: #9b1c2e; }
.p-livrer { background: var(--doux); color: var(--primaire); }
.p-attente { background: #e4f1ff; color: #1d4f91; }

.vide { text-align: center; padding: 28px 12px; color: var(--discret); }
.vide span { display: block; font-size: 2.2rem; }

/* Filtres en pastilles */
.filtres { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: none; }
.filtres button {
  flex: none; border: 2px solid var(--bordure); background: var(--carte); color: var(--encre);
  padding: 6px 14px; border-radius: 999px; font-weight: 600; font-size: 0.9rem;
}
.filtres button[aria-pressed="true"] { background: var(--primaire); border-color: var(--primaire); color: #fff; }

/* Boutons */
.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 16px; padding: 13px 18px; font-weight: 700; text-decoration: none;
  background: var(--primaire); color: #fff; box-shadow: 0 4px 0 var(--primaire-fonce);
}
.bouton:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--primaire-fonce); }
.bouton.plein { width: 100%; }
.bouton.whatsapp { background: #1fa855; box-shadow: 0 4px 0 #157a3d; }
.bouton.secondaire { background: var(--carte); color: var(--primaire); border: 2px solid var(--primaire); box-shadow: none; }
.bouton.danger { background: var(--carte); color: var(--danger); border: 2px solid var(--danger); box-shadow: none; }
.actions { display: grid; gap: 10px; margin-top: 14px; }
.actions.deux { grid-template-columns: 1fr 1fr; }
.lien { background: none; border: 0; color: var(--primaire); font-weight: 700; padding: 6px 0; text-decoration: underline; }
.flottant {
  position: fixed; bottom: 92px; right: max(16px, calc(50% - 224px)); z-index: 5;
  width: 58px; height: 58px; border-radius: 20px; font-size: 1.7rem; padding: 0;
  background: var(--accent); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* Formulaires */
fieldset.champ { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
fieldset.champ legend { padding: 0; margin-bottom: 6px; }
fieldset.champ [name="nouvelle"] { margin-top: 10px; }
a.tuile-corps { color: inherit; text-decoration: none; }
.tuile .bouton.whatsapp { padding: 10px 13px; border-radius: 14px; }
.tuile .actions.deux { margin-top: 10px; }
.tuile .actions.deux .bouton { padding: 9px 10px; }
.carte { background: var(--carte); border: 1px solid var(--bordure); border-radius: var(--rayon); padding: 16px; margin-bottom: 12px; }
.champ { margin-bottom: 16px; }
.champ > label, .champ > .libelle { display: block; font-weight: 700; margin-bottom: 6px; }
.champ input[type="text"], .champ input[type="number"], .champ input[type="date"], .champ textarea {
  width: 100%; font: inherit; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--bordure);
  background: var(--fond); color: var(--encre);
}
.champ input:focus, .champ textarea:focus { outline: none; border-color: var(--primaire); box-shadow: 0 0 0 4px var(--doux); }
.apercu { display: block; margin-top: 4px; color: var(--primaire); font-weight: 700; min-height: 1.2em; }
.puces { display: flex; flex-wrap: wrap; gap: 8px; }
.puces label { position: relative; }
.puces input { position: absolute; opacity: 0; inset: 0; }
.puces span {
  display: inline-block; padding: 8px 14px; border-radius: 999px; border: 2px solid var(--bordure);
  background: var(--carte); font-weight: 600; font-size: 0.92rem;
}
.puces input:checked + span { background: var(--primaire); color: #fff; border-color: var(--primaire); }
.puces input:focus-visible + span { box-shadow: 0 0 0 4px var(--doux); }
.suggestions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.suggestions button { border: 0; background: var(--doux); color: var(--primaire); border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: 0.85rem; }
.depot {
  display: flex; align-items: center; gap: 10px; padding: 14px; border: 2px dashed var(--bordure);
  border-radius: 16px; color: var(--discret); background: var(--fond);
}
.depot input { width: 100%; }

/* Détail */
.resume { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.resume div { background: var(--doux); border-radius: 16px; padding: 10px; }
.resume small { display: block; color: var(--discret); font-size: 0.78rem; }
.resume strong { font-size: clamp(0.82rem, 3.6vw, 1rem); white-space: nowrap; }
.barre { height: 10px; border-radius: 999px; background: var(--bordure); overflow: hidden; margin: 6px 0 2px; }
.barre i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--or)); }
.barre .b0 { width: 0; } .barre .b10 { width: 10%; } .barre .b20 { width: 20%; } .barre .b30 { width: 30%; }
.barre .b40 { width: 40%; } .barre .b50 { width: 50%; } .barre .b60 { width: 60%; } .barre .b70 { width: 70%; }
.barre .b80 { width: 80%; } .barre .b90 { width: 90%; } .barre .b100 { width: 100%; background: var(--succes); }

/* Vue de la cliente (lien WhatsApp) */
.vue-cliente .boutique {
  text-align: center; padding: 18px; border-radius: var(--rayon); background: var(--carte);
  border: 1px solid var(--bordure);
}
.vue-cliente .boutique .avatar { margin: 0 auto 8px; width: 60px; height: 60px; font-size: 1.6rem; }
.vue-cliente .du { font-size: 2.1rem; font-weight: 800; color: var(--primaire); margin: 4px 0; }
.note-apercu { background: var(--doux); border-radius: 14px; padding: 10px 12px; font-size: 0.88rem; margin-bottom: 14px; }

/* Catalogue */
.grille { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.produit-carte { background: var(--carte); border: 1px solid var(--bordure); border-radius: var(--rayon); overflow: hidden; }
.produit-image { display: grid; place-items: center; height: 110px; font-size: 3rem; background: var(--doux); position: relative; overflow: hidden; }
.produit-image::before {
  content: ""; position: absolute; width: 90px; height: 90px; border-radius: 50%;
  border: 12px solid var(--or); opacity: 0.25; left: -30px; bottom: -40px;
}
.produit-image.t1 { background: #fde2d6; } .produit-image.t2 { background: #e5f3ef; } .produit-image.t3 { background: #f3e5f5; }
.produit-carte div:last-child { padding: 10px 12px 12px; }
.produit-carte strong { display: block; font-size: 0.95rem; }
.produit-carte .prix { color: var(--primaire); font-weight: 800; }

/* Bilan : graphique SVG */
.graphique { width: 100%; height: 180px; display: block; }
.graphique .vendu { fill: var(--doux); }
.graphique .encaisse { fill: var(--primaire); }
.graphique .encaisse.courant { fill: var(--accent); }
.graphique text { fill: var(--discret); font-size: 11px; }
.legende { display: flex; gap: 14px; font-size: 0.85rem; color: var(--discret); }
.legende i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 5px; vertical-align: -1px; }
.legende .l-vendu { background: var(--doux); border: 1px solid var(--bordure); }
.legende .l-encaisse { background: var(--primaire); }
.medaille { display: flex; gap: 12px; align-items: center; }
.medaille span { font-size: 2rem; }

/* Onglets du bas */
.onglets {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; z-index: 10;
  display: grid; grid-template-columns: repeat(5, 1fr); background: var(--carte);
  border-top: 1px solid var(--bordure); padding: 6px 4px calc(8px + env(safe-area-inset-bottom));
  border-radius: 22px 22px 0 0; box-shadow: 0 -6px 18px rgba(43, 22, 48, 0.06);
}
.onglets a {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border-radius: 14px;
  font-size: 0.72rem; font-weight: 600; color: var(--discret); text-decoration: none;
}
.onglets a span { font-size: 1.3rem; }
.onglets a[aria-current="page"] { color: var(--primaire); background: var(--doux); }
.badge {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 0.75rem; font-weight: 800;
}

/* Feuille des palettes */
.feuille {
  border: 0; border-radius: 26px; padding: 20px; width: min(440px, calc(100% - 24px));
  background: var(--fond); color: var(--encre);
}
.feuille::backdrop { background: rgba(30, 10, 30, 0.45); }
.feuille h2 { margin: 0 0 4px; }
.choix-palettes { display: grid; gap: 10px; margin: 14px 0; }
.palette {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; text-align: left;
  border: 2px solid var(--bordure); background: var(--carte); border-radius: 18px; padding: 12px; color: var(--encre);
}
.palette .pastilles-couleurs { grid-row: span 2; display: grid; grid-template-columns: 1fr 1fr; gap: 3px; align-self: center; }
.palette i { display: block; width: 18px; height: 18px; border-radius: 6px; }
.palette small { color: var(--discret); }
.palette-prune i:nth-child(1) { background: #7b2d5b; } .palette-prune i:nth-child(2) { background: #e9573f; }
.palette-prune i:nth-child(3) { background: #fbe4ea; } .palette-prune i:nth-child(4) { background: #e8a93a; }
.palette-framboise i:nth-child(1) { background: #b02e5a; } .palette-framboise i:nth-child(2) { background: #f08a24; }
.palette-framboise i:nth-child(3) { background: #fde9d9; } .palette-framboise i:nth-child(4) { background: #f2b134; }
.palette-indigo i:nth-child(1) { background: #3d3a96; } .palette-indigo i:nth-child(2) { background: #e2507a; }
.palette-indigo i:nth-child(3) { background: #e9e8fb; } .palette-indigo i:nth-child(4) { background: #f2b134; }
.palette[aria-current="true"] { border-color: var(--primaire); box-shadow: 0 0 0 4px var(--doux); }

/* Petit message */
.toast {
  position: fixed; left: 50%; bottom: 100px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--encre); color: #fff; padding: 12px 18px; border-radius: 16px; font-weight: 600;
  transition: opacity 0.25s, transform 0.25s; z-index: 20; max-width: calc(100% - 32px); text-align: center;
}
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

/* Confettis (validation d'un paiement) */
.confetti { position: fixed; top: -12px; width: 9px; height: 14px; border-radius: 3px; z-index: 30; pointer-events: none; animation: tomber 1.4s ease-in forwards; }
.confetti.c1 { background: var(--accent); } .confetti.c2 { background: var(--or); } .confetti.c3 { background: var(--primaire); } .confetti.c4 { background: var(--eau); }
@keyframes tomber { to { transform: translateY(105vh) rotate(540deg); opacity: 0.6; } }
.onglets[hidden] { display: none; }
.mode-cliente .cadre { padding-bottom: 24px; }
.vue-cliente form.carte { margin-top: 14px; }
