/* ----- GLOBAL ----- */

body {
  font-family: 'Inter', sans-serif;
  background-color: #fff;
  color: #111;
  margin: 0;
  padding: 0;
  display: flex;
  height: auto;
  min-height: 100vh;
  overflow: hidden; /* ← empêche le scroll global */
}

/* ----- SIDEBAR ----- */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0; /* ← permet un scroll interne */
  overflow-y: auto; /* ← active le scroll si contenu trop grand */


  width: 180px;
  background-color: #000;
  color: white;
  padding: 2rem 1rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  z-index: 9998;
  transition: left 0.3s ease;
}

.sidebar h1 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 2rem;
}

.sidebar a {
  color: white;
  text-decoration: none;
  font-weight: 600;
  padding: 0.5rem 0 0.5rem 1rem;
  border-radius: 4px;
  transition: background 0.2s ease;
  display: flex;
  align-items: center;
}

.sidebar a:hover,
.sidebar a.active {
  background-color: #db7908;
  color: black;
}

.sidebar a.disabled {
  background-color: transparent;
  color: #777;
  cursor: not-allowed;
  pointer-events: none;
  opacity: 0.6;
}

.sidebar i {
  margin-right: 0.5rem;
}

.sidebar svg {
  margin-right: 0.5rem;
  height: 16px;
}

.sidebar .bottom {
  margin-top: auto;
  font-size: 0.9rem;
}

.profile-box {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.5rem 0;
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.profile-box .user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: #ccc;
}

.profile-box .logout-btn {
  background-color: transparent;
  color: #f79a3b;
  font-weight: bold;
  padding: 0.4rem;
  text-align: center;
  border-radius: 4px;
  text-decoration: none;
  margin-left: auto;
  transition: all 0.2s;
}

.profile-box .logout-btn:hover {
  background-color: #f79a3b;
  color: #000;
}

.language-selector {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: 1rem;
  font-size: 0.9rem;
  color: #ccc;
}

.language-selector label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.language-selector select {
  width: 100%;
  padding: 0.4rem;
  background-color: #111;
  color: white;
  border: 1px solid #666;
  border-radius: 4px;
}

/* ----- MAIN ----- */

main {
  flex: 1;
  overflow-y: auto;
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  padding: 0;
}

h1, h2, h3 {
  margin: 0;
  font-weight: 600;
  font-size: 1rem;
}

/* ----- MESSAGES ----- */

.messages {
  list-style: none;
  padding: 0;
  margin-bottom: 2rem;
}

.message {
  padding: 1rem;
  border-left: 4px solid #000;
  background-color: #f2f2f2;
  margin-bottom: 1rem;
}

.message.error {
  border-left-color: #d00;
  background-color: #fce8e6;
  color: #900;
}

/* ----- TABLES ----- */

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

table th, table td {
  padding: 0.75rem;
  border-bottom: 1px solid #ddd;
  text-align: left;
}

table tr.no-border th, table tr.no-border td {
  border-bottom: none !important;
}


table th {
  background-color: #f7f7f7;
  font-weight: 600;
}

td.active {
  border: 3px dashed #db7908;
}

/* ----- BUTTONS ----- */

.btn-primary {
  background: black;
  color: white;
  padding: 0.6rem 1.2rem;
  border-radius: 4px;
  font-weight: bold;
  transition: background 0.2s;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  text-decoration: none;
}

.btn-primary:hover {
  background: #f79a3b;
  color: white;
}

.btn-orange {
  background: #f79a3b;
  color: white;
  padding: 0.6rem 1.2rem;
  border-radius: 4px;
  font-weight: bold;
  transition: background 0.2s;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  text-decoration: none;
}

.btn-orange:hover {
  filter:brightness(1.03);
}

.btn-orange:disabled:hover {
  filter: none;
}


.btn-orange:disabled {
  background: #d1d5db; /* gris clair */
  color: #9ca3af;     /* gris moyen pour le texte */
  cursor: not-allowed;
  filter: none;
  opacity: 0.7;
}


.btn-secondary {
  background: #e0e0e0;
  padding: 0.6rem 1.2rem;
  border-radius: 4px;
  color: #333;
  font-weight: bold;
  transition: background 0.2s;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  text-align: center;
  text-decoration: none;
}

.btn-secondary:hover {
  background: #cfcfcf;
}

.btn-secondary.active {
  border: 3px dashed #db7908;
}

.btn-green, .btn-red {
  padding: 0.2rem 0.4rem;
  border-radius: 9999px;
  font-weight: bold;
  transition: background 0.2s;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.btn-green {
  background: #4CAF50;
  color: white;
}

.btn-green:hover {
  background: #45a049;
}

.btn-green:disabled {
  background: #ccc;
  color: #666;
  cursor: not-allowed;
}

.btn-red {
  background: #f44336;
  color: white;
}

.btn-red:hover {
  background: #d32f2f;
}

.btn-red:disabled {
  background: #ccc;
  color: #666;
  cursor: not-allowed;
}

.btn-link {
  color: #333;
  background-color: transparent;
  font-weight: 500;
  padding: 0.3rem 0.6rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
  display: inline-block;
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.btn-link:hover {
  background-color: #f2f2f2;
  border-color: #999;
}

/* ----- FORM ----- */

.card {
  max-width: 700px;
  margin: auto;
  background: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 0 8px rgba(0,0,0,0.1);
}

.centered-container {
  max-width: 800px;
  margin: auto;
}

.form h1 {
  margin-bottom: 1rem;
  text-align: center;
}

.form label {
  display: block;
}

.form input:not([type="checkbox"]),
.filter-bar input:not([type="checkbox"]),
.form select,
.filter-bar select,
.form textarea {
  width: 100%;
  padding: 0.6rem;
  font-size: 1rem;
  box-sizing: border-box;
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: white;
  color: #333;
}

.form select,
.filter-bar select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2210%22%20height%3D%225%22%20viewBox%3D%220%200%2010%205%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%3E%3Cpath%20d%3D%22M0%200l5%205%205-5z%22%20fill%3D%22%23333%22/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 0.6em;
}

.form input:focus,
.filter-bar input:focus,
.form select:focus,
.filter-bar select:focus,
.form textarea:focus {
  border-color: #007bff;
  outline: none;
  box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.form .form-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;

}

/* Barre de filtres compacte et aérée */
.filter-bar {
  display: grid;
  grid-template-columns: 1fr;
  gap: .5rem 1rem;
  align-items: end;
  width: 100%;
}

@media (min-width: 720px) {
  .filter-bar {
    grid-template-columns: auto auto auto 1fr auto;
    width: auto;
  }
}

.filter-group {
  display: grid;
  gap: .25rem;
}

.filter-label {
  font-size: .8rem;
  color: #6c757d; /* proche Bootstrap text-secondary */
  margin: 0;
}


.menu-category {
  font-size: 0.8rem;
  text-transform: uppercase;
  font-weight: 700;
  color: #aaa;
  margin: 1rem 0 0.5rem 0;
  letter-spacing: 0.05em;
}

.menu {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

/* ----- ROW ----- */

.row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.row.centered {
  justify-content: center;
}

/* ----- BURGER ----- */

.burger {
  display: none;
  background: white;
  color: black;
  box-shadow: 0 0 8px rgba(0,0,0,0.5);
  padding: 0.5rem;
  font-size: 2rem;
  border: none;
  position: fixed;
  bottom: 0;
  left: 0;
  z-index: 9999;
  cursor: pointer;
  border-top-right-radius: 5px;
  height: 55px;
  width: 55px;
  transition: left 0.3s ease;
}

.sidebar.open ~ .burger {
  left: 180px;
}


/* ----- RESPONSIVE ----- */

/* Desktop */
@media (min-width: 1201px) {
  .sidebar {
    left: 0;
  }

  main {
    margin-left: 180px;
    width: calc(100% - 180px);
  }
}

/* Mobile */
@media (max-width: 1200px) {
  .burger {
    display: block;
  }

  .sidebar {
    left: -200px;
  }

  .sidebar.open {
    left: 0;
  }

  main {
    margin-left: 0;
    padding: 0;
    width: 100%;
  }
}

  .counter-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: center;
  }

  .counter-button {
    padding: 0.5rem 1rem;
    font-size: 1.5rem !important;
    font-weight: bold;
    cursor: pointer;
    border: 1px solid #ccc;
    border-radius: 6px;
    background-color: white;
    color: #333;
    touch-action: manipulation;
  }

  .counter-value {
    font-size: 1.5rem !important;
    width: 3rem;
    text-align: center;
    max-width: 100px;
    padding: 0.5rem 1rem !important;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 6px;
    background-color: white;
    color: #333;
  }

  .header-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1rem;
  }

  .header-button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem ;
    background: #333;
    color: #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
    width: 18px;
    height: 18px;
    text-decoration: none;
  }

  .header-button:hover {
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
  }

  .home-button {
    background: #f79a3b;
    color: white;
    width: 30px;
    height: 30px;
  }

  .back-button {
    background: #333;
    color: #e0e0e0;
  }

  

  .footer {
    margin-top: 2rem;
  }

  .text-muted {
    color: #666;
  }

  .big-button {
    width: 150px;
    height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
    font-size: 1.8rem;
    text-align: center;
  }

  .big-button svg {
    height: 28.8px;
  }

  @media (max-width: 600px) {
    .big-button {
      width: 120px;
      height: 120px;
      font-size: 1.5rem;
    }
  }

  @media (max-width: 400px) {
    .big-button {
      width: 100px;
      height: 100px;
      font-size: 1.2rem;
    }
  }


  .header-title {
    display: flex;
    align-items: center;
    gap: 0.2rem;
  }


  .header-title svg {
    height: 16px;
  }