/* ===== Design tokens ===== */
:root {
  --tekst: #1f2430;
  --muted: #5b6470;
  --goud: #b08c3e;
  --goud-d: #8f6f28;
  --groen: #3e7a4d;
  --groen-licht: #e7f4e8;
  --rand: #d8d2c4;
  --donker: #1f2937;
  --beige: #f3f1ea;
}
* { box-sizing: border-box; }
body { font-family: system-ui, sans-serif; margin: 0; color: var(--tekst); line-height: 1.5; }
h1 { font-size: 1.7rem; margin: .6rem 0 .8rem; }
h2 { font-size: 1.25rem; margin: 1.2rem 0 .5rem; }
a { color: var(--goud-d); }
:focus-visible { outline: 2px solid var(--goud); outline-offset: 2px; }

/* ===== Header / navigatie ===== */
header { background: var(--donker); color: #fff; padding: .6rem 1rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
header a { color: #cbd5e1; }
header .merk { text-decoration: none; color: #fff; font-size: 1.1rem; }
header .hoofdnav { display: flex; gap: .9rem; flex-wrap: wrap; }
header .hoofdnav a { text-decoration: none; padding: .15rem .2rem; border-bottom: 2px solid transparent; }
header .hoofdnav a:hover { color: #fff; }
header .hoofdnav a.actief { color: #fff; border-bottom-color: var(--goud); }
.usermenu { margin-left: auto; position: relative; }
.usermenu > summary { list-style: none; cursor: pointer; font-size: 1.3rem; line-height: 1; padding: .1rem .35rem; border-radius: 999px; }
.usermenu > summary::-webkit-details-marker { display: none; }
.usermenu[open] > summary { background: rgba(255,255,255,.15); }
.usermenu-pop { position: absolute; right: 0; top: 100%; margin-top: .4rem; min-width: 13rem; z-index: 50;
  background: #fff; color: var(--tekst); border: 1px solid #c7ced6; border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,.18); display: flex; flex-direction: column; padding: .3rem; }
.usermenu-pop .wie { font-size: .8rem; color: #666; padding: .35rem .6rem; border-bottom: 1px solid #eee; }
.usermenu-pop a { color: var(--tekst); text-decoration: none; padding: .5rem .6rem; border-radius: 5px; }
.usermenu-pop a:hover { background: #f0f3f6; }
.usermenu-pop a.actief { background: #f0f3f6; font-weight: bold; }
.usermenu-pop form { margin: 0; }
.usermenu-pop form button { width: 100%; text-align: left; background: none; border: none; color: var(--tekst);
  padding: .5rem .6rem; border-radius: 5px; cursor: pointer; font: inherit; }
.usermenu-pop form button:hover { background: #f0f3f6; }

/* ===== Layout / tabellen / formulieren ===== */
main { padding: 1rem; max-width: 1100px; margin: auto; }
table { border-collapse: collapse; width: 100%; }
td, th { border: 1px solid #ddd; padding: .4rem .6rem; text-align: left; vertical-align: top; }
label { display: block; margin: .5rem 0; }
input, select, textarea { font: inherit; padding: .35rem .5rem; width: 100%; max-width: 28rem; box-sizing: border-box;
  border: 1px solid #c7ced6; border-radius: 6px; }
button { cursor: pointer; font: inherit; padding: .4rem .8rem; background: #fff; border: 1px solid #c7ced6;
  border-radius: 6px; color: var(--tekst); }
button:hover { background: #f0f3f6; }
.inline { display: inline; }

/* ===== Admin: item-lijsten en statussen ===== */
.item { border: 1px solid #ddd; border-left: 4px solid var(--groen); border-radius: 4px; padding: .5rem .8rem; margin: .4rem 0; }
.item.warning { border-left-color: #b05a00; background: #fff8ef; }
.item.conflict { border-left-color: #a00000; background: #fdf0f0; }
.item.status-afgewezen, .item.status-gepubliceerd { opacity: .55; }
.fout, p.conflict { color: #a00000; }
p.warning { color: #b05a00; margin: .2rem 0; }
td.conflict { color: #a00000; font-weight: bold; }
td.warning { color: #b05a00; font-weight: bold; }
.nieuw { color: #4a6b8a; font-size: .8em; }

/* ===== Kolomfilters in de tabelkoppen ===== */
.kop-filter[open] > .menu { position: absolute; z-index: 30; margin-top: .3rem; background: #fff;
  border: 1px solid #c7ced6; border-radius: 6px; padding: .4rem; box-shadow: 0 4px 14px rgba(0,0,0,.12);
  min-width: 12rem; display: block; max-height: 60vh; overflow-y: auto; }
table.zittingen th .kop { cursor: pointer; }
.kop-filter { display: inline-block; position: relative; margin-left: .25rem; }
.kop-filter > summary { list-style: none; cursor: pointer; font-size: 1rem; line-height: 1;
  padding: .15rem .3rem; border-radius: 5px; }
.kop-filter > summary::-webkit-details-marker { display: none; }
.kop-filter > summary:hover { background: rgba(255,255,255,.15); }
.kop-filter[data-actief] > summary { color: var(--goud); }
.kbadge { background: var(--goud); color: #fff; border-radius: 999px; padding: 0 .35rem; font-size: .7em; margin-left: .1rem; }
.menu { color: var(--tekst); }
.menu .clear-all { display: block; width: 100%; text-align: left; background: #f3f4f6; border: none;
  border-radius: 5px; padding: .35rem .5rem; margin-bottom: .25rem; cursor: pointer; font: inherit; color: #a00000; }
.menu .clear-all:hover { background: #e7eaee; }
.menu label { display: flex; align-items: center; gap: .4rem; margin: .1rem 0; white-space: nowrap; line-height: 1.3; }
.menu label input { width: auto; max-width: none; margin: 0; transform: none; }
.menu label input[type=date] { width: auto; }

/* ===== Zittingentabel ===== */
table.zittingen th { background: var(--donker); color: #fff; position: sticky; top: 0; white-space: nowrap; cursor: grab; }
table.zittingen th[style] { user-select: none; }
table.zittingen th.sleep { opacity: .5; }
table.zittingen tbody tr:nth-child(even) { background: #f7f9fb; }
table.zittingen tbody tr.in-agenda { background: var(--groen-licht); }
table.zittingen td.kiescel { text-align: center; }
table.zittingen input.kies { width: auto; max-width: none; transform: scale(1.3); cursor: pointer; }
table.zittingen tr.via-abo td.kiescel { color: var(--groen); }
table.zittingen td.afstandcel { white-space: nowrap; text-align: right; color: var(--muted); }
table.zittingen td.titelcel { white-space: normal; min-width: 22rem; }
table.zittingen th[data-col="titel"] { width: 100%; }
.abobadge { font-size: .9em; }
.sortpijl { color: var(--goud); font-size: .9em; }
body:has(table.zittingen) main { max-width: none; }
.leeg { background: var(--beige); border: 1px solid var(--rand); border-radius: 8px; padding: 1rem; color: var(--muted); }

/* ===== Mijn agenda <-> Alle zittingen toggle ===== */
.agenda-toggle { display: flex; align-items: center; justify-content: center; gap: .9rem; margin: 1rem 0; }
.agenda-toggle a { text-decoration: none; color: #6b7280; font-weight: bold; font-size: 1.9rem; }
.agenda-toggle a.actief { color: var(--tekst); }
.agenda-toggle .switch { display: inline-block; width: 46px; height: 26px; background: #c7ced6;
  border-radius: 999px; position: relative; flex: 0 0 auto; }
.agenda-toggle .switch.aan { background: var(--groen); }
.agenda-toggle .switch .knop { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  background: #fff; border-radius: 50%; transition: left .15s; }
.agenda-toggle .switch.aan .knop { left: 23px; }

/* ===== Hulp-uitleg ===== */
details.hulp { background: #eef3f8; border: 1px solid #d6e0ea; border-radius: 8px; padding: .5rem .8rem; margin: .5rem 0; }
details.hulp > summary { cursor: pointer; font-weight: bold; }
details.hulp ul { margin: .5rem 0 .2rem; padding-left: 1.2rem; }
details.hulp li { margin: .3rem 0; }
details.hulp .kolherstel { background: none; border: none; color: var(--goud-d); cursor: pointer; padding: 0; font: inherit; text-decoration: underline; }

/* ===== Zoekbalk + agenda-info (zelfde container-opmaak) ===== */
.zoekbalk, .agenda-info { display: flex; align-items: center; gap: .8rem; width: 100%; box-sizing: border-box;
  margin: .6rem 0; padding: .5rem .7rem; background: var(--beige); border: 1px solid var(--rand);
  border-radius: 6px; flex-wrap: wrap; color: var(--tekst); }
.zoekbalk .zoek { flex: 1 1 14rem; min-width: 0; max-width: none; }
.zoekbalk a, .agenda-info a { white-space: nowrap; text-decoration: none; color: var(--goud-d); font-weight: bold; }
.zoekbalk a:hover, .agenda-info a:hover { text-decoration: underline; }
.zoekbalk .abonneer { white-space: nowrap; cursor: pointer; padding: .4rem .8rem;
  background: var(--goud); color: #fff; border: none; border-radius: 6px; font-weight: bold; }
.zoekbalk .abonneer:hover { background: var(--goud-d); }

/* ===== Event-detail actieknoppen ===== */
.actiebalk { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1rem; }
.actiebalk button { background: var(--goud); color: #fff; border: none; font-weight: bold; }
.actiebalk button:hover { background: var(--goud-d); }
.actiebalk button.secundair { background: #fff; color: var(--tekst); border: 1px solid #c7ced6; }
.actiebalk button.secundair:hover { background: #f0f3f6; }
.terug { display: inline-block; margin-top: 1rem; }

/* ===== Toast (actiebevestiging) ===== */
.toast { position: fixed; left: 50%; bottom: 3rem; transform: translateX(-50%) translateY(1rem);
  background: var(--donker); color: #fff; padding: .6rem 1rem; border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.25);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 100; max-width: 90vw; }
.toast.toon { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.fout { background: #a00000; }

/* ===== Mobiel: zittingentabel → kaarten ===== */
@media (max-width: 700px) {
  .agenda-toggle a { font-size: 1.3rem; }
  table.zittingen thead { position: absolute; left: -9999px; }
  table.zittingen, table.zittingen tbody, table.zittingen tr, table.zittingen td { display: block; width: auto; }
  table.zittingen tr { border: 1px solid var(--rand); border-radius: 8px; margin: .6rem 0; padding: .3rem .2rem; }
  table.zittingen td { border: none; padding: .25rem .8rem; display: flex; gap: .6rem; align-items: baseline; }
  table.zittingen td::before { content: attr(data-label); font-weight: bold; color: var(--muted); flex: 0 0 6.5rem; }
  table.zittingen td.titelcel { font-size: 1.1rem; font-weight: bold; min-width: 0; }
  table.zittingen td.titelcel::before { display: none; }
  table.zittingen td.kiescel { justify-content: flex-start; }
  table.zittingen td.afstandcel { text-align: left; }
  table.zittingen td:empty { display: none; }
}

/* Abonneer-knop uitgegrijsd zonder filter */
.zoekbalk .abonneer:disabled { background: #cfc8b6; cursor: not-allowed; }

/* Batch-acties (review) */
.batch-acties { display: flex; gap: .6rem; flex-wrap: wrap; margin: .6rem 0; }
.batch-acties button { background: var(--goud); color: #fff; border: none; font-weight: bold; }
.batch-acties button:hover { background: var(--goud-d); }

/* Toegelaten maar nog niet geregistreerde adressen in de leden-tabel */
table tr.niet-geregistreerd td { color: var(--muted); background: #faf8f3; }

/* Compacte knoppen in tabelcellen (review/leden/loges/…) */
td button { padding: .2rem .55rem; font-size: .85rem; }

/* Mobiele cards (gereduceerde interface) */
.mcard { border: 1px solid var(--rand); border-left: 4px solid var(--groen); border-radius: 8px;
  padding: .6rem .8rem; margin: .6rem 0; background: #fff; }
.mcard-datum { font-size: .85rem; color: var(--muted); text-transform: capitalize; }
.mcard-titel { font-weight: bold; font-size: 1.05rem; margin: .15rem 0; }
.mcard-meta { font-size: .85rem; color: var(--muted); }
.m-obed { font-weight: 600; color: var(--goud-d); }
.mcard-acties { margin-top: .5rem; display: flex; gap: .5rem; }
.subtle { color: var(--muted); }

/* Gekozen-loges tabel in het profiel */
.logetabel { max-width: 42rem; }
.logetabel th, .logetabel td { padding: .35rem .55rem; vertical-align: middle; }
.logetabel .hoofdcel, .logetabel .wiscel { text-align: center; width: 1%; white-space: nowrap; }
.logetabel input[type=radio] { width: auto; max-width: none; margin: 0; }
.logetabel .verwijder { padding: .1rem .5rem; }

/* Koppel-agenda, mobiel-aangepast */
.koppel-knop { display: block; text-align: center; background: var(--groen); color: #fff;
  text-decoration: none; font-weight: bold; padding: .8rem 1rem; border-radius: 8px; margin: .6rem 0; font-size: 1.05rem; }
.koppel-link { width: 100%; box-sizing: border-box; padding: .5rem; border: 1px solid #c7ced6;
  border-radius: 6px; font-family: monospace; font-size: .85rem; }

/* Niet-geregistreerde adressen als card */
.mcard.niet-geregistreerd { background: #faf8f3; border-left-color: #c7ced6; }

/* Mobiele portal: toggle + filterchips + kies-kaarten */
.m-toggle { display: flex; gap: .25rem; width: fit-content; margin: .6rem auto .1rem;
  background: #e7eaef; border-radius: 999px; padding: .25rem; }
.m-toggle a { text-decoration: none; color: var(--muted); font-weight: bold; font-size: 1.05rem;
  padding: .45rem 1.15rem; border-radius: 999px; }
.m-toggle a.actief { background: var(--donker); color: #fff; }
.m-modus { text-align: center; color: var(--muted); font-size: .85rem; margin: 0 0 .5rem; }
.m-filters { margin: .4rem 0 .2rem; }
.m-zoek { width: 100%; box-sizing: border-box; padding: .5rem; border: 1px solid #c7ced6; border-radius: 6px; font-size: 1rem; }
.m-chips { display: flex; gap: .4rem; flex-wrap: wrap; margin: .4rem 0; }
.m-chips .chip { display: inline-flex; align-items: center; margin: 0; padding: .3rem .75rem; border: 1px solid #c7ced6;
  border-radius: 999px; font-size: .9rem; cursor: pointer; background: #fff; white-space: nowrap; }
.m-chips .chip.aan { background: var(--donker); color: #fff; border-color: var(--donker); }
.m-chips .chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.zitkaart { display: flex; gap: .6rem; align-items: center; position: relative; }
.zitkaart .volg-hoek { position: absolute; top: .25rem; right: .4rem; z-index: 1; }
.zitkaart .volg-hoek .volg-ster { display: inline-flex; align-items: center; gap: .25rem;
  font-size: .72rem; font-weight: 600; color: var(--goud-d); background: #fff;
  border: 1px solid #e6d9b3; border-radius: 999px; padding: .14rem .5rem; line-height: 1.1; }
.zitkaart .volg-hoek .volg-ster .ster { font-size: 1rem; }
.zitkaart .zit-body { flex: 1; min-width: 0; order: 1; }
.zitkaart .zit-kies { order: 2; flex: 0 0 2rem; text-align: center; } /* vaste breedte → stabiel in beide views */
.zitkaart .zit-kies input { transform: scale(1.4); }
.zitkaart .zit-kies .abobadge { font-size: 1.15rem; }

/* Mijn agenda: uitleg-container i.p.v. filters */
.m-uitleg { background: #eef3f8; border: 1px solid #d6e0ea; border-radius: 8px; padding: .6rem .8rem; margin: .2rem 0 .6rem; }
.m-uitleg p { margin: 0 0 .4rem; }
.m-uitleg ul { margin: .2rem 0 0; padding-left: 1.2rem; }
.m-uitleg li { margin: .3rem 0; }

/* Mobiel abonneren: volg-loge per kaart + abonneer-balk */
.volg-knop { margin-top: .35rem; padding: .2rem .6rem; font-size: .8rem; background: #fff;
  border: 1px solid var(--goud); color: var(--goud-d); border-radius: 999px; cursor: pointer; }
.volg-knop.volgt { background: var(--goud); color: #fff; }
.m-abo { display: flex; align-items: center; gap: .6rem; margin: .2rem 0 .6rem; }
.m-abo form { flex: 1 1 auto; min-width: 0; margin: 0; }
.m-abo .abonneer { width: 100%; background: var(--goud); color: #fff; border: none; border-radius: 6px; padding: .45rem .8rem; font-weight: bold; cursor: pointer; }
.m-abo .abonneer:disabled { background: #cfc8b6; cursor: not-allowed; }
.m-abo a { flex: 0 0 auto; white-space: nowrap; color: var(--goud-d); font-weight: bold; text-decoration: none; }

/* Zoekrij met wis-knop (mobiel Voeg toe) */
.m-zoekrij { display: flex; gap: .4rem; align-items: stretch; }
.m-zoekrij .m-zoek { flex: 1; min-width: 0; }
.m-wis { flex: 0 0 auto; border: 1px solid #c7ced6; background: #fff; border-radius: 6px;
  padding: 0 .9rem; cursor: pointer; color: var(--muted); font-size: 1rem; }
.m-wis:hover { background: #f0f3f6; }

/* Live zoekveld bovenaan lange kolomfilter-dropdowns */
.menu .menu-zoek { width: 100%; box-sizing: border-box; margin: 0 0 .3rem; padding: .25rem .4rem;
  position: sticky; top: 0; background: #fff; border: 1px solid #c7ced6; border-radius: 5px; }

/* Volg-loge ster bij de logenaam (Wijzig-weergave) */
.volg-ster { background: none; border: none; cursor: pointer; padding: 0 .15rem; font-size: 1.05rem;
  line-height: 1; color: var(--goud); vertical-align: baseline; }
.volg-ster:hover { color: var(--goud-d); }
.volg-ster .volg-tekst { font-size: .78rem; font-weight: 600; color: var(--goud-d); }
.volg-ster .ster { font-size: 1.05rem; }
.mcard-meta form.inline { display: inline; }

/* Thuisgemeente in het profiel + filter-hint */
.gemeente-rij { display: flex; gap: .5rem; align-items: center; max-width: 28rem; }
.gemeente-rij #gemeente { flex: 1; }
.gemeente-rij #geo-knop { flex: 0 0 auto; white-space: nowrap; }
.menu-hint { margin: .2rem .3rem .4rem; font-size: .85rem; color: var(--muted); }

/* Opslaan-balk: losgemaakt van de velden erboven, knop licht op bij wijzigingen */
.opslaanbalk { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap;
  margin-top: 1.4rem; padding-top: 1rem; border-top: 1px solid var(--rand); }
.opslaan { padding: .5rem 1.4rem; font-weight: 600; }
.opslaan.actief { background: var(--groen); border-color: var(--groen); color: #fff;
  animation: opslaanpuls 1.5s ease-in-out infinite; }
.opslaan.actief:hover { background: #356b43; }
@keyframes opslaanpuls {
  0%, 100% { box-shadow: 0 0 0 0 rgba(62, 122, 77, .45); }
  50% { box-shadow: 0 0 0 6px rgba(62, 122, 77, 0); }
}
.opslaan-hint { color: var(--groen); font-size: .85rem; font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .opslaan.actief { animation: none; } }

/* Copyright-footer — vast onderaan het scherm, altijd zichtbaar */
.mp-copyright { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; text-align: center;
  color: var(--muted); font-size: .8rem; padding: .45rem 1rem; background: #fff; border-top: 1px solid var(--rand); }
body { padding-bottom: 2.4rem; } /* ruimte zodat inhoud niet onder de footer valt */

/* Compactere copyright-footer op telefoon */
@media (max-width: 700px) {
  .mp-copyright { padding: .18rem 1rem; font-size: .72rem; }
  body { padding-bottom: 1.5rem; }
}

/* Versienummer rechts onderaan in de footer */
.mp-versie { position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); opacity: .7; }
