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

body {
  background: #0f1117;
  color: #e8eaf0;
  font-family: system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  font-size: 16px;
  line-height: 1.5;
}

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

.card {
  background: #1a1d27;
  border: 1px solid #2d3047;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.card h2 {
  font-size: 1rem;
  color: #8b91a8;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #e8eaf0;
}

/* Buttons */
.btn {
  display: inline-block;
  background: #4f8ef7;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
  line-height: 1.4;
}

.btn:hover {
  background: #3a7be0;
}

.btn:active {
  background: #2d6ecc;
}

.btn-secondary {
  background: #2d3047;
  color: #e8eaf0;
}

.btn-secondary:hover {
  background: #3a3e5c;
}

.btn-delete {
  background: #e05260;
  color: #fff;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
}

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

.btn-full {
  width: 100%;
  text-align: center;
  display: block;
}

/* Form inputs */
.form-input {
  width: 100%;
  background: #0f1117;
  border: 1px solid #2d3047;
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
  color: #e8eaf0;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s;
  margin-bottom: 0.5rem;
}

.form-input:focus {
  border-color: #4f8ef7;
}

.form-input::placeholder {
  color: #4d5270;
}

/* Grid: 2-column for search+button */
.grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  align-items: start;
}

.grid .form-input {
  margin-bottom: 0;
}

/* Dropdown */
.dropdown {
  position: absolute;
  width: 100%;
  background: #1a1d27;
  border: 1px solid #2d3047;
  border-radius: 8px;
  z-index: 100;
  max-height: 220px;
  overflow-y: auto;
  display: none;
  top: calc(100% + 4px);
  left: 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.dropdown-item {
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-size: 0.9rem;
  border-bottom: 1px solid #2d3047;
  transition: background 0.1s;
}

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

.dropdown-item:hover {
  background: #2d3047;
}

/* Meal list */
.meal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.meal-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid #2d3047;
}

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

.meal-item strong {
  display: block;
  font-size: 0.95rem;
}

.meal-values {
  font-size: 0.8rem;
  color: #8b91a8;
  display: block;
  margin-top: 0.1rem;
}

.total {
  font-size: 1.25rem;
  font-weight: 700;
  color: #4f8ef7;
}

/* Error message */
.error {
  background: rgba(224, 82, 96, 0.15);
  border: 1px solid #e05260;
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
  color: #e05260;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

/* Page header row */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.page-header-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Empty state */
.empty-state {
  color: #8b91a8;
  font-size: 0.9rem;
  text-align: center;
  padding: 1rem 0;
}
