* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f4f1ec;
  color: #222;
}

header {
  background: #2f2f2f;
  color: white;
  padding: 20px;
}

header h1 {
  margin: 0 0 10px;
}

nav a {
  color: white;
  margin-right: 16px;
  text-decoration: none;
  font-weight: bold;
}

nav a:hover {
  text-decoration: underline;
}

main {
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 16px;
}

.card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

/* Inventory Forms */

.inventory-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

textarea {
  grid-column: 1 / -1;
  min-height: 80px;
  resize: vertical;
}

.form-buttons {
  grid-column: 1 / -1;
  display: flex;
  gap: 12px;
  margin-top: 10px;
}

input,
select,
textarea,
button {
  padding: 10px;
  border: 1px solid #bbb;
  border-radius: 6px;
  font-size: 14px;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #6b4f2a;
  box-shadow: 0 0 4px rgba(107, 79, 42, 0.3);
}

button {
  cursor: pointer;
  border: none;
  background: #6b4f2a;
  color: white;
  font-weight: bold;
  transition: background 0.2s ease;
}

button:hover {
  background: #4f3a1f;
}

button.secondary {
  background: #555;
}

button.secondary:hover {
  background: #333;
}

.delete-btn {
  background: #9b1c1c;
}

.delete-btn:hover {
  background: #7a1515;
}

/* Toolbar */

.toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.toolbar input,
.toolbar select {
  flex: 1;
  min-width: 180px;
}

/* Tables */

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 10px;
  border-bottom: 1px solid #ddd;
  text-align: left;
}

th {
  background: #eee7dc;
}

tr:hover {
  background: #faf8f4;
}

/* Status Colors */

.low-stock {
  color: #b00020;
  font-weight: bold;
}

.in-stock {
  color: #1f7a1f;
  font-weight: bold;
}

/* Login Page */

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #f4f1ec;
  padding: 20px;
}

.login-box {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #ffffff;
  padding: 32px;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.login-box h1 {
  margin: 0 0 10px;
  text-align: center;
  color: #2f2f2f;
}

.login-box input {
  width: 100%;
}

.login-box button {
  width: 100%;
  margin-top: 6px;
}

.login-box .error {
  margin: 0;
  padding: 10px;
  background: #fdecec;
  color: #9b1c1c;
  border: 1px solid #f3b6b6;
  border-radius: 6px;
  text-align: center;
}

/* Messages */

.error {
  color: #b00020;
  font-weight: bold;
}

.success {
  color: #1f7a1f;
  font-weight: bold;
}

/* Mobile */

@media (max-width: 768px) {
  form {
    grid-template-columns: 1fr;
  }

  textarea,
  .form-buttons {
    grid-column: auto;
  }

  .form-buttons {
    flex-direction: column;
  }

  nav a {
    display: inline-block;
    margin-bottom: 8px;
  }
}
