/* =========================================================
   BUDGETEER — Interface
   Terracotta · Gebroken wit · Poppins
   Modern minimaal, licht thema
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap');

:root {
  /* Kleuren */
  --wit:         #F7F3EF;
  --wit2:        #EDE8E2;
  --wit3:        #E0D9D1;
  --terra:       #C4614A;
  --terra-licht: #EAD5CF;
  --terra-dim:   #A34E3A;
  --tekst:       #2A1F1A;
  --tekst2:      #7A6A62;
  --tekst3:      #B0A098;
  --rand:        #DDD6CE;
  --rand-sterk:  #C8BFB5;

  /* Type */
  --font: 'Poppins', sans-serif;

  /* Vorm */
  --r:    10px;
  --r-sm: 6px;
  --r-lg: 16px;

  /* Overgang */
  --t: .16s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }

body {
  font-family: var(--font);
  font-weight: 400;
  background: var(--wit);
  color: var(--tekst);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--rand-sterk); border-radius: 99px; }

/* ── Typografie ─────────────────────────────────────────── */
h1 { font-size: 1.5rem; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
h2 { font-size: 1.15rem; font-weight: 600; letter-spacing: -.01em; }
h3 { font-size: .95rem; font-weight: 600; }

/* ── Layout ─────────────────────────────────────────────── */
#app { display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 60px;
  background: var(--wit);
  border-bottom: 1px solid var(--rand);
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 12px;
}

.topbar-logo {
  font-family: var(--font);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--terra);
  letter-spacing: -.01em;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.topbar-logo svg { flex-shrink: 0; }
.topbar-actions { display: flex; align-items: center; gap: 6px; }

.main {
  flex: 1;
  padding: 32px 24px 100px;
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}

/* ── Knoppen ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  font-family: var(--font);
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--t);
  white-space: nowrap;
  text-decoration: none;
  letter-spacing: .01em;
}

.btn-primary {
  background: var(--terra);
  color: #fff;
  border-color: var(--terra);
}
.btn-primary:hover { background: var(--terra-dim); border-color: var(--terra-dim); }

.btn-ghost {
  background: transparent;
  color: var(--tekst2);
  border-color: var(--rand-sterk);
}
.btn-ghost:hover { background: var(--wit2); color: var(--tekst); }

.btn-danger {
  background: transparent;
  color: var(--terra);
  border-color: var(--terra-licht);
}
.btn-danger:hover { background: var(--terra-licht); }

.btn-icon {
  padding: 7px;
  border-radius: var(--r-sm);
  background: transparent;
  border: 1px solid var(--rand);
  color: var(--tekst2);
  cursor: pointer;
  transition: var(--t);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-icon:hover { background: var(--wit2); border-color: var(--rand-sterk); color: var(--tekst); }

.btn-sm { padding: 6px 14px; font-size: .8rem; }

/* ── Formulier ───────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 5px; }
.field label {
  font-size: .72rem;
  font-weight: 600;
  color: var(--tekst3);
  text-transform: uppercase;
  letter-spacing: .07em;
}

input, select, textarea {
  background: var(--wit);
  border: 1px solid var(--rand-sterk);
  border-radius: var(--r-sm);
  color: var(--tekst);
  font-family: var(--font);
  font-size: .9rem;
  font-weight: 400;
  padding: 10px 13px;
  width: 100%;
  transition: var(--t);
  outline: none;
  -webkit-appearance: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--terra);
  box-shadow: 0 0 0 3px var(--terra-licht);
}
input::placeholder, textarea::placeholder { color: var(--tekst3); font-weight: 300; }
textarea { resize: vertical; min-height: 70px; }

.input-wrap { position: relative; }
.input-prefix {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--tekst3);
  font-size: .85rem;
  pointer-events: none;
  font-weight: 300;
}
.input-wrap input { padding-left: 26px; }

/* ── Kaart ───────────────────────────────────────────────── */
.card {
  background: #fff;
  border: 1px solid var(--rand);
  border-radius: var(--r-lg);
  padding: 22px;
}

/* ── Voortgangsbalk ──────────────────────────────────────── */
.progress-bar {
  height: 3px;
  background: var(--rand);
  border-radius: 99px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: var(--terra);
  border-radius: 99px;
  transition: width .7s cubic-bezier(.4,0,.2,1);
  min-width: 3px;
}
.progress-bar-fill.done { background: #7BAF7B; }

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 9px;
  border-radius: 99px;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.badge-must { background: var(--terra-licht); color: var(--terra); }
.badge-nice { background: #EEE9D8; color: #9A7E3A; }
.badge-done { background: #D8ECDA; color: #4A8A55; }
.badge-arch { background: var(--wit2); color: var(--tekst3); }

/* ── Hero kaart ──────────────────────────────────────────── */
.hero-card {
  background: #fff;
  border: 1px solid var(--rand);
  border-radius: var(--r-lg);
  padding: 32px 28px;
  margin-bottom: 28px;
}

.hero-eyebrow {
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--terra);
  margin-bottom: 6px;
}

.hero-total {
  font-size: clamp(2rem, 6vw, 2.8rem);
  font-weight: 600;
  color: var(--tekst);
  letter-spacing: -.03em;
  line-height: 1;
  margin-bottom: 4px;
}

.hero-sub { font-size: .82rem; color: var(--tekst2); font-weight: 300; margin-bottom: 24px; }

.hero-lijn {
  height: 1px;
  background: var(--rand);
  margin: 20px 0;
}

.hero-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.hero-split-item { padding: 4px 0; }
.hero-split-item:first-child { border-right: 1px solid var(--rand); padding-right: 20px; }
.hero-split-item:last-child { padding-left: 20px; }

.hero-split-label {
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--tekst3);
  margin-bottom: 3px;
}
.hero-split-amount {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -.015em;
}
.must-color { color: var(--terra); }
.nice-color { color: #9A7E3A; }

.hero-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: .75rem;
  color: var(--tekst3);
  font-weight: 300;
  margin-bottom: 8px;
}
.hero-pct { font-weight: 600; color: var(--tekst2); }

/* ── Toolbar ─────────────────────────────────────────────── */
.toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.toolbar-title {
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--tekst3);
  flex: 1;
}

/* ── Lijstkaart ──────────────────────────────────────────── */
.list-card {
  background: #fff;
  border: 1px solid var(--rand);
  border-radius: var(--r);
  padding: 18px 20px;
  cursor: pointer;
  transition: border-color var(--t), transform var(--t);
  margin-bottom: 8px;
}
.list-card:hover { border-color: var(--terra-licht); transform: translateY(-1px); }
.list-card.done { border-left: 2px solid #7BAF7B; }

.list-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.list-card-title { font-size: .95rem; font-weight: 600; letter-spacing: -.01em; }
.list-card-creator { font-size: .72rem; color: var(--tekst3); font-weight: 300; margin-top: 1px; }

.list-card-right { text-align: right; flex-shrink: 0; }
.list-card-amount { font-size: 1rem; font-weight: 600; letter-spacing: -.01em; color: var(--tekst); }
.list-card-goal { font-size: .75rem; color: var(--tekst3); font-weight: 300; }

.list-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}
.list-card-meta { display: flex; gap: 5px; flex-wrap: wrap; }
.list-card-pct { font-size: .75rem; color: var(--tekst3); font-weight: 300; }

/* ── Detailpagina ────────────────────────────────────────── */
.detail-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.back-btn {
  background: none;
  border: none;
  color: var(--tekst2);
  cursor: pointer;
  padding: 5px;
  border-radius: var(--r-sm);
  transition: var(--t);
  display: flex;
  align-items: center;
}
.back-btn:hover { background: var(--wit2); color: var(--tekst); }

.detail-acties { display: flex; gap: 5px; margin-left: auto; }

/* Spaarbedrag kaart */
.spaar-card {
  background: #fff;
  border: 1px solid var(--rand);
  border-radius: var(--r-lg);
  padding: 24px;
  margin-bottom: 20px;
}
.spaar-bedrag {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -.03em;
  color: var(--tekst);
  line-height: 1;
}
.spaar-doel { font-size: .82rem; color: var(--tekst3); font-weight: 300; margin-top: 2px; margin-bottom: 18px; }
.spaar-footer {
  display: flex;
  justify-content: space-between;
  font-size: .75rem;
  color: var(--tekst3);
  font-weight: 300;
  margin-top: 8px;
}

/* ── Posten ──────────────────────────────────────────────── */
.items-section { margin-top: 24px; }
.items-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rand);
}
.items-section-title {
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--tekst3);
}
.items-section-total {
  font-size: .8rem;
  font-weight: 600;
  color: var(--tekst2);
}

.item-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--rand);
  transition: var(--t);
}
.item-row:last-child { border-bottom: none; }

.item-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 1px;
}
.item-dot-must { background: var(--terra); }
.item-dot-nice { background: #C4A855; }

.item-info { flex: 1; min-width: 0; }
.item-name { font-size: .88rem; font-weight: 500; }
.item-note { font-size: .72rem; color: var(--tekst3); font-weight: 300; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.item-amount {
  font-size: .9rem;
  font-weight: 600;
  color: var(--tekst);
  letter-spacing: -.01em;
  min-width: 70px;
  text-align: right;
}

.item-acties { display: flex; gap: 3px; opacity: 0; transition: var(--t); }
.item-row:hover .item-acties { opacity: 1; }

/* ── Suggesties dropdown ─────────────────────────────────── */
.suggestions-box {
  position: absolute;
  top: calc(100% + 3px);
  left: 0; right: 0;
  background: #fff;
  border: 1px solid var(--rand-sterk);
  border-radius: var(--r-sm);
  z-index: 200;
  max-height: 200px;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
}
.suggestion-item {
  padding: 9px 13px;
  cursor: pointer;
  font-size: .85rem;
  transition: var(--t);
  color: var(--tekst2);
}
.suggestion-item:hover { background: var(--wit2); color: var(--terra); }

/* ── Modaal ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(42, 31, 26, .35);
  z-index: 400;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  animation: fadeIn .15s ease;
}
@media (min-width: 560px) {
  .modal-overlay { align-items: center; padding: 24px; }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: #fff;
  border: 1px solid var(--rand);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding: 28px 24px 32px;
  width: 100%;
  max-width: 440px;
  max-height: 92vh;
  overflow-y: auto;
  animation: slideUp .2s cubic-bezier(.4,0,.2,1);
}
@media (min-width: 560px) { .modal { border-radius: var(--r-lg); } }
@keyframes slideUp { from { transform: translateY(32px); opacity: 0; } to { transform: none; opacity: 1; } }

.modal-title {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -.01em;
  margin-bottom: 22px;
}
.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 22px;
  flex-wrap: wrap;
}

/* ── Suggesties rij ──────────────────────────────────────── */
.suggest-grid {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 280px;
  overflow-y: auto;
  margin: 12px 0;
}
.suggest-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--wit);
  border: 1px solid var(--rand);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: var(--t);
}
.suggest-row.selected { border-color: var(--terra); background: var(--terra-licht); }
.suggest-row-name { flex: 1; font-size: .85rem; font-weight: 400; }
.suggest-row-amount { font-size: .82rem; font-weight: 600; color: var(--terra); }

.check-circle {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--rand-sterk);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--t);
}
.suggest-row.selected .check-circle { background: var(--terra); border-color: var(--terra); }

/* ── Prioriteit toggle ───────────────────────────────────── */
.priority-toggle {
  display: flex;
  border: 1px solid var(--rand-sterk);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.priority-toggle button {
  flex: 1;
  padding: 9px;
  background: none;
  border: none;
  color: var(--tekst3);
  font-family: var(--font);
  font-size: .82rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--t);
  border-right: 1px solid var(--rand-sterk);
}
.priority-toggle button:last-child { border-right: none; }
.priority-toggle button.active-must { background: var(--terra-licht); color: var(--terra); }
.priority-toggle button.active-nice { background: #EEE9D8; color: #9A7E3A; }

/* ── Toast ───────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}
.toast {
  background: var(--tekst);
  border-radius: 99px;
  padding: 9px 20px;
  font-family: var(--font);
  font-size: .8rem;
  font-weight: 500;
  color: var(--wit);
  animation: toastIn .2s ease;
  white-space: nowrap;
  letter-spacing: .01em;
}
.toast.ok   { background: #4A8A55; }
.toast.err  { background: var(--terra); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ── Login ───────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--wit);
}
.login-card {
  background: #fff;
  border: 1px solid var(--rand);
  border-radius: var(--r-lg);
  padding: 40px 36px;
  width: 100%;
  max-width: 380px;
}
.login-logo {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--terra);
  letter-spacing: -.02em;
  margin-bottom: 4px;
}
.login-sub {
  font-size: .82rem;
  color: var(--tekst3);
  font-weight: 300;
  margin-bottom: 30px;
}

/* ── Admin ───────────────────────────────────────────────── */
.user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rand);
}
.user-row:last-child { border-bottom: none; }

.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--terra-licht);
  color: var(--terra);
  font-family: var(--font);
  font-weight: 600;
  font-size: .9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.user-info { flex: 1; }
.user-name { font-size: .9rem; font-weight: 500; }
.user-email { font-size: .75rem; color: var(--tekst3); font-weight: 300; }

/* ── Lege staat ──────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 56px 24px;
  color: var(--tekst3);
}
.empty-state-icon { font-size: 2.2rem; margin-bottom: 10px; opacity: .5; }
.empty-state p { font-size: .85rem; font-weight: 300; }

/* ── Spaartips ───────────────────────────────────────────── */
.tips-section {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--rand);
}
.tips-label {
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--tekst3);
  margin-bottom: 10px;
}
.tips-carousel {
  background: #fff;
  border: 1px solid var(--rand);
  border-radius: var(--r);
  padding: 18px 20px;
  min-height: 80px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.tip-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 1px; }
.tip-text {
  font-size: .83rem;
  line-height: 1.65;
  color: var(--tekst2);
  font-weight: 300;
  animation: tipFade .4s ease;
}
@keyframes tipFade { from { opacity: 0; } to { opacity: 1; } }

.tip-dots {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin-top: 10px;
}
.tip-dot {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--rand-sterk);
  transition: background .3s, width .3s;
  cursor: pointer;
}
.tip-dot.active { background: var(--terra); width: 16px; border-radius: 99px; }

/* ── Divider ─────────────────────────────────────────────── */
.divider { height: 1px; background: var(--rand); margin: 16px 0; }

/* ── Utils ───────────────────────────────────────────────── */
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.flex  { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.text-sm    { font-size: .82rem; }
.text-muted { color: var(--tekst2); }
.text-terra { color: var(--terra); }
.text-right { text-align: right; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.font-light { font-weight: 300; }

@media (max-width: 480px) {
  .grid-2 { grid-template-columns: 1fr; }
  .hero-split-item:first-child { border-right: none; border-bottom: 1px solid var(--rand); padding-right: 0; padding-bottom: 14px; }
  .hero-split-item:last-child { padding-left: 0; padding-top: 14px; }
  .main { padding: 20px 16px 100px; }
  .topbar { padding: 0 16px; }
  .login-card { padding: 28px 20px; }
}
