* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f7fa;
  color: #333;
  min-height: 100vh;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 4px;
}

.subtitle {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 24px;
}

h2 {
  font-size: 1rem;
  font-weight: 600;
  color: #444;
  margin-bottom: 14px;
}

/* Form */
.form-section {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

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

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

.form-group label {
  display: block;
  font-size: 0.8rem;
  color: #555;
  margin-bottom: 4px;
  font-weight: 500;
}

.form-group input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: #4a90d9;
}

.btn-add {
  width: 100%;
  padding: 11px;
  background: #4a90d9;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-add:hover {
  background: #357abd;
}

/* Summary */
.summary {
  margin-bottom: 12px;
}

.summary.hidden {
  display: none;
}

.alert-badge {
  display: inline-block;
  background: #e74c3c;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
}

/* List */
.list-section {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.item-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.empty-msg {
  color: #aaa;
  font-size: 0.9rem;
  text-align: center;
  padding: 20px 0;
}

/* Item Card */
.item-card {
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: box-shadow 0.2s;
}

.item-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.item-card.alert {
  border-left: 4px solid #e74c3c;
  background: #fff8f8;
}

.item-card.ok {
  border-left: 4px solid #27ae60;
  background: #f8fff9;
}

.item-info {
  flex: 1;
  min-width: 0;
}

.item-name {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.78rem;
  color: #666;
}

.item-stats span {
  background: #f0f0f0;
  padding: 2px 8px;
  border-radius: 4px;
}

.item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.status-badge {
  font-size: 0.82rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.status-badge.alert {
  background: #e74c3c;
  color: #fff;
}

.status-badge.ok {
  background: #27ae60;
  color: #fff;
}

.reorder-point {
  font-size: 0.75rem;
  color: #888;
}

/* Update stock */
.update-stock {
  display: flex;
  align-items: center;
  gap: 6px;
}

.update-stock input {
  width: 70px;
  padding: 5px 7px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 0.85rem;
}

.btn-update {
  padding: 5px 10px;
  background: #4a90d9;
  color: #fff;
  border: none;
  border-radius: 5px;
  font-size: 0.8rem;
  cursor: pointer;
}

.btn-update:hover {
  background: #357abd;
}

.btn-delete {
  background: none;
  border: none;
  color: #bbb;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 2px 4px;
  line-height: 1;
  transition: color 0.2s;
}

.btn-delete:hover {
  color: #e74c3c;
}
