body {
  padding: 30px;
  max-width: 800px;
  margin: auto;
  background-color: #f8f8f8;
  color: #333;
}

h1 {
  text-align: center;
  margin-bottom: 30px;
  color: #2c3e50;
}

input, select {
  box-sizing: border-box;
}

label {
  font-weight: bold;
  display: inline-block;
  width: 100px;
  margin: 8px 0;
}

input[type="text"],
input[type="number"],
select {
  padding: 6px 10px;
  margin: 5px 0;
  width: 200px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

button {
  padding: 6px 12px;
  margin: 5px 3px;
  background-color: #3498db;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

button:hover {
  background-color: #2980b9;
}

.popup {
  display: none;
  position: fixed;
  z-index: 100;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.4);
}

.popup.show {
  display: flex;
  justify-content: center;
  align-items: center;
}

.popupContainer {
  background-color: #fefefe;
  width: 100%;
  max-width: 500px;
  margin: 5% auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.popupTop {
  width: 100%;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.popupMain {
  width: 100%;
  height: 100%;
}

.common-items {
  margin: 10px 0;
}

.close {
  color: #2c3e50;
}

.close:hover {
  color: #aaa;
}

#commonButtons button {
  background-color: #95a5a6;
  font-size: 14px;
}

#commonButtons button:hover {
  background-color: #7f8c8d;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  background-color: #fff;
  display: block;
  max-height: 300px;
  overflow-y: scroll;
}

th {
  position: sticky;
  top: 0;
  background-color: #ecf0f1;
  padding: 10px;
  font-weight: bold;
  border: 1px solid #ccc;
}

td {
  padding: 8px;
  border: 1px solid #ccc;
}

td input[type="text"],
td input[type="number"] {
  width: 100%;
  box-sizing: border-box;
}

.amount {
  text-align: right;
}

.control {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;  
}

td button {
  background-color: #e67e22;
  font-size: 12px;
  padding: 4px 8px;
}

td button:hover {
  background-color: #d35400;
}

#freight {
  width: 100px;
}

@media (max-width: 768px) {
  body {
    padding: 15px;
  }

  label {
    display: block;
    width: auto;
    margin-top: 10px;
  }

  input[type="text"],
  input[type="number"],
  select {
    width: 100%;
  }

  .common-items,
  #commonButtons {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
  }

  #itemTable {
    display: block;
    overflow-x: auto;
  }

  table {
    width: 100%;
  }

  button {
    width: 100%;
    margin: 5px 0;
  }

  td button {
    width: auto;
  }
}