:root {
  --jaune: #efdf00; --bleu: #111B9C; --noir: #141414; --gris: #f3f3f3;
  --texte-gris: #626262; --rouge: #c92a2a; --vert: #2f9e44;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--gris); color: var(--noir);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.ecran[hidden] { display: none; }

/* --- connexion --- */
.carte--connexion {
  max-width: 400px; margin: 12vh auto; background: #fff; padding: 32px 28px;
  border-radius: 8px; box-shadow: 0 2px 14px rgba(0,0,0,.09);
}
.carte--connexion h1 { font-size: 1.3rem; margin: 0 0 .2em; }
label { display: block; margin-bottom: 16px; font-size: .86rem; font-weight: 600; color: var(--texte-gris); }
input, select, textarea {
  display: block; width: 100%; margin-top: 5px; padding: 11px 12px; font: inherit;
  border: 1px solid #ccc; border-radius: 5px; background: #fff; color: var(--noir);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--jaune); outline-offset: 1px; }
textarea { min-height: 80px; resize: vertical; }

/* --- boutons --- */
.bouton {
  font: inherit; font-weight: 600; border: 0; border-radius: 5px; padding: 11px 20px;
  cursor: pointer; background: #e6e6e6; color: var(--noir);
}
.bouton--plein { background: var(--bleu); color: #fff; width: 100%; }
.bouton--jaune { background: var(--jaune); }
.bouton--creux { background: transparent; border: 2px solid var(--bleu); color: var(--bleu); }
.bouton--discret { background: transparent; color: var(--texte-gris); }
.bouton--danger { background: transparent; color: var(--rouge); border: 2px solid var(--rouge); }
.bouton:disabled { opacity: .5; cursor: default; }

/* --- barre et onglets --- */
.barre {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--bleu); color: #fff; padding: 12px 16px; position: sticky; top: 0; z-index: 5;
}
.barre-actions { display: flex; gap: 8px; }
.barre .bouton--discret { color: #fff; }
.onglets { display: flex; background: #fff; border-bottom: 1px solid #ddd; position: sticky; top: 56px; z-index: 4; }
.onglet {
  flex: 1; padding: 13px 8px; background: none; border: 0; border-bottom: 3px solid transparent;
  font: inherit; font-weight: 600; color: var(--texte-gris); cursor: pointer;
}
.onglet.actif { color: var(--noir); border-bottom-color: var(--jaune); }

.contenu { max-width: 900px; margin: 0 auto; padding: 18px 14px 60px; }
.entete-liste { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.entete-liste .bouton { width: auto; white-space: nowrap; margin-left: auto; }
.aide { color: var(--texte-gris); font-size: .88rem; margin: 0; }
.erreur { color: var(--rouge); font-size: .9rem; margin: 0 0 12px; }

/* --- liste --- */
.liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.element {
  display: flex; gap: 14px; align-items: center; background: #fff; border-radius: 7px;
  padding: 10px; cursor: pointer; border: 0; width: 100%; text-align: left; font: inherit;
}
.element:hover { box-shadow: 0 1px 8px rgba(0,0,0,.1); }
.element-photo {
  width: 84px; height: 62px; object-fit: cover; border-radius: 4px; background: #e4e4e4;
  flex: 0 0 auto;
}
.element-vide {
  width: 84px; height: 62px; border-radius: 4px; background: #ececec; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center; color: #999; font-size: .7rem;
}
.element-texte { min-width: 0; }
.element-nom { font-weight: 600; display: block; }
.element-detail { color: var(--texte-gris); font-size: .86rem; }
.etiquette {
  display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; padding: 2px 8px; border-radius: 3px; margin-left: 8px;
}
.etiquette--brouillon { background: #fff3bf; color: #8a6d00; }
.etiquette--disponible { background: #e7f5e9; color: var(--vert); }
.etiquette--reserve { background: #e7f0ff; color: var(--bleu); }
.etiquette--vendu { background: #eee; color: #777; }

/* --- fiche --- */
dialog {
  width: min(680px, 96vw); max-height: 92vh; border: 0; border-radius: 9px; padding: 0;
  overflow: auto; margin: auto;
}
dialog::backdrop { background: rgba(0,0,0,.6); }
.fiche-entete {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid #e5e5e5; position: sticky; top: 0; background: #fff;
}
.fiche-entete h2 { margin: 0; font-size: 1.05rem; }
.fiche-corps, .fiche-photos { padding: 18px 20px 4px; }
.fiche-photos { border-top: 1px solid #eee; }
.fiche-photos h3 { font-size: .9rem; margin: 0 0 10px; }
.photos { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.photo { position: relative; }
.photo img { width: 104px; height: 78px; object-fit: cover; border-radius: 5px; display: block; }
.photo button {
  position: absolute; top: -7px; right: -7px; width: 24px; height: 24px; border-radius: 50%;
  border: 0; background: var(--rouge); color: #fff; cursor: pointer; font-size: 15px; line-height: 1;
}
.fichier { display: inline-block; text-align: center; }
.fiche-pied {
  display: flex; gap: 10px; padding: 16px 20px; border-top: 1px solid #e5e5e5;
  position: sticky; bottom: 0; background: #fff;
}
.fiche-pied .bouton--plein { margin-left: auto; width: auto; }
.bandeau { padding: 12px 14px; border-radius: 6px; margin-bottom: 14px; font-size: .92rem; }
.bandeau--ok { background: #e7f5e9; border-left: 4px solid var(--vert); }
.bandeau--erreur { background: #fdecec; border-left: 4px solid var(--rouge); }
.bandeau--attente { background: #fff9dd; border-left: 4px solid var(--jaune); }
@media (max-width: 560px) {
  .fiche-corps, .fiche-photos { padding: 14px 15px 4px; }
  .contenu { padding: 14px 10px 50px; }
}
