:root {
  --primary-color: #2c3e50;
  --secondary-color: #3498db;
  --success-color: #2ecc71;
  --error-color: #e74c3c;
  --warning-color: #f1c40f;
  --background-color: #f5f6fa;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: var(--background-color);
  padding: 2rem;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

h1, h2 {
  color: var(--primary-color);
  text-align: center;
  margin-bottom: 2rem;
}

.actions-container {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  justify-content: center;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  background-color: var(--secondary-color);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.action-btn:hover {
  background-color: #2980b9;
}

.form-container {
  background-color: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

.form-group {
  margin-bottom: 1rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
}

input {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
}

button {
  background-color: var(--secondary-color);
  color: white;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  margin-right: 0.5rem;
}

button:hover {
  opacity: 0.9;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.inventory-table {
  width: 100%;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  margin-bottom: 2rem;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

th {
  background-color: var(--primary-color);
  color: white;
}

.quantity-cell {
  width: 150px;
}

.quantity-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.quantity-btn {
  background-color: var(--secondary-color);
  color: white;
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.quantity-display {
  min-width: 40px;
  text-align: center;
  font-weight: bold;
}

.delete-btn {
  background-color: var(--error-color);
  width: 32px;
  height: 32px;
  padding: 0;
}

.history-btn {
  background-color: var(--secondary-color);
  width: 32px;
  height: 32px;
  padding: 0;
}

.message {
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 4px;
  text-align: center;
}

.message.success {
  background-color: var(--success-color);
  color: white;
}

.message.error {
  background-color: var(--error-color);
  color: white;
}

.message.warning {
  background-color: var(--warning-color);
  color: #000;
}

.low-stock {
  background-color: rgba(241, 196, 15, 0.1);
}

.stock-warning {
  color: var(--warning-color);
  font-size: 0.85rem;
  margin-top: 0.25rem;
  font-weight: bold;
}

.modal {
  display: block;
  position: fixed;
  z-index: 1;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background-color: white;
  margin: 10% auto;
  padding: 2rem;
  border-radius: 8px;
  width: 80%;
  max-width: 900px;
  position: relative;
  max-height: 80vh;
  overflow-y: auto;
}

.close {
  position: absolute;
  right: 1rem;
  top: 0.5rem;
  font-size: 2rem;
  cursor: pointer;
  color: var(--primary-color);
}

.close:hover {
  color: var(--error-color);
}

.history-table {
  margin-top: 1rem;
}

.sale-items {
  margin: 1rem 0;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 1rem;
}

.sale-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #eee;
}

.sale-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.sale-item-quantity {
  width: 80px;
}

.sale-total {
  margin-top: 1rem;
  text-align: right;
  font-size: 1.2rem;
  font-weight: bold;
}

.sale-actions {
  margin-top: 1rem;
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

.confirm-sale {
  background-color: var(--success-color);
}

.cancel-sale {
  background-color: var(--error-color);
}