/* GUS' - Espace bêta : charte (couleurs en haut, modifiables) */
:root {
  --terra: #A8402F;
  --terra-fonce: #8A3325;
  --creme: #F7F1E8;
  --sable: #EADFCD;
  --sable-fonce: #D9C9B0;
  --blanc: #FFFDF9;
  --encre: #2B2420;
  --gris: #7A6E64;
  --vert: #4F7A55;
  --ocre: #B7862D;
  --titre: 'Bodoni Moda', 'Didot', Georgia, serif;
  --texte: 'Jost', system-ui, sans-serif;
  --rayon: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--creme); color: var(--encre); font: 400 16px/1.55 var(--texte); }
a { color: var(--terra); }
h1, h2 { font-family: var(--titre); font-weight: 500; line-height: 1.15; margin: 0 0 .4em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
h2 { font-size: 1.35rem; }
small { color: var(--gris); font-weight: 400; }
.aide { color: var(--gris); margin: 0 0 1rem; }

/* Barre du haut */
.barre { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .8rem clamp(16px, 4vw, 48px); background: rgba(247,241,232,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--sable-fonce); }
.barre nav { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; justify-content: flex-end; }
.barre nav form { margin: 0; }
.marque { font-family: var(--titre); font-size: 1.6rem; font-weight: 600; color: var(--encre); text-decoration: none; letter-spacing: .02em; }
.marque span { color: var(--terra); }
.marque em { font-family: var(--texte); font-style: normal; font-size: .78rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--gris); margin-left: .35rem; }
.marque.grande { font-size: 3rem; margin: 0 0 .6rem; text-align: center; }
.role { font-size: .85rem; color: var(--gris); }

main { max-width: 1180px; margin: 0 auto; padding: clamp(20px, 4vw, 44px) clamp(16px, 4vw, 48px) 80px; }
body.seul main { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; }
body.seul .flash { width: min(440px, 100%); margin: 0; }

/* Boutons */
.btn { display: inline-flex; align-items: center; gap: .35rem; padding: .55rem 1rem; border-radius: 999px; border: 1px solid var(--terra);
  background: transparent; color: var(--terra); font: 500 .92rem var(--texte); text-decoration: none; cursor: pointer; white-space: nowrap; justify-content: center; }
.btn:hover { background: rgba(168,64,47,.08); }
.btn.plein { background: var(--terra); color: #fff; }
.btn.plein:hover { background: var(--terra-fonce); }
.lien { background: none; border: 0; padding: 0; color: var(--encre); font: 500 .92rem var(--texte); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.lien.rouge { color: var(--terra); }

/* Messages */
.flash { padding: .8rem 1rem; border-radius: 10px; margin-bottom: 1.2rem; background: #E7EFE5; color: #2E4D33; border: 1px solid #C7D9C3; }
.flash.err { background: #F6E1DC; color: var(--terra-fonce); border-color: #E9BFB5; }

/* Connexion / installation */
.boite { width: min(440px, 100%); background: var(--blanc); border: 1px solid var(--sable-fonce); border-radius: 20px; padding: 2.2rem 2rem; text-align: left; }
.boite h1 { text-align: center; font-size: 1.8rem; }
.boite .aide { text-align: center; }
.pile { display: grid; gap: 1rem; }
.retour-site { text-align: center; margin: 1.4rem 0 0; font-size: .9rem; }

/* Formulaires */
label { display: grid; gap: .35rem; font-weight: 500; font-size: .95rem; }
input[type=text], input[type=password], input:not([type]), select, textarea {
  width: 100%; padding: .7rem .85rem; border: 1px solid var(--sable-fonce); border-radius: 10px; background: var(--blanc);
  font: 400 1rem var(--texte); color: var(--encre); }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(168,64,47,.35); border-color: var(--terra); }
.formulaire { display: grid; gap: 1.1rem; max-width: 760px; }
.deux { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.case { display: flex; gap: .7rem; align-items: flex-start; font-weight: 400; background: var(--blanc); border: 1px solid var(--sable-fonce); border-radius: 10px; padding: .8rem .9rem; }
.case input { margin-top: .3rem; accent-color: var(--terra); }
.ligne-btn { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.danger { margin-top: 2.5rem; padding-top: 1.2rem; border-top: 1px solid var(--sable-fonce); max-width: 760px; }
.fil { font-size: .88rem; color: var(--gris); margin: 0 0 .6rem; }
.fil a { color: var(--gris); }

/* Zone de dépôt */
.depot { position: relative; display: block; border: 1.5px dashed var(--sable-fonce); border-radius: 12px; padding: .75rem 1rem; text-align: center;
  font-weight: 400; font-size: .88rem; color: var(--gris); cursor: pointer; transition: background .15s, border-color .15s; }
.depot.grand { padding: 2rem 1rem; font-size: 1rem; background: var(--blanc); }
.depot input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.depot:hover, .depot.survol, [data-cible-depot].survol .depot { border-color: var(--terra); background: rgba(168,64,47,.06); color: var(--terra); }
.depot.envoi { border-style: solid; border-color: var(--terra); color: var(--terra); }

/* Tableau de bord */
.entete-page { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.6rem; }
.filtres { display: flex; gap: .4rem; flex-wrap: wrap; }
.filtres button { border: 1px solid var(--sable-fonce); background: var(--blanc); border-radius: 999px; padding: .4rem .85rem; font: 500 .85rem var(--texte); color: var(--encre); cursor: pointer; }
.filtres button.actif { background: var(--encre); border-color: var(--encre); color: var(--creme); }
.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.2rem; }
.carte { display: flex; flex-direction: column; gap: .5rem; background: var(--blanc); border: 1px solid var(--sable-fonce); border-radius: var(--rayon); padding: 1.3rem 1.3rem 1.1rem; transition: box-shadow .15s, border-color .15s; }
.carte:hover { box-shadow: 0 10px 30px -18px rgba(43,36,32,.35); }
.carte.survol { border-color: var(--terra); }
.carte[hidden] { display: none; }
.carte h2 { margin: .2rem 0 0; }
.carte-haut { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.cat { font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--gris); font-weight: 500; }
.statut { font-size: .76rem; font-weight: 500; padding: .18rem .6rem; border-radius: 999px; }
.s-brouillon { background: var(--sable); color: var(--gris); }
.s-beta { background: #F4E6CC; color: #7A5718; }
.s-pret { background: #E1ECDF; color: var(--vert); }
.maison { margin: 0; font-family: var(--titre); font-style: italic; color: var(--terra); }
.desc { margin: .2rem 0 0; font-size: .94rem; }
.meta { margin: auto 0 0; padding-top: .5rem; font-size: .8rem; color: var(--gris); }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-top: .3rem; }
.maj { margin: .4rem 0 0; }

.menu { position: relative; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu-liste { position: absolute; z-index: 3; top: calc(100% + 6px); left: 0; min-width: 220px; background: var(--blanc); border: 1px solid var(--sable-fonce); border-radius: 12px; padding: .35rem; box-shadow: 0 14px 30px -16px rgba(43,36,32,.4); }
.menu-liste a { display: block; padding: .55rem .75rem; border-radius: 8px; color: var(--encre); text-decoration: none; font-size: .92rem; }
.menu-liste a:hover { background: var(--creme); }

.vide-grand { text-align: center; padding: 4rem 1rem; border: 1.5px dashed var(--sable-fonce); border-radius: var(--rayon); color: var(--gris); }

/* Tableaux, réglages */
.bloc { background: var(--blanc); border: 1px solid var(--sable-fonce); border-radius: var(--rayon); padding: 1.4rem; margin-bottom: 1.2rem; }
.tableau { width: 100%; border-collapse: collapse; font-size: .93rem; margin-bottom: 1rem; background: var(--blanc); border-radius: 10px; overflow: hidden; }
.tableau th, .tableau td { text-align: left; padding: .65rem .8rem; border-bottom: 1px solid var(--sable); vertical-align: middle; }
.tableau th { font-weight: 500; color: var(--gris); font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; }
.tableau form { margin: 0; }
.tableau .actuelle td { font-weight: 500; }
.tableau .vide { color: var(--gris); }
.jauge { height: 10px; background: var(--sable); border-radius: 99px; overflow: hidden; margin: .4rem 0 .6rem; }
.jauge span { display: block; height: 100%; background: var(--terra); }

/* Éditeur de code */
.editeur { display: grid; gap: 1rem; }
.editeur textarea { min-height: 65vh; font: 13px/1.5 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; tab-size: 2; white-space: pre; background: #FFFEFB; }

/* Fenêtre QR code */
dialog { border: 0; border-radius: 20px; padding: 1.8rem; width: min(380px, calc(100% - 32px)); background: var(--blanc); color: var(--encre); text-align: center; }
dialog::backdrop { background: rgba(43,36,32,.45); }
#qr-image { display: grid; place-items: center; padding: 1rem; background: #fff; border-radius: 12px; border: 1px solid var(--sable); margin: .8rem 0; }
#qr-lien { word-break: break-all; font-size: .85rem; }
dialog .ligne-btn { justify-content: center; }

@media (max-width: 560px) {
  .barre { flex-direction: column; align-items: flex-start; }
  .grille { grid-template-columns: 1fr; }
  .boite { padding: 1.8rem 1.3rem; }
}
