/* ===== styles.css ===== */

/* 1. Reset box-sizing pour tous les éléments */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* 2. Corps de page */
body {
  margin: 0;
  font-family: Arial, sans-serif;
  display: flex;
  height: 100vh;
  overflow-x: hidden;
  background: #f3f4f6;
}

/* 3. Bouton “☰ Menu” (mobile) */
.menu-toggle {
  display: none;
  background: #111827;
  color: #fff;
  padding: 10px;
  cursor: pointer;
  user-select: none;
}

/* 4. Sidebar */
.sidebar {
  background: #111827;
  color: #fff;
  padding: 20px;
  width: 220px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sidebar button {
  background: none;
  border: none;
  color: #fff;
  text-align: left;
  padding: 10px;
  cursor: pointer;
  font-size: 16px;
}
.sidebar button.active {
  background: #374151;
}

/* 5. Contenu principal */
.content {
  flex-grow: 1;
  padding: 20px;
  max-width: 100%;
  overflow-y: auto;
}

/* 6. Section générique */
.section {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* 7. Inputs et textarea */
input,
textarea,
select {
  width: 100%;
  padding: 10px;
  margin-top: 5px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
}

/* 8. Boutons */
button,
.validate-btn {
  margin-top: 10px;
  background: #3b82f6;
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 14px;
}
button:hover,
.validate-btn:hover {
  background: #2563eb;
}
.validate-btn {
  background: #10b981;
}
.validate-btn:hover {
  background: #059669;
}

/* 9. Ligne de radios */
.radio-line {
  display: flex;
  margin-top: 10px;
}
.radio-box {
  display: flex;
  align-items: center;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 8px 12px;
  gap: 5px;
  font-size: 14px;
  background: #f9fafb;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  margin-right: 10px;
}
.radio-line .radio-box:last-child {
  margin-right: 0;
}

/* 10. Grille deux colonnes pour la commande */
#commande {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  grid-gap: 20px;
}

/* 11. Responsive : une seule colonne en dessous de 600px */
@media (max-width: 600px) {
  body {
    flex-direction: column;
  }
  .menu-toggle {
    display: block;
  }
  .sidebar {
    display: none;
    width: 100%;
  }
  .sidebar.show {
    display: flex;
  }
  #commande {
    grid-template-columns: 1fr;
  }
}
/* ---- Bons de livraison - style moderne ---- */
/* Bons de livraison : Style harmonisé */
#bonsLivraison {
  margin: 2em auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 18px rgba(60, 60, 130, 0.07);
  padding: 1.7em 1.5em 2em 1.5em;
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  max-width: 1200px;
}
.bl-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.2em;
}
.bl-header h2 {
  color: #1861d1;
  font-size: 1.4em;
  letter-spacing: -1px;
  margin: 0;
}
#btnNouveauBon {
  background: #2563eb;
  color: #fff;
  font-weight: 600;
  padding: 0.65em 1.3em;
  border: none;
  border-radius: 7px;
  box-shadow: 0 1px 5px #2563eb13;
  cursor: pointer;
  font-size: 1em;
  transition: background 0.18s;
}
#btnNouveauBon:hover {
  background: #174c99;
}
.bl-table-container {
  overflow-x: auto;
  background: #f7f8fb;
  border-radius: 10px;
  padding: 1em;
}
.bl-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 800px;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
}
.bl-table th,
.bl-table td {
  padding: 0.95em 0.5em;
  text-align: left;
  font-size: 1em;
}
.bl-table thead th {
  background: #f1f6fa;
  color: #2066d1;
  font-weight: 700;
  border-bottom: 2px solid #e4eaf3;
}
.bl-table tbody tr {
  border-bottom: 1px solid #f1f1f6;
  transition: background 0.14s;
}
.bl-table tbody tr:hover {
  background: #eaf2fb;
}
.bl-table td {
  color: #3a4369;
}
.bl-table td .bl-badge {
  background: #eee;
  color: #2563eb;
  border-radius: 6px;
  padding: 0.2em 0.7em;
  font-size: 0.92em;
  font-weight: 600;
  margin-right: 0.3em;
  display: inline-block;
}
.bl-table td .bl-badge.attente   { background: #ede9fe; color: #7c3aed;}
.bl-table td .bl-badge.envoye    { background: #d1fae5; color: #059669;}
.bl-table td .bl-badge.annule    { background: #fee2e2; color: #b91c1c;}
.bl-table td .bl-badge.autre     { background: #fef9c3; color: #ca8a04;}
/* Actions boutons */
.bl-table td .bl-action-btn {
  background: #e0e7ef;
  color: #2066d1;
  border: none;
  border-radius: 6px;
  padding: 0.36em 0.88em;
  font-size: 1.1em;
  margin-right: 0.18em;
  cursor: pointer;
  transition: background 0.13s;
}
.bl-table td .bl-action-btn:hover {
  background: #2066d1;
  color: #fff;
}
/* Barre de recherche */
#searchBonInput {
  background: #f1f6fa;
  border: 1px solid #e2eaf5;
  border-radius: 7px;
  padding: 0.9em 1em;
  margin-bottom: 1.2em;
  width: 320px;
  font-size: 15px;
  color: #304164;
  outline: none;
  margin-right: 18px;
}
@media (max-width: 950px) {
  #bonsLivraison { padding: 1em 0.5em;}
  .bl-table { min-width: 520px;}
}
@media (max-width: 700px) {
  #searchBonInput { width: 100%; margin-bottom: 1em;}
}


.orders-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px #4682bf0a;
}
.orders-table th, .orders-table td {
  padding: 1em 0.5em;
  text-align: left;
  font-size: 1em;
}
.orders-table thead th {
  background: #eaf1fa;
  color: #2664ae;
  font-weight: 700;
}
.orders-table tbody tr {
  border-bottom: 1px solid #f2f3f6;
  transition: background 0.18s;
}
.orders-table tbody tr:hover {
  background: #f6faff;
}
.total-tag {
  background: #e1ffe3;
  color: #15803d;
  font-weight: bold;
  border-radius: 6px;
  padding: 0.25em 0.7em;
  font-size: 0.95em;
}
.etat-badge {
  padding: 0.2em 0.8em;
  border-radius: 14px;
  font-size: 0.97em;
  font-weight: 600;
}
.etat-attente { background: #f3e8ff; color: #7c3aed; }
.etat-envoye { background: #d1fae5; color: #059669; }
.etat-annule { background: #fee2e2; color: #dc2626; }
.id-bon-link {
  color: #2563eb;
  font-weight: 600;
  text-decoration: underline dotted;
  cursor: pointer;
}
.btn-action {
  background: #e0e7ef;
  border: none;
  border-radius: 6px;
  margin: 0 3px;
  padding: 6px 8px;
  cursor: pointer;
  font-size: 1.03em;
  transition: background 0.14s;
}
.btn-action.btn-modif { background: #dbeafe; color: #1d4ed8; }
.btn-action.btn-hist  { background: #fef9c3; color: #a16207; }
.btn-action.btn-supp  { background: #fee2e2; color: #dc2626; }
.btn-action:hover { background: #bcdffb; }
.btn-action.btn-supp:hover { background: #fecaca; }
.popup {
  position: fixed; z-index: 1001;
  left: 0; top: 0; width: 100vw; height: 100vh;
  background: rgba(50,60,70,0.16);
  display: flex; align-items: center; justify-content: center;
}
.popup-content {
  background: #fff;
  border-radius: 14px;
  padding: 2em 2em 1.3em 2em;
  min-width: 320px; max-width: 90vw;
  box-shadow: 0 10px 38px #4682bf20;
  position: relative;
}
.popup-close {
  position: absolute; right: 18px; top: 13px; font-size: 2em;
  color: #b6b6b6; cursor: pointer;
}
@media (max-width: 900px) {
  .orders-table th, .orders-table td { padding: 0.4em 0.2em; font-size: 0.93em;}
  .popup-content { min-width: 220px; padding: 1em; }
}
.orders-tools {
  display: flex;
  align-items: center;
  gap: 1em;
  margin: 1em 0 1.2em 0;
  padding-left: 0.1em;
  flex-wrap: wrap;
}

.searchbox {
  position: relative;
  flex: 0 1 270px;
  min-width: 200px;
  max-width: 340px;
}

.selectbox {
  flex: 0 1 auto;
}

.searchbox input[type="text"] {
  width: 100%;
  padding: 11px 13px 11px 32px;
  border: 1.5px solid #e3e9f4;
  border-radius: 8px;
  background: #f6f8fa;
  font-size: 1em;
  box-shadow: 0 2px 10px #dde3f233;
  transition: border 0.16s, box-shadow 0.18s;
}

.search-icon {
  position: absolute;
  top: 50%;
  left: 10px;
  font-size: 1.13em;
  color: #a2adc6;
  transform: translateY(-50%);
}

.selectbox select {
  padding: 10px 14px;
  border: 1.5px solid #e3e9f4;
  border-radius: 8px;
  background: #f6f8fa;
  font-size: 1em;
  color: #2066d1;
  min-width: 120px;
  transition: border 0.16s, box-shadow 0.18s;
  box-shadow: 0 2px 10px #dde3f233;
  margin-left: 0.1em;
}

@media (max-width: 800px) {
  .orders-tools {
    flex-direction: column;
    gap: 0.6em;
    padding: 0;
  }
  .searchbox, .selectbox {
    max-width: 100%;
    width: 100%;
  }
}
.btn-bigboss {
  background: linear-gradient(90deg, #fa8000 0%, #f5c003 100%);
  color: #222;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  padding: 10px 20px;
  margin-left: 18px;
  font-size: 1.1em;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(250,128,0,0.08);
  transition: background 0.3s, transform 0.2s;
}
.btn-bigboss:hover {
  background: linear-gradient(90deg, #f5c003 0%, #fa8000 100%);
  color: #000;
  transform: translateY(-2px) scale(1.04);
}

.btn-imprimer {
  background: #222;
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 5px 8px;
  margin-left: 3px;
  font-size: 1.05em;
  cursor: pointer;
}
.btn-imprimer:disabled {
  background: #ccc;
  color: #999;
  cursor: not-allowed;
}

