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

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

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px;
}

header {
  background: #2e7d32;
  color: #fff;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  text-align: center;
}

header h1 {
  font-size: 1.5rem;
  font-weight: 700;
}

header .subtitle {
  font-size: 0.85rem;
  opacity: 0.85;
  margin-top: 4px;
}

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

h2 {
  font-size: 1rem;
  font-weight: 700;
  color: #2e7d32;
  margin-bottom: 14px;
}

.form-group {
  margin-bottom: 12px;
}

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

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

.form-group input:focus {
  border-color: #2e7d32;
}

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

.btn {
  border: none;
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  width: 100%;
}

.btn-primary {
  background: #2e7d32;
  color: #fff;
}

.btn-primary:hover {
  background: #1b5e20;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.section-header h2 {
  margin-bottom: 0;
}

.badge {
  background: #e8f5e9;
  color: #2e7d32;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 20px;
}

.food-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.food-card {
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 14px;
  background: #fafafa;
}

.food-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.food-card-name {
  font-size: 1rem;
  font-weight: 700;
  color: #222;
}

.food-card-date {
  font-size: 0.75rem;
  color: #999;
}

.food-card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.stat-box {
  background: #fff;
  border: 1px solid #e8f5e9;
  border-radius: 8px;
  padding: 8px;
  text-align: center;
}

.stat-box .stat-label {
  font-size: 0.65rem;
  color: #777;
  font-weight: 600;
  display: block;
  margin-bottom: 2px;
}

.stat-box .stat-value {
  font-size: 1rem;
  font-weight: 700;
  color: #333;
}

.stat-box.highlight {
  background: #e8f5e9;
  border-color: #2e7d32;
}

.stat-box.highlight .stat-value {
  color: #2e7d32;
}

.food-card-history {
  font-size: 0.75rem;
  color: #888;
  margin-bottom: 10px;
}

.food-card-actions {
  display: flex;
  gap: 8px;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s;
}

.btn-add-record {
  background: #e8f5e9;
  color: #2e7d32;
  flex: 1;
}

.btn-add-record:hover {
  background: #c8e6c9;
}

.btn-delete {
  background: #fce4ec;
  color: #c62828;
}

.btn-delete:hover {
  background: #f8bbd0;
}

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

  .food-card-stats {
    grid-template-columns: 1fr 1fr 1fr;
  }
}
