/* Gestionnaire Création La Vie — mêmes couleurs que le site (papier, encre, flamme) */
:root {
  --papier: #f6efe1; --papier-2: #efe5d1; --blanc: #fffdf8;
  --encre: #1b2340; --encre-2: #2a3358; --muted: #6b6a72; --ligne: #e2d7c2;  --flamme: #e0542a; --flamme-fonce: #b83d17; --flamme-soft: #fde9df; --cire: #f4c869; --cire-soft: #fdf3d9;
  --vert: #2f7d4f; --vert-soft: #e6f3ea; --bleu: #1e3f94; --bleu-soft: #e7ecf8; --rouge: #b42318; --rouge-soft: #fdecec;
  --gris-soft: #ece8df; --nuit: #0f1220;
  --serif: "Fraunces", Georgia, serif; --sans: "Public Sans", system-ui, sans-serif;
  --r: 10px; --tap: 44px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--papier); color: var(--encre); font: 15px/1.5 var(--sans); -webkit-text-size-adjust: 100%; }
a { color: var(--bleu); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.icon { width: 1.1em; height: 1.1em; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; vertical-align: -.17em; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.right { text-align: right; }

/* Structure */
.layout { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--nuit); color: #d9d4c8; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
  background-image: radial-gradient(circle at 30% 0%, rgba(224,84,42,.22), transparent 55%); }
.brand { display: flex; gap: 10px; align-items: center; padding: 18px 16px; border-bottom: 1px solid #262b40; }
.brand img { width: 46px; height: auto; background: var(--papier); border-radius: 8px; padding: 3px; }
.brand b { font: 600 1.05rem/1.1 var(--serif); color: #fff; display: block; }
.brand small { color: #9a96a6; font-size: .75rem; }
.side nav { padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.side nav a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 8px; color: #d9d4c8; text-decoration: none; font-weight: 500; }
.side nav a:hover { background: #1d2236; color: #fff; }
.side nav a.actif { background: var(--flamme); color: #fff; }
.side nav a .nb { margin-left: auto; background: var(--cire); color: var(--encre); font: 700 .72rem/1 var(--sans); padding: 3px 7px; border-radius: 10px; }
.side nav .sep { height: 1px; background: #262b40; margin: 8px 6px; }
.side nav a.site { color: #9a96a6; }
.moi { padding: 12px 16px; border-top: 1px solid #262b40; font-size: .85rem; display: flex; align-items: center; gap: 10px; }
.moi .av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--cire); color: var(--encre); font-weight: 700; font-size: .78rem; }
.moi button { margin-left: auto; background: none; border: 1px solid #3a3f58; color: #d9d4c8; border-radius: 6px; padding: 5px 8px; cursor: pointer; font-size: .78rem; }
main { min-width: 0; }
.haut { display: flex; align-items: center; gap: 12px; padding: 18px 28px 6px; }
.haut h1 { font: 600 1.7rem/1.15 var(--serif); margin: 0; flex: 1; }
.contenu { padding: 14px 28px 60px; max-width: 1180px; }
.demo-bandeau { background: var(--cire-soft); border: 1px dashed #d9b24a; color: #6b5310; border-radius: var(--r); padding: 10px 14px; font-size: .88rem; margin-bottom: 16px; }
.demo-bandeau b { color: #4d3b07; }

/* Boutons, champs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 8px 14px; border-radius: 8px;
  border: 1.5px solid var(--encre); background: var(--blanc); color: var(--encre); font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--papier-2); }
.btn.flamme { background: var(--flamme); border-color: var(--flamme); color: #fff; }
.btn.flamme:hover { background: var(--flamme-fonce); border-color: var(--flamme-fonce); }
.btn.encre { background: var(--encre); color: #fff; }
.btn.leger { border-color: var(--ligne); }
.btn.danger { color: var(--rouge); border-color: #e6b4ae; }
.btn.petit { min-height: 32px; padding: 4px 10px; font-size: .85rem; }
.btn:disabled { opacity: .5; cursor: default; }
.field { margin-bottom: 12px; }
.field label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: 4px; }
.field .aide { font-size: .8rem; color: var(--muted); margin-top: 3px; }
.in { width: 100%; min-height: var(--tap); padding: 9px 11px; border: 1.5px solid var(--ligne); border-radius: 8px; background: #fff; }
.in:focus { outline: none; border-color: var(--flamme); box-shadow: 0 0 0 3px rgba(224,84,42,.15); }
textarea.in { min-height: 90px; resize: vertical; }
.deux { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.trois { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.coche { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.coche input { width: 20px; height: 20px; accent-color: var(--flamme); }
.onglets { display: flex; gap: 4px; margin: 0 0 12px; border-bottom: 1.5px solid var(--ligne); }
.onglets button { border: 0; background: none; padding: 8px 14px; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1.5px; cursor: pointer; }
.onglets button.actif { color: var(--encre); border-bottom-color: var(--flamme); }

/* Cartes, tableaux */
.cartes { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 20px; }
.carte { background: var(--blanc); border: 1.5px solid var(--ligne); border-radius: var(--r); padding: 16px; }
.carte h3 { margin: 0 0 10px; font: 600 1.1rem var(--serif); display: flex; align-items: center; gap: 8px; }
.chiffre { font: 600 2rem/1.1 var(--serif); }
.chiffre small { font: 500 .85rem var(--sans); color: var(--muted); display: block; margin-top: 4px; }
.carte.alerte { border-color: var(--flamme); background: var(--flamme-soft); }
a.carte { text-decoration: none; color: inherit; display: block; }
a.carte:hover { border-color: var(--encre); }
.liste { background: var(--blanc); border: 1.5px solid var(--ligne); border-radius: var(--r); overflow: hidden; }
.liste table { width: 100%; border-collapse: collapse; }
.liste th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 14px; background: var(--papier-2); }
.liste td { padding: 12px 14px; border-top: 1px solid var(--ligne); vertical-align: middle; }
.liste tr.clic { cursor: pointer; }
.liste tr.clic:hover td { background: #fff8ec; }
.vide { padding: 30px; text-align: center; color: var(--muted); }
.filtres { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.filtres button { border: 1.5px solid var(--ligne); background: var(--blanc); border-radius: 20px; padding: 6px 13px; font-weight: 600; font-size: .87rem; cursor: pointer; }
.filtres button.actif { background: var(--encre); border-color: var(--encre); color: #fff; }
.filtres .in { max-width: 260px; min-height: 36px; margin-left: auto; }

.puce { display: inline-block; padding: 3px 9px; border-radius: 12px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.puce.payee { background: var(--flamme-soft); color: var(--flamme-fonce); }
.puce.preparation { background: var(--cire-soft); color: #7a5a06; }
.puce.expediee { background: var(--bleu-soft); color: var(--bleu); }
.puce.livree { background: var(--vert-soft); color: var(--vert); }
.puce.attente_paiement { background: var(--gris-soft); color: var(--muted); font-style: italic; }
.puce.annulee { background: var(--gris-soft); color: var(--muted); }
.puce.a_appeler, .puce.attente_interac { background: #f3e8fd; color: #6a2ca0; }
.puce.site { background: var(--encre); color: #fff; }

/* Produits */
.grille-prod { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.prod { background: var(--blanc); border: 1.5px solid var(--ligne); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; }
.prod.cache { opacity: .6; }
.prod .ph { aspect-ratio: 4 / 3; background: var(--papier-2); position: relative; }
.prod .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.prod .ph .puce { position: absolute; top: 8px; left: 8px; }
.prod .corps { padding: 12px 14px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.prod h4 { margin: 0; font-size: 1rem; }
.prod .ligne { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .9rem; }
.prod .stock { font-weight: 700; }
.prod .stock.bas { color: var(--flamme-fonce); }
.prod .stock.zero { color: var(--rouge); }
.prod .actions { display: flex; gap: 6px; margin-top: auto; padding-top: 6px; align-items: center; }
.prod .actions .fl { padding: 4px 7px; min-width: 0; }
.liste td.date { white-space: nowrap; }
.photo-choix { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.photo-choix img { width: 110px; height: 82px; object-fit: cover; border-radius: 8px; border: 1.5px solid var(--ligne); }

/* Commande */
.cmd-grille { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; }
.lignes-cmd { list-style: none; margin: 0; padding: 0; }
.lignes-cmd li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--ligne); }
.lignes-cmd img { width: 46px; height: 46px; object-fit: cover; border-radius: 6px; }
.lignes-cmd .q { font-weight: 700; min-width: 34px; }
.lignes-cmd .n { flex: 1; }
.totaux div { display: flex; justify-content: space-between; padding: 3px 0; }
.totaux .tot { font-weight: 800; font-size: 1.1rem; border-top: 1.5px solid var(--encre); margin-top: 6px; padding-top: 8px; }
.connexion { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 8px; background: var(--papier); margin-top: 8px; font-size: .88rem; }
.connexion .icon { margin-top: 2px; }
.connexion b { display: block; }
.hist { list-style: none; margin: 0; padding: 0; font-size: .87rem; }
.hist li { padding: 6px 0 6px 16px; border-left: 2px solid var(--ligne); position: relative; }
.hist li::before { content: ""; position: absolute; left: -6px; top: 11px; width: 10px; height: 10px; border-radius: 50%; background: var(--flamme); }
.hist time { color: var(--muted); display: block; font-size: .78rem; }
.transp { display: flex; flex-direction: column; gap: 8px; }
.transp label { display: flex; gap: 10px; align-items: center; border: 1.5px solid var(--ligne); border-radius: 8px; padding: 10px 12px; cursor: pointer; }
.transp label:has(input:checked) { border-color: var(--flamme); background: var(--flamme-soft); }
.transp input { accent-color: var(--flamme); width: 18px; height: 18px; }
.transp .px { margin-left: auto; font-weight: 800; }
.adresse { white-space: pre-line; }

/* Intégrations */
.integ { display: flex; gap: 14px; align-items: flex-start; }
.integ .logo { width: 46px; height: 46px; border-radius: 10px; display: grid; place-items: center; font: 800 1rem var(--sans); color: #fff; flex-shrink: 0; }
.integ p { margin: 4px 0 0; font-size: .9rem; color: var(--muted); }
.etat { font-size: .78rem; font-weight: 700; padding: 3px 9px; border-radius: 12px; background: var(--cire-soft); color: #7a5a06; display: inline-block; margin-top: 6px; }

/* Fenêtres, messages */
.fond { position: fixed; inset: 0; background: rgba(15,18,32,.55); display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; z-index: 50; overflow-y: auto; }
.fen { background: var(--blanc); border-radius: 14px; width: min(560px, 100%); box-shadow: 0 24px 60px rgba(0,0,0,.35); }
.fen.large { width: min(940px, 100%); }
.fen-h { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--ligne); }
.fen-h h3 { margin: 0; flex: 1; font: 600 1.25rem var(--serif); }
.fen-b { padding: 18px 20px; }
.fen-p { padding: 14px 20px; border-top: 1px solid var(--ligne); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.x { border: 0; background: none; cursor: pointer; padding: 6px; border-radius: 6px; }
.x:hover { background: var(--papier-2); }
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--encre); color: #fff; padding: 11px 18px; border-radius: 10px; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.toast.err { background: var(--rouge); }
.nav-bas { display: none; }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .side { display: none; }
  .haut { padding: 14px 16px 4px; }
  .haut h1 { font-size: 1.4rem; }
  .contenu { padding: 10px 16px 96px; }
  .cmd-grille, .deux { grid-template-columns: 1fr; }
  .trois { grid-template-columns: 1fr 1fr; }
  .liste .cache-cell { display: none; }
  .liste td, .liste th { padding: 10px; }
  .filtres .in { max-width: none; margin-left: 0; flex-basis: 100%; }
  .nav-bas { display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: var(--nuit); z-index: 40; padding-bottom: env(safe-area-inset-bottom); }
  .nav-bas a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 2px 8px; color: #b9b4a8; text-decoration: none; font-size: .7rem; font-weight: 600; position: relative; }
  .nav-bas a .icon { width: 1.35em; height: 1.35em; }
  .nav-bas a.actif { color: var(--cire); }
  .nav-bas a .nb { position: absolute; top: 4px; right: calc(50% - 20px); background: var(--flamme); color: #fff; font-size: .65rem; padding: 1px 5px; border-radius: 8px; }
  .fond { padding: 0; align-items: flex-end; }
  .fen, .fen.large { border-radius: 14px 14px 0 0; max-height: 94vh; overflow-y: auto; }
}
