:root {
  --groen: #1f6b45;
  --groen-licht: #e8f3ec;
  --groen-fel: #2f9e63;
  --achtergrond: #f6f7f4;
  --kaart: #ffffff;
  --tekst: #16201a;
  --dim: #6b7a70;
  --rand: #e2e7e2;
  --dorst: #c2410c;
  --dorst-zacht: #fdf0e8;
  --binnenkort: #b4881a;
  --radius: 16px;
  --schaduw: 0 1px 3px rgba(20, 40, 30, .07), 0 6px 20px rgba(20, 40, 30, .05);
  --tabhoogte: calc(62px + env(safe-area-inset-bottom));
}

@media (prefers-color-scheme: dark) {
  :root {
    --groen: #4cae7c;
    --groen-licht: #17281f;
    --groen-fel: #4cae7c;
    --achtergrond: #101512;
    --kaart: #1a211d;
    --tekst: #e8efe9;
    --dim: #93a399;
    --rand: #2a332d;
    --dorst: #f08a5d;
    --dorst-zacht: #2a1d16;
    --binnenkort: #d6b357;
    --schaduw: 0 1px 3px rgba(0, 0, 0, .3);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--achtergrond);
  color: var(--tekst);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overscroll-behavior-y: none;
}

body { padding-bottom: env(safe-area-inset-bottom); }

.verborgen { display: none !important; }
.dim { color: var(--dim); }
.klein { font-size: 14px; }
.fout { color: var(--dorst); font-size: 14px; }
.laden { color: var(--dim); text-align: center; padding: 40px 0; }

h1 { font-size: 26px; margin: 0; letter-spacing: -.02em; }
h2 { font-size: 17px; margin: 0 0 6px; }
h3 { font-size: 15px; margin: 0; }
p { margin: 0 0 8px; }

/* ------------------------------------------------------------ layout */

.scherm { padding: 0; }
.scherm.volledig { position: fixed; inset: 0; background: var(--achtergrond); overflow-y: auto; z-index: 20; -webkit-overflow-scrolling: touch; }

.kop {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
  padding: calc(env(safe-area-inset-top) + 20px) 66px 12px 20px;
}

.inhoud { padding: 0 20px calc(var(--tabhoogte) + 24px); }

#app > .scherm { min-height: 100vh; }

/* ------------------------------------------------------------ inloggen */

#scherm-inloggen { display: flex; align-items: center; justify-content: center; padding: 24px; }
.inlog-doos { width: 100%; max-width: 320px; text-align: center; }
.inlog-blad { font-size: 56px; margin-bottom: 8px; }
.inlog-doos h1 { margin-bottom: 4px; }
.inlog-doos form { margin-top: 24px; display: grid; gap: 12px; }

input[type=password], input[type=text], input[type=number], input[type=date], textarea, select {
  width: 100%;
  padding: 13px 14px;
  font-size: 16px;
  font-family: inherit;
  color: var(--tekst);
  background: var(--kaart);
  border: 1px solid var(--rand);
  border-radius: 12px;
  -webkit-appearance: none;
  appearance: none;
}
textarea { min-height: 76px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--groen-fel); outline-offset: -1px; }
label.veld { display: block; margin-bottom: 14px; }
label.veld > span { display: block; font-size: 13px; font-weight: 600; color: var(--dim); margin-bottom: 5px; }

/* ------------------------------------------------------------ knoppen */

.knop {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 18px;
  font: inherit; font-weight: 600; font-size: 15px;
  color: var(--tekst);
  background: var(--kaart);
  border: 1px solid var(--rand);
  border-radius: 12px;
  cursor: pointer;
}
.knop:active { transform: scale(.98); }
.knop.primair { background: var(--groen); border-color: var(--groen); color: #fff; }
.knop.breed { width: 100%; }
.knop.plat { background: none; border-color: transparent; color: var(--dim); }
.knop.gevaar { color: var(--dorst); border-color: var(--rand); }
.knop.klein { padding: 8px 12px; font-size: 14px; }
.knop:disabled { opacity: .5; }
.knoprij { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.knoprij.verticaal { flex-direction: column; }
.tekstknop { background: none; border: 0; font: inherit; font-size: 15px; color: var(--groen); cursor: pointer; padding: 6px; }
.primair-tekst { font-weight: 700; }
.terug { background: none; border: 0; font: inherit; font-size: 16px; color: var(--groen); padding: 6px 0; cursor: pointer; }

/* ------------------------------------------------------------ kaarten */

.kaart {
  background: var(--kaart);
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--schaduw);
}

.badge {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; background: var(--groen-licht); color: var(--groen);
}
.badge.winter { background: #e6f0f7; color: #2a6489; }
.badge.dorst { background: var(--dorst-zacht); color: var(--dorst); }
.badge.laag { background: var(--dorst-zacht); color: var(--dorst); }
.badge.midden { background: #fdf6e3; color: var(--binnenkort); }

/* ------------------------------------------------------------ vandaag */

.sectie-kop { display: flex; justify-content: space-between; align-items: center; margin: 22px 2px 10px; }
.sectie-kop h2 { margin: 0; }

.taak {
  display: flex; align-items: center; gap: 13px;
  background: var(--kaart); border: 1px solid var(--rand); border-radius: var(--radius);
  padding: 11px 12px; margin-bottom: 9px; box-shadow: var(--schaduw);
}
.taak.dorst { border-color: color-mix(in srgb, var(--dorst) 35%, var(--rand)); }
.taak .duim { width: 50px; height: 50px; border-radius: 12px; object-fit: cover; flex: 0 0 auto; background: var(--groen-licht); }
.taak .duim.leeg { display: flex; align-items: center; justify-content: center; font-size: 24px; }
.taak .midden { flex: 1; min-width: 0; }
.taak .midden strong { display: block; font-size: 16px; }
.taak .midden span { font-size: 13px; color: var(--dim); }
.vink {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%;
  border: 1.5px solid var(--groen); background: none; color: var(--groen);
  font-size: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.vink.klaar { background: var(--groen); color: #fff; }

.leeg-blok { text-align: center; padding: 44px 20px; }
.leeg-blok .groot { font-size: 46px; }

/* ------------------------------------------------------------ planten */

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 20px 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; padding: 7px 14px; border-radius: 999px; font-size: 14px; font-weight: 500;
  background: var(--kaart); border: 1px solid var(--rand); color: var(--tekst); cursor: pointer;
}
.chip.actief { background: var(--groen); border-color: var(--groen); color: #fff; }

.raster { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.plantkaart {
  background: var(--kaart); border: 1px solid var(--rand); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; box-shadow: var(--schaduw); text-align: left; padding: 0;
  font: inherit; color: inherit;
}
.plantkaart .beeld { aspect-ratio: 1; width: 100%; object-fit: cover; display: block; background: var(--groen-licht); }
.plantkaart .beeld.leeg { display: flex; align-items: center; justify-content: center; font-size: 40px; }
.plantkaart .tekst { padding: 10px 11px 12px; }
.plantkaart strong { display: block; font-size: 15px; line-height: 1.25; }
.plantkaart em { display: block; font-style: normal; font-size: 12px; color: var(--dim); margin-top: 1px; }
.plantkaart .status { margin-top: 7px; font-size: 12px; font-weight: 600; color: var(--groen); }
.plantkaart .status.dorst { color: var(--dorst); }
.plantkaart .status.binnenkort { color: var(--binnenkort); }

/* ------------------------------------------------------------ tabbalk */

.tabbalk {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  display: flex; align-items: center; justify-content: space-around;
  height: var(--tabhoogte); padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--kaart) 88%, transparent);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-top: 1px solid var(--rand);
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: none; border: 0; font: inherit; font-size: 11px; font-weight: 600;
  color: var(--dim); cursor: pointer; padding: 6px 0;
}
.tab.actief { color: var(--groen); }
.tab-icoon { font-size: 21px; line-height: 1; filter: grayscale(1) opacity(.65); }
.tab.actief .tab-icoon { filter: none; }
.tab.camera { flex: 0 0 auto; }
.camera-bol {
  width: 54px; height: 54px; border-radius: 50%; background: var(--groen); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 300;
  box-shadow: 0 4px 14px rgba(31, 107, 69, .35); margin-top: -14px;
}
.tab-meer {
  position: fixed; top: calc(env(safe-area-inset-top) + 22px); right: 18px; z-index: 16;
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--rand);
  background: var(--kaart); color: var(--dim); font-size: 17px; cursor: pointer;
}

/* ------------------------------------------------------------ detail */

.paneel { animation: omhoog .22s ease-out; }
@keyframes omhoog { from { transform: translateY(14px); opacity: .4; } to { transform: none; opacity: 1; } }

.detail-kop {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(env(safe-area-inset-top) + 10px) 18px 10px;
  background: color-mix(in srgb, var(--achtergrond) 92%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  font-size: 15px; font-weight: 600;
}

.held { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: var(--groen-licht); display: block; }
.held.leeg { display: flex; align-items: center; justify-content: center; font-size: 64px; }
.detail-body { padding: 18px 20px 60px; }
.detail-body h1 { font-size: 27px; }
.detail-body .latijn { font-style: italic; color: var(--dim); margin-bottom: 10px; }

.feiten { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0; }
.feit { background: var(--kaart); border: 1px solid var(--rand); border-radius: 14px; padding: 12px; }
.feit .label { font-size: 12px; color: var(--dim); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.feit .waarde { font-size: 20px; font-weight: 700; margin-top: 3px; }
.feit .waarde.dorst { color: var(--dorst); }
.feit .sub { font-size: 12px; color: var(--dim); }

.verzorgrij { display: flex; gap: 11px; padding: 12px 0; border-bottom: 1px solid var(--rand); }
.verzorgrij:last-child { border-bottom: 0; }
.verzorgrij .ic { font-size: 19px; flex: 0 0 24px; text-align: center; }
.verzorgrij .tk { flex: 1; }
.verzorgrij .tk b { display: block; font-size: 13px; color: var(--dim); font-weight: 600; }

.logrij { display: flex; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--rand); align-items: flex-start; }
.logrij:last-child { border-bottom: 0; }
.logrij .ic { font-size: 17px; flex: 0 0 24px; text-align: center; }
.logrij .datum { font-size: 12px; color: var(--dim); }
.logrij img { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; margin-top: 6px; }

/* ------------------------------------------------------------ nieuw */

.stap { padding: 24px 20px 60px; }
.foto-uitleg { text-align: center; padding: 36px 10px 24px; }
.groot-blad { font-size: 62px; }
.analyse-foto { width: 100%; max-height: 46vh; object-fit: cover; border-radius: var(--radius); }
.analyse-tekst { text-align: center; padding: 26px 0; }
.spinner {
  width: 30px; height: 30px; margin: 0 auto 14px;
  border: 3px solid var(--rand); border-top-color: var(--groen);
  border-radius: 50%; animation: draai .8s linear infinite;
}
@keyframes draai { to { transform: rotate(360deg); } }

.voorbeeld-foto { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--radius); margin-bottom: 16px; }

/* ------------------------------------------------------------ toast */

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabhoogte) + 16px); transform: translateX(-50%);
  z-index: 50; max-width: 90vw;
  background: #16201a; color: #fff; padding: 11px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 500; box-shadow: 0 6px 24px rgba(0,0,0,.25);
  animation: opkomen .2s ease-out;
}
@keyframes opkomen { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

@media (min-width: 640px) {
  .raster { grid-template-columns: repeat(3, 1fr); }
  #app > .scherm, .scherm.volledig > * { max-width: 720px; margin-inline: auto; }
}
