/* 5étoiles — application de gestion du menu (ordinateur)
   Même identité que le site : charbon, craie, jaune soleil, DM Sans. */
:root {
  --ink: #222222;
  --ink-2: #2E2E2E;
  --ink-3: #3A3A38;
  --text: #2A2300;
  --paper: #F5F4F0;
  --sand: #EBE8DF;
  --card: #FFFFFF;
  --sun: #FFE15E;
  --sun-2: #F5CF2E;
  --muted: rgba(42, 35, 0, .62);
  --line: rgba(42, 35, 0, .12);
  --line-2: rgba(42, 35, 0, .2);
  --on-ink: rgba(245, 244, 240, .66);
  --rouge: #B3261E;
  --vert: #2E7D4F;
  --ease-out: cubic-bezier(.32, .72, 0, 1);
  --f-body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--paper); color: var(--text); font-family: var(--f-body); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--sun-2); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
p, h1, h2, h3 { margin: 0; }
svg { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Mise en page : barre latérale · contenu · aperçu ---------- */
.app { display: grid; grid-template-columns: 236px minmax(0, 1fr) 404px; height: 100vh; }
.petit-ecran { display: none; }
@media (max-width: 999.98px) {
  .app { display: none; }
  .petit-ecran { display: grid; place-items: center; min-height: 100vh; padding: 32px; text-align: center; font-weight: 600; }
}
@media (max-width: 1399.98px) { .app { grid-template-columns: 212px minmax(0, 1fr) 360px; } }

/* ---------- Barre latérale ---------- */
.lat { display: flex; flex-direction: column; gap: 22px; padding: 22px 14px 18px; background: var(--ink); color: var(--paper); overflow-y: auto; }
.lat-logo { padding: 2px 10px; }
.lat-logo img { display: block; height: 28px; width: auto; }
.lat-commerce { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; background: var(--ink-2); }
.lat-pastille { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--sun); color: var(--text); font-weight: 800; }
.lat-commerce b { display: block; font-size: .95rem; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 140px; }
.lat-commerce small { color: var(--on-ink); font-size: .78rem; }
.lat-nav { display: grid; gap: 2px; }
.lat-nav button, .lat-lien { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; border: 0; border-radius: 10px; background: none; color: var(--on-ink); font-weight: 600; text-align: left; text-decoration: none; transition: background .15s, color .15s; }
.lat-nav button svg, .lat-lien svg { width: 19px; height: 19px; flex: none; }
.lat-nav button:hover, .lat-lien:hover { background: var(--ink-2); color: var(--paper); }
.lat-nav button[aria-current="page"] { background: var(--paper); color: var(--text); }
.lat-lien { margin-top: -10px; }
.lat-bas { margin-top: auto; display: grid; gap: 14px; }
.lat-demo { padding: 12px; border-radius: 12px; background: rgba(255,225,94,.12); color: var(--on-ink); font-size: .82rem; }
.lat-demo b { display: block; color: var(--sun); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 4px; }
.lat-demo button { display: block; margin-top: 8px; padding: 0; border: 0; background: none; color: var(--paper); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.lat-raccourcis { color: rgba(245,244,240,.45); font-size: .75rem; padding: 0 4px; }
kbd { font: inherit; font-size: .7rem; padding: 1px 5px; border-radius: 4px; border: 1px solid rgba(245,244,240,.25); }

/* ---------- Contenu ---------- */
.centre { overflow-y: auto; padding: 0 36px 80px; scroll-padding-top: 110px; }
.barre { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 0 18px; margin-bottom: 8px; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.barre h1 { font-size: 1.75rem; letter-spacing: -.035em; line-height: 1.1; }
.etat { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: .84rem; font-weight: 600; color: var(--muted); }
.etat .point { width: 8px; height: 8px; border-radius: 50%; background: var(--vert); }
.etat[data-etat="brouillon"] { color: var(--text); }
.etat[data-etat="brouillon"] .point { background: var(--sun-2); box-shadow: 0 0 0 3px rgba(255,225,94,.35); }
.etat[data-etat="erreur"] { color: var(--rouge); }
.etat[data-etat="erreur"] .point { background: var(--rouge); }
.barre-actions { display: flex; align-items: center; gap: 8px; }
.recherche { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 999px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line-2); width: 220px; }
.recherche svg { width: 17px; height: 17px; color: var(--muted); flex: none; }
.recherche input { border: 0; outline: 0; background: none; width: 100%; }
.recherche:focus-within { box-shadow: inset 0 0 0 2px var(--text); }
@media (max-width: 1399.98px) { #annuler .txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } #annuler { padding: 0 12px; } }

.btn-sun, .btn-sec, .btn-danger { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 16px; border: 0; border-radius: 999px; font-weight: 700; white-space: nowrap; transition: background .15s, opacity .15s, transform .15s var(--ease-out); }
.btn-sun { background: var(--sun); color: var(--text); padding: 0 22px; }
.btn-sun:hover:not(:disabled) { background: var(--sun-2); }
.btn-sec { background: var(--card); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn-sec:hover:not(:disabled) { background: var(--sand); }
.btn-sec svg { width: 16px; height: 16px; }
.btn-danger { background: var(--rouge); color: #fff; }
.btn-sun:disabled, .btn-sec:disabled { opacity: .45; cursor: default; }
.btn-sun:active:not(:disabled), .btn-sec:active:not(:disabled) { transform: scale(.97); }

.aide { font-size: .88rem; color: var(--muted); margin: 14px 0 18px; max-width: 62ch; }
.outils { display: flex; align-items: center; gap: 24px; margin: 16px 0 18px; }
.outils .aide { margin: 0; }
.outils .recherche { flex: none; }
.barre h1 { white-space: nowrap; }
.aide b { color: var(--text); }
.vide { padding: 30px 0; color: var(--muted); }

/* ---------- Catégories ---------- */
.sect { margin-bottom: 22px; border-radius: 20px; background: var(--card); box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(42,35,0,.04); }
.sect-tete { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: start; padding: 16px 16px 12px 20px; border-bottom: 1px solid var(--line); }
.sect-titre { width: 100%; border: 0; border-radius: 8px; padding: 4px 8px; margin-left: -8px; background: none; font-size: 1.3rem; font-weight: 700; letter-spacing: -.025em; }
.sect-note { width: 100%; border: 0; border-radius: 8px; padding: 3px 8px; margin-left: -8px; background: none; color: var(--muted); font-size: .88rem; }
.sect-titre:hover, .sect-note:hover { background: var(--paper); }
.sect-titre:focus, .sect-note:focus { outline: 0; background: var(--paper); box-shadow: inset 0 0 0 2px var(--text); }
.sect-outils { grid-row: span 2; display: flex; gap: 2px; }
.sect-compte { font-size: .78rem; color: var(--muted); padding: 0 6px; align-self: center; white-space: nowrap; }

.ico-btn { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 9px; background: none; color: var(--muted); }
.ico-btn svg { width: 17px; height: 17px; }
.ico-btn:hover:not(:disabled) { background: var(--paper); color: var(--text); }
.ico-btn.danger:hover { color: var(--rouge); background: rgba(179,38,30,.08); }
.ico-btn:disabled { opacity: .3; cursor: default; }

/* ---------- Articles ---------- */
.art { border-bottom: 1px solid var(--line); }
.art:last-of-type { border-bottom: 0; }
.art-ligne { display: grid; grid-template-columns: 112px minmax(0, 1fr) 108px 40px; align-items: center; gap: 14px; padding: 10px 14px 10px 16px; }
.art.ouvert .art-ligne { background: rgba(255,225,94,.1); }
.art.trouve { animation: eclair 1.2s var(--ease-out); }
@keyframes eclair { from { background: rgba(255,225,94,.5); } }

.dispo { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px 0 6px; border: 0; border-radius: 999px; background: rgba(46,125,79,.1); color: var(--vert); font-size: .8rem; font-weight: 700; white-space: nowrap; transition: background .15s, color .15s; }
.dispo::before { content: ""; width: 18px; height: 18px; border-radius: 50%; background: var(--vert); box-shadow: inset 0 0 0 5px #fff; transition: background .15s; }
.dispo[aria-pressed="false"] { background: var(--sand); color: var(--muted); }
.dispo[aria-pressed="false"]::before { background: #B9B5A8; box-shadow: none; }
.dispo:hover { filter: brightness(.97); }

.art-resume { min-width: 0; border: 0; background: none; text-align: left; padding: 4px 0; display: grid; gap: 2px; }
.art-nom { font-weight: 700; font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.art-nom.manque { color: var(--rouge); font-style: italic; font-weight: 600; }
.art-desc { color: var(--muted); font-size: .84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.art-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.art-badges:empty { display: none; }
.badge { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 999px; background: var(--paper); font-size: .7rem; font-weight: 700; color: var(--muted); }
.badge.pop { background: var(--sun); color: var(--text); }
.badge.neuf { background: none; box-shadow: inset 0 0 0 1px var(--text); color: var(--text); }
.art.epuise .art-nom { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }

.prix { position: relative; display: flex; align-items: center; }
.prix input { width: 100%; height: 38px; padding: 0 28px 0 10px; border: 0; border-radius: 10px; background: var(--paper); text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.prix::after { content: "$"; position: absolute; right: 11px; color: var(--muted); font-weight: 600; pointer-events: none; }
.prix input:hover { box-shadow: inset 0 0 0 1px var(--line-2); }
.prix input:focus { outline: 0; background: #fff; box-shadow: inset 0 0 0 2px var(--text); }
.prix input[aria-invalid="true"] { box-shadow: inset 0 0 0 2px var(--rouge); color: var(--rouge); }
.prix.formats input { font-weight: 500; color: var(--muted); font-size: .84rem; text-align: center; padding: 0 8px; }
.prix.formats::after { content: none; }

.chevron svg { transition: transform .25s var(--ease-out); }
.art.ouvert .chevron svg { transform: rotate(180deg); }

/* Fiche d'édition d'un article */
.art-fiche { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px 26px; padding: 18px 20px 20px 142px; background: rgba(255,225,94,.06); border-top: 1px dashed var(--line-2); }
@media (max-width: 1399.98px) { .art-fiche { grid-template-columns: 1fr; padding-left: 20px; } }
.col { display: grid; gap: 14px; align-content: start; }
.champ { display: grid; gap: 6px; }
.champ > span, .sous-titre { font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.champ input, .champ textarea, .champ select, .fmt input { width: 100%; padding: 10px 12px; border: 0; border-radius: 10px; background: #fff; box-shadow: inset 0 0 0 1px var(--line-2); }
.champ textarea { resize: vertical; min-height: 66px; }
.champ input:focus, .champ textarea:focus, .champ select:focus, .fmt input:focus { outline: 0; box-shadow: inset 0 0 0 2px var(--text); }
.champ small { font-size: .78rem; color: var(--muted); }
.erreur { color: var(--rouge) !important; font-size: .82rem; font-weight: 600; }

.puces { display: flex; flex-wrap: wrap; gap: 6px; }
.puce { min-height: 32px; padding: 0 12px; border: 0; border-radius: 999px; background: #fff; box-shadow: inset 0 0 0 1px var(--line-2); font-size: .84rem; font-weight: 600; color: var(--muted); }
.puce[aria-pressed="true"] { background: var(--ink); color: var(--paper); box-shadow: none; }
.puce.sun[aria-pressed="true"] { background: var(--sun); color: var(--text); }

.fmts { display: grid; gap: 6px; }
.fmt { display: grid; grid-template-columns: minmax(0, 1fr) 96px 34px; gap: 6px; align-items: center; }
.fmt .prix input { background: #fff; box-shadow: inset 0 0 0 1px var(--line-2); }
.lien-btn { justify-self: start; padding: 4px 0; border: 0; background: none; font-weight: 700; font-size: .86rem; color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.fiche-actions { grid-column: 1 / -1; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.fiche-actions .espace { flex: 1; }
.fiche-actions select { height: 36px; padding: 0 10px; border-radius: 999px; border: 0; background: #fff; box-shadow: inset 0 0 0 1px var(--line-2); font-weight: 600; font-size: .86rem; }
.fiche-actions .btn-sec { min-height: 36px; padding: 0 14px; font-size: .86rem; }
.fiche-actions .btn-sec.danger { color: var(--rouge); }

.ajout { display: block; width: 100%; padding: 14px 20px; border: 0; border-top: 1px dashed var(--line-2); border-radius: 0 0 20px 20px; background: none; color: var(--muted); font-weight: 700; text-align: left; }
.ajout:hover { color: var(--text); background: var(--paper); }
.ajout-section { border: 2px dashed var(--line-2); border-radius: 20px; text-align: center; padding: 18px; }

/* ---------- Informations / étiquettes ---------- */
.carte { padding: 22px; border-radius: 20px; background: var(--card); box-shadow: 0 0 0 1px var(--line); }
.formulaire { display: grid; gap: 18px; max-width: 640px; margin-top: 20px; }
.etiq { display: grid; grid-template-columns: minmax(0, 1fr) auto 34px; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.etiq:last-child { border-bottom: 0; }
.etiq input { padding: 8px 10px; border: 0; border-radius: 8px; background: var(--paper); font-weight: 600; }
.etiq input:focus { outline: 0; box-shadow: inset 0 0 0 2px var(--text); }
.etiq small { color: var(--muted); font-size: .8rem; white-space: nowrap; }
#liste-etiquettes { max-width: 640px; }
.ajout-etiquette { display: flex; gap: 8px; max-width: 640px; margin-top: 14px; }
.ajout-etiquette input { flex: 1; padding: 0 14px; height: 40px; border: 0; border-radius: 999px; background: #fff; box-shadow: inset 0 0 0 1px var(--line-2); }
.ajout-etiquette input:focus { outline: 0; box-shadow: inset 0 0 0 2px var(--text); }

/* ---------- Apparence ---------- */
.logo-zone { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; }
.logo-apercu { display: grid; place-items: center start; min-height: 112px; padding: 18px 20px; border-radius: 14px; background: var(--ink); box-shadow: inset 0 0 0 1px var(--line); transition: background .2s; }
.logo-apercu img { display: block; max-width: 100%; max-height: 90px; width: auto; height: auto; }
.logo-apercu b { font-size: 1.6rem; letter-spacing: -.04em; line-height: 1.05; }
.logo-actions { display: grid; gap: 8px; }
.fichier { position: relative; cursor: pointer; }
.fichier input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.fichier:focus-within { outline: 3px solid var(--sun-2); outline-offset: 2px; }
.btn-sec.danger { color: var(--rouge); }
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.theme { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 8px; border: 0; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 1px var(--line-2); font-size: .84rem; font-weight: 600; text-align: left; }
.theme[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--text); }
.theme-apercu { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; box-shadow: inset 0 0 0 1px rgba(42,35,0,.15); }
.theme-apercu i { width: 14px; height: 14px; border-radius: 50%; }
.couleurs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.couleur { display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 8px; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 1px var(--line-2); cursor: pointer; }
.couleur input { width: 42px; height: 42px; padding: 0; border: 0; border-radius: 10px; background: none; cursor: pointer; }
.couleur input::-webkit-color-swatch-wrapper { padding: 0; }
.couleur input::-webkit-color-swatch { border: 0; border-radius: 10px; box-shadow: inset 0 0 0 1px rgba(42,35,0,.2); }
.couleur input::-moz-color-swatch { border: 0; border-radius: 10px; }
.couleur b { display: block; font-size: .9rem; }
.couleur small { font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- Aperçu ---------- */
.apercu { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 22px 24px; background: var(--sand); border-left: 1px solid var(--line); overflow: hidden; }
.apercu-titre { align-self: stretch; display: flex; align-items: center; gap: 8px; font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.direct { width: 8px; height: 8px; border-radius: 50%; background: #E5484D; box-shadow: 0 0 0 0 rgba(229,72,77,.5); animation: pouls 2s infinite; }
@keyframes pouls { 70% { box-shadow: 0 0 0 7px rgba(229,72,77,0); } 100% { box-shadow: 0 0 0 0 rgba(229,72,77,0); } }
.telephone { flex: 1; min-height: 0; width: 100%; max-width: 340px; max-height: 720px; padding: 10px; border-radius: 46px; background: #111; box-shadow: 0 30px 60px -20px rgba(42,35,0,.45), inset 0 0 0 2px #3A3A38; }
.telephone iframe { display: block; width: 100%; height: 100%; border: 0; border-radius: 37px; background: var(--ink); }
.apercu-note { font-size: .8rem; color: var(--muted); text-align: center; }

/* ---------- Modales et toast ---------- */
.modale { width: min(420px, calc(100% - 32px)); padding: 0; border: 0; border-radius: 24px; background: var(--paper); color: var(--text); box-shadow: 0 40px 80px -20px rgba(0,0,0,.4); }
.modale::backdrop { background: rgba(34,34,34,.55); backdrop-filter: blur(4px); }
.modale form { display: grid; gap: 14px; padding: 28px; }
.modale h2 { font-size: 1.4rem; letter-spacing: -.03em; }
.modale p { color: var(--muted); }
.modale img { height: 26px; width: auto; }
.modale-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 50; translate: -50% 20px; opacity: 0; pointer-events: none; padding: 12px 20px; border-radius: 999px; background: var(--ink); color: var(--paper); font-weight: 600; font-size: .9rem; box-shadow: 0 16px 40px -10px rgba(0,0,0,.35); transition: opacity .2s, translate .3s var(--ease-out); }
.toast.show { opacity: 1; translate: -50% 0; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
