:root {
  --bruin-0: #24160d;
  --bruin-1: #33211a;
  --bruin-2: #4a3226;
  --groen: #1e3a26;
  --groen-2: #2e5a3b;
  --wit: #ffffff;
  --wit-dim: #d9cfc7;
  --lichtgroen: #a9e5a5;
  --lichtgeel: #fbe98c;
  --lichtrood: #f4a6a6;
  --zwart: #111111;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  background: var(--bruin-0);
  color: var(--wit);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
}

button, input { font: inherit; }
button { cursor: pointer; }

/* Login */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-box { width: 100%; max-width: 320px; display: flex; flex-direction: column; gap: 16px; }
.login-label { text-align: center; font-size: 14px; font-weight: 500; }
.login-input {
  width: 100%; background: var(--bruin-1); border: 1px solid var(--bruin-2); color: var(--wit);
  border-radius: 10px; padding: 12px 16px; text-align: center; font-size: 18px; outline: none;
}
.login-input:focus { border-color: var(--groen-2); box-shadow: 0 0 0 2px var(--groen-2); }
.login-error { color: var(--lichtrood); font-size: 14px; text-align: center; margin: 0; }

/* Header */
.header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--groen); padding: 14px 16px; padding-top: calc(14px + env(safe-area-inset-top));
}
.title { margin: 0; font-size: 22px; font-weight: 700; }
.menu-wrap { position: relative; }
.menu-btn { background: none; border: 0; color: var(--wit); padding: 4px; display: flex; }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 190px;
  background: var(--bruin-1); border: 1px solid var(--bruin-2); border-radius: 12px;
  overflow: hidden; box-shadow: 0 8px 24px rgba(0,0,0,.45);
}
.menu a { display: block; padding: 14px 16px; color: var(--wit); text-decoration: none; border-bottom: 1px solid var(--bruin-2); }
.menu a:last-child { border-bottom: 0; }
.menu a:active { background: var(--groen); }

.divider { border: 0; border-top: 2px solid var(--groen-2); margin: 0 16px; }
.header + .divider { margin: 0; }

.view { padding: 16px; max-width: 520px; margin: 0 auto; }

/* Form */
.field { margin-bottom: 14px; }
.field label, .field .label { display: block; font-size: 14px; color: var(--wit-dim); margin-bottom: 6px; }
.field input, .zoek {
  width: 100%; background: var(--bruin-1); border: 1px solid var(--bruin-2); color: var(--wit);
  border-radius: 10px; padding: 12px 14px; outline: none;
}
.field input:focus, .zoek:focus { border-color: var(--groen-2); }

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg button, .chips button {
  background: var(--bruin-1); border: 1px solid var(--bruin-2); color: var(--wit);
  border-radius: 10px; padding: 11px 8px;
}
.seg button.on, .chips button.on { background: var(--groen-2); border-color: var(--groen-2); font-weight: 600; }

.btn-primary {
  width: 100%; background: var(--groen-2); color: var(--wit); border: 0; border-radius: 12px;
  padding: 14px; font-size: 17px; font-weight: 600; margin: 6px 0 18px;
}
.btn-primary:active { background: var(--groen); }
.btn-primary:disabled { opacity: .45; }
.login .btn-primary { margin: 0; }

#resultaat { padding-top: 16px; }

/* Laden */
.laden { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 28px 0; text-align: center; color: var(--wit-dim); }
.spinner {
  width: 40px; height: 40px; border-radius: 50%;
  border: 4px solid var(--bruin-2); border-top-color: var(--lichtgroen);
  animation: draai .9s linear infinite;
}
@keyframes draai { to { transform: rotate(360deg); } }

.fout { background: var(--bruin-1); border: 1px solid var(--lichtrood); color: var(--wit); border-radius: 12px; padding: 14px; }

/* Recept */
.recept { background: var(--bruin-1); border: 1px solid var(--bruin-2); border-radius: 14px; padding: 16px; }
.recept h3 { margin: 0 0 4px; font-size: 20px; }
.recept .omschrijving { margin: 0 0 12px; color: var(--wit-dim); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tag { background: var(--groen); border-radius: 999px; padding: 3px 10px; font-size: 13px; }
.voeding { font-size: 13px; color: var(--wit-dim); margin-bottom: 12px; }
.recept h4 { margin: 12px 0 6px; font-size: 15px; color: var(--lichtgroen); }
.recept ul, .recept ol { margin: 0; padding-left: 20px; }
.recept li { margin-bottom: 3px; }

.oordeel { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.oordeel button { border: 0; border-radius: 12px; padding: 14px 4px; font-weight: 700; font-size: 16px; color: var(--zwart); }
.oordeel button:disabled { opacity: .5; }
.opgeslagen { margin: 14px 0 0; text-align: center; color: var(--lichtgroen); font-weight: 600; }
.b-lekker { background: var(--lichtgroen); }
.b-misschien { background: var(--lichtgeel); }
.b-bah { background: var(--lichtrood); }

/* Lijsten */
.lijst-titel { margin: 0 0 12px; font-size: 20px; }
.zoek { margin-bottom: 10px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 10px; }
.chips button { padding: 7px 12px; white-space: nowrap; font-size: 14px; flex-shrink: 0; }
.item { background: var(--bruin-1); border: 1px solid var(--bruin-2); border-radius: 12px; margin-bottom: 8px; overflow: hidden; }
.item-kop { width: 100%; text-align: left; background: none; border: 0; color: var(--wit); padding: 12px 14px; }
.item-kop strong { display: block; }
.item-kop span { font-size: 13px; color: var(--wit-dim); }
.item .recept { border: 0; border-top: 1px solid var(--bruin-2); border-radius: 0; }
.acties { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.acties button { border: 0; border-radius: 10px; padding: 10px 12px; font-weight: 600; color: var(--zwart); }
.acties .b-weg { background: var(--bruin-2); color: var(--wit); }
.leeg { color: var(--wit-dim); text-align: center; padding: 24px 0; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--groen); color: var(--wit); padding: 10px 18px; border-radius: 999px;
  box-shadow: 0 6px 18px rgba(0,0,0,.4); font-size: 14px; white-space: nowrap;
}
