* {
  box-sizing: border-box;
}

.new-expense-container {
  color: #333;
  padding: 20px;
}

.new-expense-container * {
  box-sizing: border-box;
}

.form-card {
  background-color: #fff;
  border-radius: 10px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.form-id {
  font-weight: bold;
  font-size: 18px;
}

.back-button {
  background-color: #6c757d;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  transition: background-color 0.2s;
}

.back-button:hover {
  background-color: #5a6268;
}

.back-button:active {
  background-color: #545b62;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 30px;
}

.form-grid > div {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.form-grid label {
  font-weight: bold;
  font-size: 14px;
  margin-bottom: 5px;
  display: block;
  color: #333;
}

.form-grid input,
.form-grid select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  background-color: #f9f9f9;
  transition: border-color 0.2s, background-color 0.2s;
  box-sizing: border-box;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
}

.form-grid input:focus,
.form-grid select:focus {
  outline: none;
  border-color: #5D1A2A;
  background-color: #fff;
}

.form-grid input:disabled,
.form-grid select:disabled {
  background-color: #e9ecef;
  cursor: not-allowed;
  opacity: 0.7;
}

.form-grid input[type="text"],
.form-grid input[type="number"],
.form-grid input[type="date"] {
  width: 100%;
  box-sizing: border-box;
  -webkit-appearance: none;
  -moz-appearance: textfield;
  appearance: none;
}

.form-grid input[type="number"]::-webkit-outer-spin-button,
.form-grid input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.checkbox-field {
  display: flex;
  flex-direction: row !important;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  padding: 4px 0;
}

.checkbox-field label {
  margin-bottom: 0 !important;
  font-weight: bold;
  font-size: 14px;
  color: #333;
  line-height: 1;
}

.checkbox-field input[type="checkbox"] {
  width: 14px !important;
  height: 14px !important;
  min-width: 14px;
  min-height: 14px;
  cursor: pointer;
  accent-color: #5D1A2A;
  flex-shrink: 0;
  margin: 0;
}

.save-button-wrapper {
  display: flex;
  justify-content: flex-end;
  margin-top: 30px;
}

.save-button {
  background-color: #ffc107;
  color: #000;
  padding: 10px 30px;
  font-weight: bold;
  border: none;
  border-radius: 20px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.1s ease;
}

.save-button:hover {
  background-color: #f4b400;
  transform: translateY(-1px);
}

.save-button:active {
  transform: translateY(0);
}

.save-button:disabled {
  background-color: #e0e0e0;
  color: #999;
  cursor: not-allowed;
  transform: none;
}

.product-table-section {
  margin-top: 25px;
  overflow-x: auto;
}

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

.product-table th, .product-table td {
  border: 1px solid #d4af37;
  padding: 8px;
  text-align: center;
}

.product-table th {
  background-color: #800020;
  color: white;
  font-weight: bold;
}

.add-product-row {
  cursor: pointer;
  color: #d4af37;
  text-align: center;
  padding: 10px;
  font-style: italic;
}

.tax-pill {
  background-color: white;
  border: 1px solid #d4af37;
  border-radius: 12px;
  padding: 2px 6px;
  color: #800020;
}

.product-table tfoot td {
  border-top: 2px solid #d4af37;
  padding: 8px;
}

.add-products {
  width: 100%;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 2px solid #e0e0e0;
}

.add-products h3 {
  color: #333;
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 15px;
}

@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .form-card {
    padding: 16px;
  }

  .checkbox-field {
    padding: 10px 0;
  }
}
