img { max-width: 100%; height: auto; }
html, body { max-width: 100%; overflow-x: hidden; } /* filet anti-étirement (les règles de classe restent prioritaires) */
/* L'Heure Dorée — back-office */
.admin-corps { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; background: var(--lin); }
.admin-sidebar {
  background: var(--fumee);
  color: var(--lin);
  padding: 1.6rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.admin-sidebar .logo-admin { font-family: var(--display); font-size: 1.2rem; margin-bottom: 1.6rem; color: var(--miel); }
.admin-sidebar a {
  color: rgba(246, 239, 227, 0.8);
  text-decoration: none;
  padding: 0.55rem 0.8rem;
  border-radius: var(--rayon);
  font-size: 0.92rem;
}
.admin-sidebar a:hover { background: rgba(246, 239, 227, 0.08); color: var(--lin); }
.admin-sidebar a.actif { background: var(--or); color: var(--fumee); font-weight: 600; }
.admin-sidebar .deconnexion { margin-top: auto; color: rgba(246, 239, 227, 0.55); font-size: 0.85rem; }
.admin-main { padding: 2rem 2.4rem; }
.admin-main h1 { font-size: 1.7rem; margin-bottom: 1.4rem; }
.admin-main h2 { font-size: 1.2rem; margin: 2rem 0 0.9rem; }

.cartes-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; }
.carte-stat {
  background: #fff;
  border: 1px solid rgba(30, 23, 18, 0.1);
  border-radius: var(--rayon);
  padding: 1.1rem 1.2rem;
}
.carte-stat .valeur { font-family: var(--display); font-size: 1.7rem; }
.carte-stat .libelle { font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(30, 23, 18, 0.55); }
.carte-stat.alerte { border-color: var(--ambre); background: #FBF1E8; }

.tableau-admin { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--rayon); overflow: hidden; font-size: 0.9rem; }
.tableau-admin th { text-align: left; background: var(--fumee); color: var(--lin); padding: 0.7rem 0.9rem; font-size: 0.76rem; letter-spacing: 0.07em; text-transform: uppercase; }
.tableau-admin td { padding: 0.65rem 0.9rem; border-bottom: 1px solid rgba(30, 23, 18, 0.07); vertical-align: middle; }
.tableau-admin tr:hover td { background: var(--lin-2); }
.tableau-admin input[type="number"], .tableau-admin select {
  font-family: var(--texte);
  padding: 0.3rem 0.45rem;
  border: 1px solid rgba(30, 23, 18, 0.25);
  border-radius: 4px;
  font-size: 0.85rem;
}
.tableau-admin input[type="number"] { width: 74px; }

.statut { display: inline-block; padding: 0.18rem 0.65rem; border-radius: 999px; font-size: 0.76rem; letter-spacing: 0.03em; }
.statut--en_attente { background: #F4E3C1; color: #7A5A15; }
.statut--preparee   { background: #E2E8F0; color: #33445C; }
.statut--expediee   { background: #DDEBF7; color: #1E5B8A; }
.statut--livree     { background: #E1EEDD; color: #3B6B2E; }
.statut--annulee    { background: #F4D9D0; color: #8A3418; }

.graph-ca { display: flex; align-items: flex-end; gap: 6px; height: 140px; background: #fff; border: 1px solid rgba(30,23,18,0.1); border-radius: var(--rayon); padding: 1rem; }
.graph-ca .barre { flex: 1; background: linear-gradient(to top, var(--ambre), var(--or)); border-radius: 3px 3px 0 0; min-height: 2px; position: relative; }
.graph-ca .barre span {
  position: absolute; bottom: -1.4rem; left: 50%; transform: translateX(-50%);
  font-size: 0.62rem; color: rgba(30,23,18,0.5); white-space: nowrap;
}
.graph-ca-legende { margin-bottom: 2rem; }

.bouton-mini { font-size: 0.76rem; padding: 0.32rem 0.8rem; }
.admin-actions { display: flex; gap: 0.8rem; align-items: center; flex-wrap: wrap; margin-bottom: 1.2rem; }

.login-page { min-height: 100vh; display: grid; place-items: center; background: var(--fumee); }
.login-boite { background: var(--lin); border-radius: var(--rayon); padding: 2.4rem; width: min(380px, 92%); }
.login-boite h1 { font-size: 1.4rem; margin-bottom: 1.4rem; }
.login-boite .champ input { max-width: none; }

@media (max-width: 860px) {
  .admin-corps { grid-template-columns: 1fr; }
  .admin-sidebar { flex-direction: row; flex-wrap: nowrap; align-items: center; overflow-x: auto; -webkit-overflow-scrolling: touch; gap: 0.15rem; scrollbar-width: thin; }
  .admin-sidebar .logo-admin { margin: 0 0.9rem 0 0; flex: 0 0 auto; white-space: nowrap; }
  .admin-sidebar .logo-admin small { display: none; }
  .admin-sidebar a { flex: 0 0 auto; white-space: nowrap; padding: 0.45rem 0.7rem; font-size: 0.85rem; }
  .admin-sidebar .deconnexion { margin-top: 0; margin-left: 0.6rem; flex: 0 0 auto; }
  .admin-main { padding: 1.4rem 1rem; }
  /* Cause du dézoom mobile : une cellule de grille refuse par défaut de devenir
     plus étroite que son contenu (min-width:auto). Le tableau large poussait donc
     toute la page au lieu de défiler dans son cadre. */
  .admin-corps, .admin-corps > *, .admin-main { min-width: 0; }
  .admin-main { max-width: 100%; overflow-x: hidden; }
  .tableau-admin { display: block; width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tableau-admin thead, .tableau-admin tbody { display: table; width: 100%; min-width: 620px; }
  .tableau-admin th, .tableau-admin td { white-space: nowrap; }
  .tableau-admin td .recette-txt, .tableau-admin td small { white-space: normal; }
  /* Studio couleurs : les deux colonnes se superposent au lieu de se serrer */
  .studio-colonnes { grid-template-columns: 1fr !important; }
}
#masqueCanvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 4; opacity: 0; transition: opacity 200ms ease; }
/* Pendant le détourage, la zone peinte s'entrevoit pour guider la main */
.studio-peinture #masqueCanvas { opacity: 0.35; }
.voyant-stock { color: #FF7A2F; animation: voyant-pulse 1.4s ease-in-out infinite; font-size: 0.9em; }
@keyframes voyant-pulse { 0%,100% { opacity: 0.5; text-shadow: none; } 50% { opacity: 1; text-shadow: 0 0 8px #FF7A2F; } }
.ligne-attributs td { background: #FBF7EF; padding: 0.4rem 0.9rem; }
.ligne-attributs summary { cursor: pointer; font-size: 0.85rem; color: rgba(30,23,18,0.65); }
.attributs-grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0.8rem 1.2rem; margin-top: 0.7rem; }
.attributs-grille label { display: block; font-size: 0.82rem; }
.attributs-grille input[type="text"], .attributs-grille input[type="number"], .attributs-grille select { width: 100%; margin-top: 0.25rem; }
.attributs-grille small { color: rgba(30,23,18,0.5); }
.attributs-perso { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem 0.8rem; margin-top: 0.5rem; }
.variante-saisie { display: flex; gap: 0.7rem; align-items: flex-end; flex-wrap: wrap; margin-top: 0.7rem; }
.variante-saisie label { font-size: 0.8rem; display: block; }
.variante-saisie select, .variante-saisie input { display: block; margin-top: 0.25rem; }
.visibilite-form { margin-top: 0.5rem; font-size: 0.78rem; display: flex; flex-wrap: wrap; gap: 0.4rem 0.8rem; align-items: center; }
.visibilite-form input[type="checkbox"] { width: auto; margin-right: 0.25rem; }
.pastille-hors-ligne { background: rgba(30,23,18,0.12); border-radius: 999px; padding: 0.1rem 0.55rem; font-size: 0.7rem; letter-spacing: 0.04em; }
.mini-scene { position: relative; display: block; width: 84px; aspect-ratio: 4 / 3; border-radius: 5px; overflow: hidden; border: 1px solid rgba(30,23,18,0.15); flex: 0 0 auto; }
.mini-scene img { display: block; width: 100%; height: 100%; object-fit: cover; }
.mini-voile { position: absolute; inset: 0; pointer-events: none; }
@media (max-width: 860px) {
  .tableau-admin td:first-child { min-width: 230px; }
  .visibilite-form { flex-wrap: nowrap; gap: 0.35rem 0.6rem; }
  .visibilite-form label { white-space: nowrap; }
}
