/* Daan & Ankili — vrolijk, overzichtelijk, mobiel én desktop */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: #fefaf4;
  color: #292524;
}
.wrap { max-width: 1100px; margin: 0 auto; padding: 20px 16px 110px; }
@media (min-width: 768px) { .wrap { padding-bottom: 40px; } }

/* ---- Navigatie ---- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 6px;
  padding: 10px 16px;
  background: rgba(255,255,255,.9); backdrop-filter: blur(6px);
  border-bottom: 1px solid #fde9c8;
}
.brand {
  font-weight: 800; font-size: 18px; text-decoration: none; margin-right: 12px;
  background: linear-gradient(90deg, #f59e0b, #f43f5e);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  white-space: nowrap;
}
.tabs { display: none; }
.userbox { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.username { font-weight: 600; color: #57534e; font-size: 14px; }
.logout {
  font-size: 13px; color: #a8a29e; text-decoration: none;
  padding: 6px 12px; border-radius: 999px; background: #f5f5f4;
}
.logout:hover { color: #44403c; }
/* Zwevende, afgeronde balk; alleen het actieve tabblad toont zijn naam */
.bottombar {
  position: fixed; left: 10px; right: 10px; bottom: 10px; z-index: 30;
  display: flex; justify-content: space-between; align-items: center;
  background: rgba(255, 255, 255, .96); backdrop-filter: blur(8px);
  border: 1px solid #f3ede1; border-radius: 999px;
  padding: 6px 8px;
  padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 8px 28px rgba(41, 37, 36, .16);
}
.bitem {
  display: flex; align-items: center; gap: 6px; flex: 0 1 auto;
  padding: 8px 5px; border-radius: 999px;
  color: #a8a29e; text-decoration: none; line-height: 1;
}
.bitem .ico { font-size: 19px; line-height: 1; }
.bitem span:last-child {
  display: none; font-size: 12.5px; font-weight: 700;
  white-space: nowrap; max-width: 88px; overflow: hidden; text-overflow: ellipsis;
}
.bitem.active { background: #fef3c7; color: #92400e; padding: 8px 12px; }
.bitem.active span:last-child { display: inline; }
@media (min-width: 768px) {
  .bottombar { display: none; }
  .tabs { display: flex; gap: 2px; }
  .tab {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 12px; border-radius: 999px;
    font-size: 14px; font-weight: 600; color: #78716c;
    text-decoration: none; line-height: 1;
  }
  .tab .ico { font-size: 15px; line-height: 1; }
  .tab:hover { background: #f5f5f4; color: #292524; }
  .tab.active { background: #fef3c7; color: #92400e; }
}

/* ---- Koppen & kaarten ---- */
h1 { font-size: 24px; margin: 0 0 4px; }
.sub { color: #a8a29e; font-size: 14px; margin: 0 0 20px; }
.card {
  background: #fff; border: 1px solid #f5f5f4; border-radius: 16px;
  padding: 18px; box-shadow: 0 1px 3px rgba(0,0,0,.04); margin-bottom: 16px;
}
a.card { color: inherit; text-decoration: none; display: block; }
a.card:hover { box-shadow: 0 3px 10px rgba(0,0,0,.08); }
.card h2 { font-size: 16px; margin: 0 0 10px; color: #44403c; }
.hero-amber { background: linear-gradient(135deg, #fffbeb, #fff1f2); }
.hero-green { background: linear-gradient(135deg, #ecfdf5, #f0fdfa); }
.hero-purple { background: linear-gradient(135deg, #f5f3ff, #fdf4ff); }
.hero-blue { background: linear-gradient(135deg, #f0f9ff, #eef2ff); }
.hero-orange { background: linear-gradient(135deg, #fff7ed, #fffbeb); }
.hero-rose { background: linear-gradient(135deg, #fff1f2, #fdf2f8); }
.big { font-size: 32px; font-weight: 800; margin: 4px 0; }
.mid { font-size: 22px; font-weight: 800; margin: 4px 0; }
.label { font-size: 13px; font-weight: 600; color: #a8a29e; }
.note { font-size: 12px; color: #a8a29e; }
.grid2 { display: grid; gap: 14px; grid-template-columns: 1fr; }
.grid3 { display: grid; gap: 14px; grid-template-columns: 1fr; }
.grid4 { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
@media (min-width: 700px) {
  .grid3 { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
  .grid2 { grid-template-columns: 1fr 1fr; }
  .grid4 { grid-template-columns: repeat(4, 1fr); }
}
.grid2 .card, .grid3 .card, .grid4 .card { margin-bottom: 0; }
.grid2, .grid3, .grid4 { margin-bottom: 16px; }

/* ---- Bedragen ---- */
.money { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.money.pos { color: #059669; }
.money.neg { color: #e11d48; }
.money.zero { color: #78716c; }
.money.plain { color: #292524; }

/* ---- Formulieren ---- */
label { display: block; font-size: 12px; font-weight: 600; color: #78716c; margin-bottom: 3px; }
input, select {
  width: 100%; padding: 9px 12px; font-size: 14px;
  border: 1px solid #e7e5e4; border-radius: 12px; background: #fff;
}
input:focus, select:focus { outline: 2px solid #fcd34d; border-color: #f59e0b; }
input[type="color"] { width: 60px; height: 40px; padding: 3px; }
.formgrid { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .formgrid { grid-template-columns: repeat(3, 1fr); } .formgrid.cols2 { grid-template-columns: 1fr 1fr; } }
button, .btn {
  padding: 9px 16px; font-size: 14px; font-weight: 700;
  background: #292524; color: #fff; border: 0; border-radius: 12px; cursor: pointer;
}
button:hover, .btn:hover { background: #57534e; }
.formbox { background: #fafaf9; border-radius: 12px; padding: 12px; margin-top: 12px; }

/* ---- Knoppenrij: alle beheer-uitklappers van een kaart op één rij;
       een geopende uitklapper wordt ter plekke een blok over de volle breedte ---- */
.actionrow { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; align-items: flex-start; }
.actionrow details.expander { margin: 0; }
.actionrow details.expander[open] { flex-basis: 100%; }

/* ---- Potje-blokken ---- */
.statbox.potbox { background: #fffbeb; }
.statbox strong { font-size: 16px; }

/* ---- Uitklappers ---- */
details.expander { margin-top: 12px; }
details.expander > summary {
  display: inline-flex; align-items: center; gap: 6px;
  list-style: none; cursor: pointer;
  padding: 8px 16px; border-radius: 999px;
  font-size: 14px; font-weight: 700;
  background: #fef3c7; color: #92400e;
}
details.expander > summary::-webkit-details-marker { display: none; }
details.expander > summary::before { content: "＋ "; }
details.expander[open] > summary::before { content: "− "; }
details.expander > .body {
  margin-top: 10px; background: #fff; border: 1px solid #f5f5f4;
  border-radius: 12px; padding: 14px;
}
details.list > summary {
  list-style: none; cursor: pointer; font-size: 14px; font-weight: 700; color: #b45309;
  margin-top: 10px;
}
details.list > summary::-webkit-details-marker { display: none; }
details.list > summary:hover { text-decoration: underline; }

/* ---- Lijsten & tabellen ---- */
ul.rows { list-style: none; margin: 8px 0 0; padding: 0; }
ul.rows li {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid #f5f5f4; font-size: 14px;
}
ul.rows li:last-child { border-bottom: 0; }
ul.rows li > div:first-child { min-width: 0; }
ul.rows .when { font-size: 12px; color: #a8a29e; }
.right { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.del { color: #d6d3d1; text-decoration: none; font-size: 13px; background: none; border: 0; padding: 2px 4px; cursor: pointer; font-weight: 400; }
.del:hover { color: #e11d48; background: none; }
table.funds { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 10px; }
table.funds th { text-align: left; font-size: 11px; color: #a8a29e; font-weight: 600; padding: 4px 8px 4px 0; }
table.funds td { padding: 8px 8px 8px 0; border-top: 1px solid #f5f5f4; }
table.funds .num { text-align: right; font-variant-numeric: tabular-nums; }
table.funds th.num { text-align: right; }

/* ---- Jaargroepen in lange lijsten ---- */
details.yeargroup > summary {
  list-style: none; cursor: pointer;
  font-size: 13px; font-weight: 700; color: #78716c;
  padding: 10px 0 4px; border-bottom: 1px solid #f5f5f4;
}
details.yeargroup > summary::-webkit-details-marker { display: none; }
details.yeargroup > summary::before { content: "▸ "; color: #d6d3d1; }
details.yeargroup[open] > summary::before { content: "▾ "; }

/* ---- Grafiekkop met filters (titel links, knopjes rechts) ---- */
.cardhead {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; flex-wrap: wrap; margin-bottom: 10px;
}
.cardhead h2 { margin: 0; }

/* ---- Inzichten (Slim met jullie geld) ---- */
.inzicht {
  border-left: 4px solid #d6d3d1; border-radius: 8px;
  padding: 10px 12px; margin-bottom: 8px;
  background: #fafaf9; font-size: 14px; line-height: 1.5;
}
.inzicht.letop { border-color: #f43f5e; background: #fff1f2; }
.inzicht.tip { border-color: #f59e0b; background: #fffbeb; }
.inzicht.goed { border-color: #10b981; background: #ecfdf5; }
.inzicht a { color: #b45309; font-weight: 600; white-space: nowrap; }
.inzicht .izlink { font-size: 12.5px; }
.inzicht { position: relative; padding-right: 36px; }
.izneg { position: absolute; top: 5px; right: 5px; }
.izneg button {
  background: none; color: #a8a29e; font-size: 13px; font-weight: 700;
  padding: 4px 7px; border-radius: 999px; line-height: 1;
}
.izneg button:hover { background: rgba(0, 0, 0, .06); color: #57534e; }
.inzicht.genegeerd { border-color: #d6d3d1; background: #fafaf9; color: #a8a29e; }
.inzicht.genegeerd strong { color: inherit; }
.iztoon { display: inline; margin-left: 6px; }
.iztoon button {
  background: #f5f5f4; color: #78716c; font-size: 12px; font-weight: 700;
  padding: 3px 10px; border-radius: 999px;
}
.izcard { scroll-margin-top: 70px; }
.izstatus {
  font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
  background: #f5f5f4; color: #a8a29e;
}
.izstatus.aan { background: #fef3c7; color: #b45309; }
.izuitleg {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px;
}
.izuitleg p { margin: 3px 0 0; font-size: 13px; color: #78716c; line-height: 1.5; }
@media (max-width: 700px) { .izuitleg { grid-template-columns: 1fr; } }
.chartctrl { display: flex; gap: 6px; align-items: center; }
.chartctrl button {
  background: #f5f5f4; color: #78716c; font-size: 12px; font-weight: 700;
  padding: 5px 12px; border-radius: 999px;
}
.chartctrl button:hover { background: #e7e5e4; }
.chartctrl button.active { background: #fef3c7; color: #92400e; }
.chartctrl select {
  width: auto; padding: 4px 10px; font-size: 12px; font-weight: 700;
  color: #78716c; background: #f5f5f4; border: 0; border-radius: 999px;
}

/* ---- Voortgangsbalk ---- */
.bar { height: 10px; background: #f5f5f4; border-radius: 999px; overflow: hidden; }
.bar > div { height: 100%; background: linear-gradient(90deg, #34d399, #10b981); border-radius: 999px; }

/* ---- Meldingen ---- */
.alert { padding: 12px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; margin-bottom: 14px; }
.alert.err { background: #fff1f2; color: #be123c; }
.alert.ok { background: #ecfdf5; color: #047857; }

/* ---- Login e.d. ---- */
.authbox { max-width: 380px; margin: 60px auto 0; }
.authbox .icon { text-align: center; font-size: 40px; margin-bottom: 6px; }
.authbox h1 { text-align: center; margin-bottom: 18px; }
.authbox form { display: grid; gap: 12px; }
.authlinks { text-align: center; margin-top: 16px; font-size: 14px; }
.authlinks a { color: #d97706; font-weight: 600; text-decoration: none; }
.authlinks a.quiet { color: #a8a29e; font-weight: 400; }
.authlinks a:hover { text-decoration: underline; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
/* Links tekst (mag krimpen en binnen zichzelf omlopen), rechts het bedrag:
   het bedrag valt niet meer op een eigen regel en breekt nooit middenin. */
.flex-between { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.flex-between > :first-child { flex: 1 1 auto; min-width: 0; }
.flex-between > :last-child { flex: 0 1 auto; text-align: right; }
.flex-between .mid, .flex-between .big { white-space: nowrap; }
/* .wrap: op smalle schermen mag de rechterkant onder de tekst vallen
   (voor kaarten met een balk of tweede blok rechts) */
.flex-between.wrap { flex-wrap: wrap; }
.flex-between.wrap > :last-child { text-align: left; }
.statbox { background: #fafaf9; border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.statbox .label { font-size: 11px; }
.statgrid { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; margin-top: 12px; }
@media (min-width: 700px) { .statgrid { grid-template-columns: repeat(4, 1fr); } }
.statgrid .card { margin-bottom: 0; }
.chartbox { position: relative; height: 280px; }
