body { font-family: Arial, sans-serif; background: #f5f5f5; margin:0; padding:1rem; overflow-x: hidden; }
h2 { margin-top: 0; }

#warehouse-container {
  position: absolute;
  width: 1730px;
  height: 1350px;
  transform-origin: top left;
}

.grid-stack {
  position: absolute;
  width: 1730px;
  height: 1350px;
  background: #ADD8E6;
  border: 2px solid #000000;
  user-select: none;
  touch-action: none;
  transform-origin: top left;
}

.label-cell {
  position: absolute;
  border: 1px solid #000000;
  text-align: center;
  padding: 5px;
  font-size: 12px;
  background-color: #FFFFFF;
  box-sizing: border-box;
}

.office-zone, .restroom-zone, .drop-zone, .history-panel { font-weight: bold; }
.office-zone { background-color: #FFFFFF; }
.restroom-zone { background-color: #FFFFFF; }

.drop-zone {
  border: 2px dashed white;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: default;
}
.drop-zone#SHIPPED { background-color: #e74c3c; }
.drop-zone#TO-8412-OFFICE { background-color: #2980b9; }

.pallet {
  position: absolute;
  background: orange;
  color: black;
  font-weight: bold;
  border: 2px solid #000000;
  text-align: center;
  cursor: grab;
  user-select: none;
  box-sizing: border-box;
  padding: 4px 2px 10px 2px;
  font-size: 12px;
  white-space: pre-line;
  transition: transform 0.2s ease-out;
  touch-action: none;
}

.pallet.dragging { opacity: 0.6; cursor: grabbing; z-index: 1000; }

.split-arrow {
  position: absolute;
  top: 2px;
  right: 4px;
  background: black;
  color: white;
  font-weight: bold;
  font-size: 14px;
  width: 18px;
  height: 18px;
  line-height: 18px;
  border-radius: 3px;
  cursor: pointer;
  user-select: none;
  z-index: 10;
}

.control-panel {
  position: absolute;
  background: #27ae60;
  padding: 10px;
  border-radius: 6px;
  color: white;
  font-weight: bold;
  width: 200px;
  box-sizing: border-box;
  transform-origin: top left;
}

#add-product-panel { top: 650px; left: 1000px; background: #27ae60; z-index: 100; }
#add-product-panel input {
  width: calc(100% - 12px);
  margin-bottom: 6px;
  padding: 5px;
  border: none;
  border-radius: 3px;
  font-size: 14px;
}
#add-product-panel input::placeholder { color: #bbb; }
#add-product-panel button {
  width: 100%;
  padding: 6px;
  font-weight: bold;
  font-size: 14px;
  background: #2ecc71;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  color: white;
}
#add-product-panel button:hover { background: #27ae60; }

#inventory-summary-panel {
  top: 80px;
  left: 1480px;
  background: #3498db;
  width: 220px;
  font-size: 14px;
  cursor: pointer;
  text-align: center;
  user-select: none;
}
#inventory-summary-output {
  max-height: 120px;
  overflow-y: auto;
  margin-top: 6px;
  font-weight: normal;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.2);
  padding: 6px;
  border-radius: 4px;
  text-align: left;
  white-space: nowrap;
}

#history-panel {
  top: 600px;
  left: 1480px;
  background: #f1c40f;
  width: 160px;
  text-align: center;
}
.history-icons { display: flex; justify-content: space-around; margin-top: 5px; }
.history-icon-btn {
  background: #f39c12;
  padding: 8px;
  border-radius: 5px;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border: 2px solid white;
}
.history-icon-btn.new-product { background: #2ecc71; }
.history-icon-btn.shipped { background: #e74c3c; }
.history-icon-btn.office { background: #2980b9; }

.modal {
  display: none;
  position: fixed;
  z-index: 1003;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.4);
}
.modal-content {
  background-color: #fefefe;
  margin: 15% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 80%;
  max-width: 600px;
  border-radius: 8px;
}
.close-btn {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
}
.close-btn:hover, .close-btn:focus {
  color: black;
  text-decoration: none;
  cursor: pointer;
}
#history-output {
  max-height: 300px;
  overflow-y: auto;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #eee;
  font-size: 14px;
}

/* Login styles */
#login-container, #signup-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: white;
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
}
.login-box {
  background: #f5f5f5;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
  width: 300px;
  text-align: center;
}
.login-box input {
  width: 100%;
  padding: 0.5rem;
  margin: 0.5rem 0;
  box-sizing: border-box;
}
.login-box button {
  width: 100%;
  padding: 0.5rem;
  background: #27ae60;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 1rem;
}
.login-box a {
  font-size: 12px;
  color: #3498db;
  cursor: pointer;
  display: block;
  margin-top: 10px;
}
#logout-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  left: auto;
  padding: 0.5rem 1rem;
  background: #e74c3c;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  display: none;
  z-index: 2000;
}
#loading-indicator {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  font-size: 1.5rem;
  z-index: 1002;
  display: none;
}

#edit-export-panel{
  top: 300px;
  left: 1480px;
  right: auto;
  background: #2c3e50;
  width: 220px;
  text-align: center;
  z-index: 120;
}

.small-btn {
  width: 100%;
  padding: 12px;
  margin-top: 12px;
  font-weight: bold;
  font-size: 14px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

#edit-mode-btn {
  background: #16a085;
  color: white;
}
#edit-mode-btn.off {
  background: #85c1e9;
}
#excel-export-btn {
  background: #1f8f3a;
  color: white;
}
#excel-export-btn:hover { filter: brightness(1.05); }

.view-only-hint {
  font-weight: normal;
  font-size: 12px;
  margin-top: 8px;
  opacity: 0.9;
}
