.inventory-page { 
  display: grid;
  grid-template-columns: 2fr 1fr; /* Form wider, sidebar narrower */
  grid-template-rows: auto auto;
  gap: 20px;
  padding: 20px;
  min-height: 100vh;
  background-color: #f8fafc;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Add Product Section */
.inventory-page .add-product-section {
  grid-column: 1;
  grid-row: 1;
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.inventory-page .add-product-section .header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.inventory-page .add-product-section .header h2 {
  color: #1a202c;
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 2px 0;
}

.inventory-page .add-product-section .header p {
  color: #64748b;
  font-size: 13px;
  margin: 0;
}

.inventory-page .bulk-add-btn {
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.inventory-page .bulk-add-btn:hover {
  background: #2563eb;
}

/* Product Form */
.inventory-page .product-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
  width: 100%;
}

.inventory-page .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.inventory-page .form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.inventory-page .form-group label {
  font-size: 12px;
  font-weight: 500;
  color: #374151;
}

.inventory-page .form-group input,
.inventory-page .form-group select {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  height: 38px;
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.inventory-page .form-group input:focus,
.inventory-page .form-group select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.inventory-page .form-group input::placeholder {
  color: #9ca3af;
}

.inventory-page .submit-btn {
  background: #10b981;
  color: white;
  border: none;
  border-radius: 6px;
  padding: px px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  align-self: flex-start;
  margin-top: 6px;
  height:34px;
  transition: background-color 0.2s;
  display: block;
  width: auto;
  margin-left: 290px;

}

.inventory-page .submit-btn:hover {
  background: #059669;
}

/* Product Category Sidebar */
.inventory-page .product-category-sidebar {
  grid-column: 2;
  grid-row: 1;
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  border: 1px solid #e2e8f0;
  height: fit-content;
}

.inventory-page .product-category-sidebar .header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.inventory-page .product-category-sidebar .header h3 {
  font-size: 18px;
  font-weight: 600;
  color: #1a202c;
  margin: 0;
}

.inventory-page .product-category-sidebar .add-btn {
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.inventory-page .product-category-sidebar .add-btn:hover {
  background: #2563eb;
}

.inventory-page .category-block {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f1f5f9;
}

.inventory-page .category-block:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.inventory-page .category-block h4 {
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  margin: 0 0 12px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.inventory-page .category-block h4 span {
  background: #f1f5f9;
  color: #64748b;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
}

.inventory-page .category-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.inventory-page .category-tags span {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #64748b;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 12px;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
}

.inventory-page .category-tags span:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.inventory-page .barcode-btn {
  background: #8b5cf6;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 12px;
  transition: background-color 0.2s;
}

.inventory-page .barcode-btn:hover {
  background: #7c3aed;
}

/* Product Table Section */
.inventory-page .product-table-section {
  grid-column: 1 / 3;
  grid-row: 2;
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  border: 1px solid #e2e8f0;
  overflow: visible;
}

.inventory-page .product-table-section h3 {
  font-size: 20px;
  font-weight: 600;
  color: #1a202c;
  margin: 0 0 20px 0;
}

.inventory-page .product-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.inventory-page .product-table thead th {
  background: #f1f5f9;
  color: #374151;
  font-weight: 600;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

.inventory-page .product-table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
  color: #374151;
  vertical-align: middle;
}

.inventory-page .product-table tbody tr:hover {
  background: #f8fafc;
}

/* Dropdown */
.inventory-page .action-cell {
  position: relative;
  text-align: center;
  width: 100px;
}

.inventory-page .dropdown {
  position: relative;
  display: inline-block;
}

.inventory-page .dots-btn {
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  color: #374151;
  background: none;
}

.inventory-page .dropdown-menu {
  display: none;
  position: absolute;
  right: 10px;
  top: 35px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  list-style: none;
  padding: 6px 0;
  margin: 0;
  z-index: 100;
  min-width: 160px;
}

.inventory-page .dropdown-menu.show {
  display: block;
}

.inventory-page .dropdown-menu li {
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 14px;
  text-align: left;
}

.inventory-page .dropdown-menu li:hover {
  background: #f9fafb;
}

/* Barcode Styling */
.barcode {
  max-width: 150px;
}

.barcode-cell {
  text-align: center;
}

/* Popup Styles */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.popup-overlay.active {
  display: flex;
}

.popup-box {
  background: #fff;
  padding: 20px;
  border-radius: 10px;
  width: 400px;
  max-width: 90%;
  text-align: center;
}

.popup-actions {
  margin-top: 15px;
  display: flex;
  justify-content: space-between;
}

#bulkUploadPopup .popup-actions button {
  padding: 8px 18px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
}

#bulkUploadPopup #uploadFileBtn {
  background-color: #1d7d3a;
  color: #fff;
  font-weight: 500;
}

#bulkUploadPopup #uploadFileBtn:hover {
  background-color: #16642d;
}

#bulkUploadPopup #closeBulkPopup {
  background-color: #e0e0e0;
  color: #333;
  font-weight: 500;
}

#bulkUploadPopup #closeBulkPopup:hover {
  background-color: #c2c2c2;
}

/* Fullscreen Modal */
.barcode-modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  justify-content: center;
  align-items: center;
}

.barcode-modal-content {
  background: #fff;
  padding: 20px;
  border-radius: 10px;
  text-align: center;
}

.barcode-modal-content svg {
  max-width: 90%;
  max-height: 80vh;
}

.close-btn {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 30px;
  font-weight: bold;
  color: #fff;
  cursor: pointer;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .inventory-page {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }

  .inventory-page .product-category-sidebar {
    grid-column: 1;
    grid-row: 2;
    width: 100%;
  }

  .inventory-page .product-table-section {
    grid-column: 1;
    grid-row: 3;
  }
}

@media (max-width: 768px) {
  .inventory-page {
    padding: 12px;
    gap: 12px;
  }

  .inventory-page .form-row {
    grid-template-columns: 1fr;
  }

  .inventory-page .product-table-section {
    overflow-x: auto;
  }

  .inventory-page .product-table {
    min-width: 600px;
  }
}
/* Extra Small Screens (Mobile Phones) */
@media (max-width: 480px) {
  .inventory-page {
    padding: 10px;
    gap: 10px;
  }

  /* Form Section */
  .inventory-page .add-product-section {
    padding: 14px;
  }

  .inventory-page .add-product-section .header h2 {
    font-size: 18px;
  }

  .inventory-page .add-product-section .header p {
    font-size: 12px;
  }

  /* Form rows become single column */
  .inventory-page .form-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  /* Submit button should not overflow */
  .inventory-page .submit-btn {
    width: 100%;
    margin-left: 0;
    font-size: 13px;
    height: 36px;
  }

  /* Sidebar */
  .inventory-page .product-category-sidebar {
    padding: 14px;
  }

  .inventory-page .product-category-sidebar .header h3 {
    font-size: 16px;
  }

  /* Product table */
  .inventory-page .product-table-section {
    padding: 14px;
  }

  .inventory-page .product-table-section h3 {
    font-size: 18px;
  }

  .inventory-page .product-table {
    font-size: 13px;
    min-width: 500px; /* keep horizontal scroll */
  }

  .inventory-page .product-table-section {
    overflow-x: auto;
  }

  /* Popup adjustments */
  .popup-box {
    width: 90%;
    padding: 15px;
  }

  .popup-actions {
    flex-direction: column;
    gap: 10px;
  }

  .popup-actions button {
    width: 100%;
  }
}
