.arvst-wrap{
  max-width:1100px;
  margin:30px auto;
  padding:0 10px;
  font-family:system-ui,-apple-system,BlinkMacSystemFont,sans-serif;
}

.arvst-top{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  margin-bottom:12px;
}

#arvst-search{
  flex:1;
  min-width:260px;
  padding:12px 14px;
  border:1px solid #ccc;
  border-radius:12px;
  outline:none;
}

.arvst-btn{
  padding:11px 14px;
  border-radius:12px;
  border:1px solid #0E6121;
  background:#0E6121;
  color:#fff;
  font-weight:800;
  cursor:pointer;
}
.arvst-btn:hover{ filter:brightness(.95); }

.arvst-btn-ghost{
  background:#fff;
  color:#111;
  border:1px solid #ccc;
}

.arvst-card{
  background:#fff;
  border:1px solid #ddd;
  border-radius:14px;
  padding:14px;
}

.arvst-denied{
  background:#fffbe6;
  border:1px solid #f1c40f;
  border-radius:14px;
  padding:14px;
  font-weight:900;
}

.arvst-table-scroll{
  width:100%;
  overflow:auto;
}

.arvst-table{
  width:100%;
  border-collapse:collapse;
  min-width:900px;
}

.arvst-table th,
.arvst-table td{
  border-bottom:1px solid #eee;
  padding:10px;
  text-align:left;
  vertical-align:middle;
  white-space:nowrap;
}

.arvst-th{ position:relative; }

/* ✅ wrapper safe (ne casse pas le tableau) */
.arvst-th-inner{
  display:inline-flex;
  align-items:center;
  gap:6px;
  white-space:nowrap;
}
.arvst-th-label{
  display:inline;
  white-space:nowrap;
}

/* ✅ flèche seule (noir, sans fond) */
.arvst-th-filter{
  appearance:none;
  -webkit-appearance:none;
  background:transparent !important;
  border:none !important;
  padding:0 !important;
  margin:0 !important;
  color:#000 !important;
  -webkit-text-fill-color:#000;
  font-size:14px;
  font-weight:900;
  line-height:1;
  cursor:pointer;
  opacity:.65;
}
.arvst-th-filter:hover{ opacity:1; }
.arvst-th-filter.is-on{ opacity:1; }

.arvst-swatch{
  display:inline-block;
  width:18px;
  height:18px;
  border-radius:4px;
  border:1px solid rgba(0,0,0,.2);
  vertical-align:middle;
  margin-right:8px;
}

.arvst-muted{ color:#666; font-size:12px; }

.arvst-mini{
  padding:7px 10px;
  border-radius:10px;
  border:1px solid #ccc;
  background:#fff;
  font-weight:800;
  cursor:pointer;
}
.arvst-mini:hover{ filter:brightness(.97); }

.arvst-danger{
  border-color:#d00000;
  color:#d00000;
}

/* =========================
   POPUP FILTRE
========================= */
.arvst-filter-pop{
  position:absolute;
  width:320px;
  background:#fff;
  border:1px solid #ddd;
  border-radius:14px;
  box-shadow:0 14px 28px rgba(0,0,0,.15);
  padding:10px;
  z-index:99999;
}

.arvst-filter-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:8px;
}

.arvst-filter-search{
  width:100%;
  padding:10px 12px;
  border:1px solid #ccc;
  border-radius:12px;
  outline:none;
  margin-bottom:8px;
}

.arvst-filter-list{
  max-height:260px;
  overflow:auto;
  border:1px solid #eee;
  border-radius:12px;
  padding:8px;
}

.arvst-filter-item{
  display:flex;
  gap:10px;
  align-items:center;
  padding:6px 6px;
  border-radius:10px;
}
.arvst-filter-item:hover{ background:#f7f7f7; }

.arvst-filter-actions{
  display:flex;
  justify-content:space-between;
  gap:10px;
  margin-top:10px;
}

/* =========================
   MODAL
========================= */
.arvst-modal{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.35);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:99999;
  padding:16px;
}

.arvst-modal-card{
  width:min(620px, 100%);
  max-height:85vh;
  background:#fff;
  border-radius:16px;
  border:1px solid #ddd;
  display:flex;
  flex-direction:column;
  overflow:hidden;
}

.arvst-detail-card{
  width:min(760px, 100%);
}

.arvst-modal-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:12px 14px;
  border-bottom:1px solid #eee;
}

.arvst-modal-title{
  font-size:18px;
  font-weight:900;
}

.arvst-modal-body{
  padding:12px 14px;
  overflow:auto;
}

.arvst-form{
  display:grid;
  gap:10px;
}

.arvst-field label{
  display:block;
  font-weight:900;
  font-size:13px;
  margin-bottom:6px;
}

.arvst-field input{
  width:100%;
  padding:11px 12px;
  border-radius:12px;
  border:1px solid #ccc;
  outline:none;
  box-sizing:border-box;
}

.arvst-modal-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  padding:12px 14px;
  border-top:1px solid #eee;
  background:#fff;
}

/* ✅ bouton X centré */
.arvst-x{
  appearance:none;
  -webkit-appearance:none;
  width:26px;
  height:26px;
  padding:0;
  margin:0;
  display:flex;
  align-items:center;
  justify-content:center;
  background:transparent;
  border:1px solid rgba(0,0,0,.25);
  border-radius:8px;
  color:#000;
  -webkit-text-fill-color:#000;
  font-size:16px;
  font-weight:700;
  line-height:1;
  cursor:pointer;
  opacity:.6;
}
.arvst-x:hover{ opacity:1; }

@media (max-width:700px){
  .arvst-table{ min-width:760px; }
}

/* =========================
   ✅ SUGGESTIONS EN BULLES (scroll horizontal)
========================= */
.arvst-suggest-wrap{
  display:flex;
  gap:8px;
  overflow-x:auto;
  overflow-y:hidden;
  padding:8px 2px 2px;
  margin-top:6px;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:thin;
}

.arvst-suggest-wrap::-webkit-scrollbar{ height:6px; }
.arvst-suggest-wrap::-webkit-scrollbar-thumb{
  background:rgba(0,0,0,.2);
  border-radius:999px;
}

.arvst-chip{
  display:inline-flex;
  width:auto;
  flex:0 0 auto;
  background:#111;
  color:#fff;
  border:1px solid rgba(0,0,0,.35);
  border-radius:999px;
  padding:4px 8px;
  font-size:12px;
  font-weight:800;
  line-height:1;
  cursor:pointer;
  white-space:nowrap;
  user-select:none;
  opacity:.92;
}
.arvst-chip:hover{ opacity:1; background:#000; }
.arvst-chip.is-active{ background:#fff; color:#111; border-color:#111; }

/* =========================
   ✅ DÉTAIL
========================= */
.arvst-detail-grid{
  display:grid;
  gap:10px;
}

.arvst-kv{
  display:flex;
  gap:10px;
  align-items:baseline;
  padding:10px 12px;
  border:1px solid #eee;
  border-radius:12px;
  background:#fafafa;
}
.arvst-kv b{
  min-width:170px;
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.03em;
  color:#333;
}
.arvst-kv span{
  font-weight:800;
  color:#111;
}

.arvst-section-title{
  margin:14px 0 8px;
  font-weight:900;
  font-size:14px;
}

.arvst-photo-row{
  display:flex;
  gap:12px;
  align-items:center;
  flex-wrap:wrap;
}

.arvst-photo{
  width:120px;
  height:auto;
  border-radius:12px;
  border:1px solid #ddd;
  background:#fff;
}

.arvst-upload{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}
.arvst-upload input[type=file]{ max-width:260px; }

.arvst-equv-box{
  border:1px solid #eee;
  border-radius:14px;
  padding:10px;
  background:#fff;
}

.arvst-equv-item{
  padding:8px 10px;
  border:1px solid #eee;
  border-radius:12px;
  margin:6px 0;
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:center;
  background:#fafafa;
}
.arvst-equv-item small{ color:#666; font-weight:700; }

.arvst-equv-admin{
  margin-top:10px;
  border-top:1px solid #eee;
  padding-top:10px;
}

.arvst-equv-search{
  width:100%;
  padding:10px 12px;
  border:1px solid #ccc;
  border-radius:12px;
  outline:none;
  margin-bottom:10px;
}

.arvst-equv-list{
  max-height:260px;
  overflow:auto;
  border:1px solid #eee;
  border-radius:12px;
  padding:8px;
}

.arvst-equv-row{
  display:flex;
  gap:10px;
  align-items:center;
  padding:8px 8px;
  border-radius:10px;
}
.arvst-equv-row:hover{ background:#f4f4f4; }
.arvst-equv-row code{ font-weight:900; }

/* =========================
   DÉTAIL (page)
========================= */
.arvst-detail-top{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  margin-bottom:12px;
}

.arvst-detail-head{
  display:flex;
  flex-direction:column;
  gap:2px;
}

.arvst-detail-title{
  font-size:18px;
  font-weight:900;
}

.arvst-detail-actions{
  margin-top:14px;
  display:flex;
  justify-content:flex-end;
}

/* mêmes styles détail que tu avais */
.arvst-detail-grid{ display:grid; gap:10px; }

.arvst-kv{
  display:flex;
  gap:10px;
  align-items:baseline;
  padding:10px 12px;
  border:1px solid #eee;
  border-radius:12px;
  background:#fafafa;
}
.arvst-kv b{
  min-width:170px;
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.03em;
  color:#333;
}
.arvst-kv span{ font-weight:800; color:#111; }

.arvst-section-title{
  margin:14px 0 8px;
  font-weight:900;
  font-size:14px;
}

.arvst-photo-row{
  display:flex;
  gap:12px;
  align-items:center;
  flex-wrap:wrap;
}
.arvst-photo{
  width:120px;
  height:auto;
  border-radius:12px;
  border:1px solid #ddd;
  background:#fff;
}

.arvst-upload{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}
.arvst-upload input[type=file]{ max-width:260px; }

.arvst-equv-box{
  border:1px solid #eee;
  border-radius:14px;
  padding:10px;
  background:#fff;
}

.arvst-equv-item{
  padding:8px 10px;
  border:1px solid #eee;
  border-radius:12px;
  margin:6px 0;
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:center;
  background:#fafafa;
}
.arvst-equv-item small{ color:#666; font-weight:700; }

.arvst-equv-admin{
  margin-top:10px;
  border-top:1px solid #eee;
  padding-top:10px;
}

.arvst-equv-search{
  width:100%;
  padding:10px 12px;
  border:1px solid #ccc;
  border-radius:12px;
  outline:none;
  margin-bottom:10px;
}

.arvst-equv-list{
  max-height:320px;
  overflow:auto;
  border:1px solid #eee;
  border-radius:12px;
  padding:8px;
}

.arvst-equv-row{
  display:flex;
  gap:10px;
  align-items:center;
  padding:8px 8px;
  border-radius:10px;
}
.arvst-equv-row:hover{ background:#f4f4f4; }
.arvst-equv-row code{ font-weight:900; }

/* ✅ KV en 2 colonnes (avant la photo) */
.arvst-kv-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:10px;
}

/* mobile : 1 colonne */
@media (max-width:700px){
  .arvst-kv-grid{
    grid-template-columns:1fr;
  }
}

/* ✅ KV en 2 colonnes avec coupure parfaite (JS split) */
.arvst-kv-cols{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:10px;
}

.arvst-kv-col{
  display:flex;
  flex-direction:column;
  gap:10px;
}

/* mobile : 1 colonne */
@media (max-width:700px){
  .arvst-kv-cols{
    grid-template-columns:1fr;
  }
}

.arvst-stock-adjust{
  display:flex !important;
  flex-direction:row !important;
  align-items:center !important;
  justify-content:center !important;
  gap:10px !important;
}

/* ✅ Fix boutons + / − : taille compacte */
.arvst-stock-adjust .arvst-mini{
  width:auto !important;
  min-width:42px;
  padding:8px 10px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
  line-height:1;
}


#arvst-stock-input{
  width:130px;
  text-align:center;
  font-weight:900;
  font-size:18px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid #ccc;
  outline:none;
}

.arvst-stock-save-row{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:12px;
  margin-bottom:14px;
}

/* bouton grisé désactivé */
.arvst-btn:disabled{
  opacity:.45;
  cursor:not-allowed;
  filter:grayscale(1);
}


/* =========================
   DEPENDANT (lots)
========================= */
.arvst-lot-box{
  border:1px solid #ccc;
  border-radius:12px;
  padding:10px;
  background:#fafafa;
}

.arvst-lot-row{
  display:flex;
  gap:8px;
  margin-bottom:6px;
  align-items:center;
}

.arvst-lot-row input[type=text]{
  width:170px;
  text-align:left;
}

.arvst-lot-row input[type=number]{
  width:110px;
  text-align:right;
}

.arvst-lot-total{
  margin-top:8px;
  font-weight:900;
}

/* ✅ warning parent (plusieurs lots) */
.arvst-warn-val{
  color:#d00000;
  font-weight:900;
}
.arvst-warn{
  font-size:12px;
  vertical-align:middle;
  margin-left:4px;
}

.arvst-stock-lotrow{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:center;
  flex-wrap:wrap;
  margin-bottom:10px;
}

#arvst-stock-lot{
  padding:10px 12px;
  border:1px solid #ccc;
  border-radius:12px;
  font-weight:800;
  outline:none;
}

/* ✅ valeur stock mise en avant */
.arvst-stock-val{
  color:#0E6121; /* vert foncé ARVERNE */
  font-weight:900;
}


/* =========================
   ✅ TABS style "onglets navigateur"
========================= */
.arvst-tabs-bar{
  margin-bottom:12px;
  border-bottom:1px solid #ddd;
}

.arvst-tabs{
  display:flex;
  gap:6px;
  flex-wrap:nowrap;
  align-items:flex-end;
  overflow-x:auto;
  padding:0 2px;
  -webkit-overflow-scrolling:touch;
}
.arvst-tabs::-webkit-scrollbar{ height:6px; }
.arvst-tabs::-webkit-scrollbar-thumb{
  background:rgba(0,0,0,.18);
  border-radius:999px;
}

.arvst-tab{
  appearance:none;
  -webkit-appearance:none;
  border:1px solid #ddd;
  border-bottom:none;               /* clé du look "onglet" */
  background:#f4f4f4;
  color:#111;
  font-weight:900;
  padding:10px 14px;
  border-top-left-radius:12px;
  border-top-right-radius:12px;
  cursor:pointer;
  position:relative;
  top:1px;                          /* colle au trait du bas */
  white-space:nowrap;
  opacity:.92;
}
.arvst-tab:hover{ opacity:1; filter:brightness(.98); }

.arvst-tab.is-on{
  background:#fff;
  border-color:#ddd;
  color:#111;
  top:0;                             /* l’onglet actif “remonte” */
  z-index:2;
}

/* Option: petite touche ARVERNE sans faire bouton vert */
.arvst-tab.is-on::after{
  content:"";
  position:absolute;
  left:10px;
  right:10px;
  top:0;
  height:3px;
  background:#0E6121;                /* vert sapin */
  border-radius:999px;
}

/* Orders */
.arvst-order-card{
  border:1px solid #eee;
  border-radius:14px;
  padding:12px;
  margin-bottom:10px;
  background:#fafafa;
}
.arvst-order-head{
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:center;
  margin-bottom:10px;
}
.arvst-order-lines{ display:grid; gap:8px; }
.arvst-order-line{
  display:flex;
  gap:10px;
  align-items:center;
  padding:8px 10px;
  border:1px solid #eee;
  border-radius:12px;
  background:#fff;
}
.arvst-order-qty{ font-weight:900; margin-left:auto; }
.arvst-order-lot{
  width:170px;
  padding:8px 10px;
  border:1px solid #ccc;
  border-radius:10px;
  font-weight:800;
}
.arvst-order-actions{
  display:flex;
  justify-content:flex-end;
  margin-top:10px;
}

/* Out */
.arvst-out-item{
  width:100%;
  text-align:left;
  border:1px solid #eee;
  border-radius:12px;
  background:#fff;
  padding:10px 12px;
  cursor:pointer;
  margin-bottom:8px;
}
.arvst-out-item:hover{ filter:brightness(.98); }
#arvst-out-input{
  width:130px;
  text-align:center;
  font-weight:900;
  font-size:18px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid #ccc;
  outline:none;
}

.arvst-modal{ position:fixed; inset:0; background:rgba(0,0,0,.25); display:flex; align-items:center; justify-content:center; padding:18px; z-index:9999; }
.arvst-modal-card{ background:#fff; border-radius:16px; width:min(760px, 100%); box-shadow:0 18px 60px rgba(0,0,0,.2); padding:14px; }
.arvst-modal-wide{ width:min(1100px, 100%); }
.arvst-modal-head{ display:flex; align-items:center; justify-content:space-between; gap:10px; padding:6px 4px 12px; border-bottom:1px solid #eee; }
.arvst-modal-title{ font-weight:900; font-size:18px; }

/* Toolbar commande : recherche large + bouton compact */
.arvst-order-top{
  display:flex;
  align-items:center;
  gap:10px;
  margin:12px 0;
}

/* la recherche prend toute la place */
#arvst-order-search{
  flex:1 1 auto;
  min-width:0;
  height:38px;
  padding:0 12px;
  border:1px solid #ccc;
  border-radius:12px;
  outline:none;
  font-weight:800;
}

/* bouton compact (ne s’étire jamais) */
#arvst-order-add-new{
  flex:0 0 auto;
  height:38px;
  padding:0 14px;
  white-space:nowrap;
}


.arvst-order-list{
  border:1px solid #eee;
  border-radius:14px;
  max-height: 55vh;
  overflow:auto;
}
.arvst-ord-row{
  display:grid;
  grid-template-columns: 42px 1fr 120px 170px;
  gap:10px;
  align-items:center;
  padding:10px 12px;
  border-bottom:1px solid #f2f2f2;
}
.arvst-ord-row:last-child{ border-bottom:none; }
.arvst-ord-keys{ font-weight:900; }
.arvst-ord-sub{ font-size:12px; opacity:.75; font-weight:700; margin-top:2px; }

.arvst-ord-qty, .arvst-ord-lot{
  width:100%;
  padding:10px 12px;
  border:1px solid #ccc;
  border-radius:12px;
  font-weight:900;
}
.arvst-order-footer{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  margin-top:12px;
}


/* ordre des modals */
#arvst-order-modal { z-index: 10000 !important; }
#arvst-modal       { z-index: 10100 !important; }

/* Quand #arvst-modal est ouvert au-dessus d'une commande, on enlève son fond */
#arvst-modal.arvst-no-overlay {
  background: transparent !important;
}

/* Pour garder la carte bien cliquable au-dessus */
#arvst-modal .arvst-modal-card { position: relative; z-index: 2; }
#arvst-order-modal .arvst-modal-card { position: relative; z-index: 1; }
