body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial;
  background: #f2f2f7;
  margin: 0;
  padding: 20px;

  display: flex;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

/* Container */
.container {
  width: 100%;
  max-width: 520px;

  display: flex;
  flex-direction: column;
  align-items: center;
}

h2 { text-align: center; }

form {
  background: white;
  padding: 10px;
  border-radius: 10px;
  margin-bottom: 10px;
}

/* Inputs */
input, button {
  width: 100%;
  padding: 14px;
  margin: 6px 0;
  border-radius: 12px;

  border: none;
  outline: none;

  font-size: 16px;
  box-sizing: border-box;

  transition: all 0.2s ease;
}

/* Input style */
input {
  background: white;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

input:focus {
  transform: scale(1.01);
  box-shadow: 0 4px 18px rgba(0,0,0,0.08);
}

/* Button style */
button {
    background: #00c853;
    color: white;
    font-weight: bold;
}

button:hover {
  transform: translateY(-1px);
}

button:active {
  transform: scale(0.98);
}

.menu{
  display: flex;
  flex-direction: row;
  width: 100%;
}
.taille{
  width: 50%;
  margin:5px;
}

.scan {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 500px; /* ou 80% de l'écran */
  margin: 0 auto;   /* centre horizontalement */
  gap: 10px;
}

#scanner {
  width: 80%;         /* 80% du parent */
  max-width: 500px;   /* optionnel pour limiter */
  height: 160px;
  max-height: 160px;
  background-color: black;
  display: flex;
  justify-content: center;
  align-items: center;
   flex-direction: column; /* ✅ IMPORTANT */
  position: relative;     /* 🔥 clé pour overlay */
}

/* vidéo / canvas */
#scanner video,
#scanner canvas {
  position: absolute;  /* 🔥 superposition */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#scanner::after {
  content: "";
  position: absolute;
  border: 2px solid red;
  width: 80%;
  height: 60%;
  top: 20%;
  left: 10%;
  pointer-events: none;
}

/* 📱 MOBILE */
@media (max-width: 768px) {
  #scanner {
    width: 80%;  /* garde proportion fixe */
    max-width: 300px;
  }
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

td, th {
  padding: 8px;
  border-bottom: 1px solid #ddd;
}

.actions button {
  width: auto;
  margin: 2px;
  padding: 5px;
}

.error {
  color: red;
  font-weight: bold;
}