:root {
  --bg: #f7f2e8;
  --text: #1c1914;
  --muted: #6f6356;
  --card: #ffffff;
  --accent: #2f5d50;
  --accent-2: #e6e1d8;
  --border: #e0d9cf;
  --shadow: rgba(32, 26, 18, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Trebuchet MS", "Gill Sans", "Verdana", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top left, #faf6ee 0%, #f0e8db 50%, #efe4d5 100%);
  min-height: 100vh;
}

h2,
h3 {
  margin: 0;
}

.topbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
  box-shadow: 0 1px 4px var(--shadow);
}

.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  font-size: 22px;
  font-weight: 700;
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tab {
  border: 1px solid var(--border);
  background: var(--accent-2);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 16px;
  cursor: pointer;
}

.tab.is-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

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

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.filters {
  display: flex;
  gap: 12px;
  margin: 12px 0;
}

.filters input,
.filters select {
  flex: 1;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin: 16px 0;
  box-shadow: 0 2px 8px var(--shadow);
  animation: fadeIn 200ms ease-out;
}

.row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.meal-type-row {
  align-items: center;
  flex-wrap: wrap;
}

.toggle-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.toggle-group .toggle {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
}

.toggle-group .toggle.is-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.list {
  margin-top: 12px;
}

input,
select,
button {
  font-size: 16px;
}

input,
select {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
}

button.primary {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 12px 16px;
  cursor: pointer;
}

button.secondary {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  cursor: pointer;
}

.download-row {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.tab-panel {
  display: none;
  animation: fadeIn 180ms ease-out;
}

.tab-panel.is-active {
  display: block;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal.is-hidden {
  display: none;
}

.modal-card {
  background: var(--card);
  border-radius: 14px;
  padding: 16px;
  width: 100%;
  max-width: 420px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 20px var(--shadow);
}

.modal-card form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-card label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 10px;
  background: #fff;
}

.list-title {
  font-weight: 700;
}

.list-sub {
  color: var(--muted);
  font-size: 14px;
}

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

.muted {
  color: var(--muted);
  font-size: 14px;
  margin-top: 8px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 640px) {
  .row,
  .filters,
  .download-row,
  .panel-header {
    flex-direction: column;
    align-items: stretch;
  }
  .tabs {
    flex-wrap: wrap;
  }
}
