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

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

.container {
  max-width: 700px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

h1 {
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 1.8rem;
  color: #16213e;
}

/* Dashboard cards */
.dashboard {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.card {
  background: #fff;
  border-radius: 12px;
  padding: 1.25rem 1rem;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.card-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #666;
}

.card-value {
  font-size: 2rem;
  font-weight: 700;
}

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

#card-goal .card-value { color: #0f3460; }
#card-consumed .card-value { color: #e94560; }
#card-remaining .card-value { color: #00a896; }
#card-remaining.exceeded .card-value { color: #d32f2f; }
#card-remaining.exceeded { background: #fdecea; }

/* Progress bar */
.progress-bar-container {
  background: #e0e0e0;
  border-radius: 6px;
  height: 10px;
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: 6px;
  background: #00a896;
  width: 0%;
  transition: width 0.4s ease, background 0.3s ease;
}

.progress-bar.exceeded {
  background: #d32f2f;
}

/* Forms */
.forms {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.form-section {
  background: #fff;
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.form-section h2 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
  color: #16213e;
}

.form-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.form-row input,
.form-row select {
  flex: 1;
  min-width: 100px;
  padding: 0.6rem 0.75rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 0.9rem;
  background: #fafafa;
}

.form-row input:focus,
.form-row select:focus {
  outline: none;
  border-color: #0f3460;
  background: #fff;
}

.form-row button {
  padding: 0.6rem 1.25rem;
  border: none;
  border-radius: 8px;
  background: #0f3460;
  color: #fff;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
}

.form-row button:hover {
  background: #16213e;
}

/* Entries */
.entries-section {
  background: #fff;
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.entries-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.entries-header h2 {
  font-size: 1rem;
  color: #16213e;
}

.btn-danger {
  padding: 0.4rem 0.9rem;
  border: none;
  border-radius: 8px;
  background: #e94560;
  color: #fff;
  font-size: 0.8rem;
  cursor: pointer;
}

.btn-danger:hover {
  background: #c62a45;
}

.entry-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid #f0f0f0;
}

.entry-item:last-child {
  border-bottom: none;
}

.entry-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.entry-meal {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #999;
}

.entry-desc {
  font-size: 0.95rem;
}

.entry-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.entry-kcal {
  font-weight: 600;
  font-size: 1rem;
  color: #e94560;
  white-space: nowrap;
}

.entry-delete {
  background: none;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  font-size: 0.8rem;
  color: #999;
}

.entry-delete:hover {
  background: #fdecea;
  border-color: #e94560;
  color: #e94560;
}

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

/* Responsive */
@media (max-width: 500px) {
  .dashboard {
    grid-template-columns: 1fr;
  }
  .form-row {
    flex-direction: column;
  }
  .form-row input,
  .form-row select {
    min-width: unset;
  }
}
