/* ==========================================================================
   Skapp — gedeeld stijlsysteem
   Alle kleuren/afstanden lopen via variabelen; elke tab hergebruikt dezelfde
   componentklassen (.card, .btn, .pill, ...) zodat de look-and-feel
   gegarandeerd gelijk blijft zonder dat iemand dit los moet bewaken.
   ========================================================================== */

:root {
  --kleur-bg: #FAF6EC;
  --kleur-oppervlak: #FFFFFF;
  --kleur-tekst: #1F1F1F;
  --kleur-tekst-gedimd: #6B6459;
  --kleur-rand: #E4DDC8;

  --kleur-groen: #1E8A4C;
  --kleur-groen-zacht: #E7F3EC;
  --kleur-goud: #C98A00;
  --kleur-goud-zacht: #FBF0D6;
  --kleur-rood: #C43D3D;
  --kleur-rood-zacht: #FBEAEA;

  --schaduw: 0 1px 2px rgba(0, 0, 0, 0.06), 0 2px 8px rgba(0, 0, 0, 0.05);

  --straal-klein: 8px;
  --straal-groot: 14px;

  --ruimte-1: 4px;
  --ruimte-2: 8px;
  --ruimte-3: 16px;
  --ruimte-4: 24px;
  --ruimte-5: 32px;

  --lettertype: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --lettertype-mono: "SF Mono", Menlo, Consolas, monospace;

  /* Akkoorden/tekst-blok: bewust NIET in het donkere thema hieronder
     overschreven. Tijdens een optreden wil je altijd hetzelfde,
     maximaal leesbare zwart-op-wit schema, los van de app-instelling. */
  --akkoorden-bg: #FFFFFF;
  --akkoorden-tekst: #1A1A1A;
  --akkoorden-rand: #D9D9D9;
}

:root[data-theme="dark"] {
  --kleur-bg: #14181A;
  --kleur-oppervlak: #1E2320;
  --kleur-tekst: #F2F2ED;
  --kleur-tekst-gedimd: #A6A79C;
  --kleur-rand: #2C332E;

  --kleur-groen: #34C77B;
  --kleur-groen-zacht: #16281F;
  --kleur-goud: #FFC947;
  --kleur-goud-zacht: #2E2717;
  --kleur-rood: #E36767;
  --kleur-rood-zacht: #2E1B1B;

  --schaduw: 0 1px 2px rgba(0, 0, 0, 0.4), 0 2px 10px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--kleur-bg);
  color: var(--kleur-tekst);
  font-family: var(--lettertype);
}

h1, h2, h3 { line-height: 1.25; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--ruimte-3);
  min-height: 56px;
  background: var(--kleur-oppervlak);
  border-bottom: 1px solid var(--kleur-rand);
}
.topbar__titel { font-weight: 700; font-size: 1.1rem; }

.menu-knop {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  padding: 0 10px;
  background: none;
  border: none;
  cursor: pointer;
}
.menu-knop__streep {
  display: block;
  height: 2px;
  background: var(--kleur-tekst);
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.menu-knop[aria-expanded="true"] .menu-knop__streep:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-knop[aria-expanded="true"] .menu-knop__streep:nth-child(2) { opacity: 0; }
.menu-knop[aria-expanded="true"] .menu-knop__streep:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Menu: uitklapper onder de topbar op mobiel, gewone menubalk vanaf 720px */
.menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  flex-direction: column;
  background: var(--kleur-oppervlak);
  border-bottom: 1px solid var(--kleur-rand);
  box-shadow: var(--schaduw);
  padding: var(--ruimte-2) var(--ruimte-3) var(--ruimte-3);
}
.menu--open { display: flex; }
.menu__groep { display: flex; flex-direction: column; }
.menu__groep--extra {
  margin-top: var(--ruimte-2);
  padding-top: var(--ruimte-2);
  border-top: 1px solid var(--kleur-rand);
}
.menu__item {
  display: block;
  padding: 12px 0;
  background: none;
  border: none;
  font: inherit;
  font-size: 1rem;
  text-align: left;
  text-decoration: none;
  color: var(--kleur-tekst);
  cursor: pointer;
}
.menu__groep--extra .menu__item { color: var(--kleur-tekst-gedimd); font-size: 0.95rem; }
.menu__item--actief { color: var(--kleur-groen); font-weight: 600; }
.thema-label--licht { display: none; }
:root[data-theme="dark"] .thema-label--donker { display: none; }
:root[data-theme="dark"] .thema-label--licht { display: inline; }

@media (min-width: 720px) {
  .topbar { padding: 0 var(--ruimte-4); }
  .menu-knop { display: none; }
  .menu {
    display: flex;
    position: static;
    flex: 1;
    flex-direction: row;
    align-items: center;
    padding: 0;
    margin-left: var(--ruimte-5);
    background: none;
    border: none;
    box-shadow: none;
  }
  .menu__groep { flex-direction: row; gap: var(--ruimte-4); }
  .menu__groep--extra {
    margin: 0 0 0 auto;
    padding: 0;
    border-top: none;
    gap: var(--ruimte-3);
  }
  .menu__item { padding: 18px 0; font-size: 0.95rem; border-bottom: 2px solid transparent; }
  .menu__item:hover { color: var(--kleur-groen); }
  .menu__groep--extra .menu__item { font-size: 0.85rem; }
  .menu__item--actief { border-bottom-color: var(--kleur-groen); }
}

.inhoud {
  max-width: 640px;
  margin: 0 auto;
  padding: var(--ruimte-3);
}

.paginakop {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--ruimte-2);
  margin-bottom: var(--ruimte-3);
}
.paginakop h1 { margin: 0; font-size: 1.3rem; }
.paginakop__acties { display: flex; gap: var(--ruimte-2); flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: var(--straal-klein);
  border: 1px solid var(--kleur-rand);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  background: var(--kleur-oppervlak);
  color: var(--kleur-tekst);
}
.btn--primary { background: var(--kleur-groen); border-color: var(--kleur-groen); color: #fff; }
.btn--ghost { background: transparent; padding: 8px 10px; }
.btn--danger { background: var(--kleur-rood); border-color: var(--kleur-rood); color: #fff; }

.search-bar {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--straal-groot);
  border: 1px solid var(--kleur-rand);
  background: var(--kleur-oppervlak);
  color: var(--kleur-tekst);
  font-size: 1rem;
  margin-bottom: var(--ruimte-3);
}

.kaartenlijst, .lijst {
  display: flex;
  flex-direction: column;
  gap: var(--ruimte-2);
}

/* Kaart: de basis-eenheid die in elke tab hetzelfde oogt */
.card {
  background: var(--kleur-oppervlak);
  border: 1px solid var(--kleur-rand);
  border-radius: var(--straal-groot);
  box-shadow: var(--schaduw);
  overflow: hidden;
}

.card__header {
  display: flex;
  align-items: center;
  gap: var(--ruimte-2);
  padding: var(--ruimte-3);
}
.card__kop {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--ruimte-2);
  background: none;
  border: none;
  text-align: left;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: var(--kleur-tekst);
  cursor: pointer;
  padding: 0;
}
.card__nummer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--kleur-groen-zacht);
  color: var(--kleur-groen);
  font-size: 0.75rem;
  font-weight: 700;
}
.card__chevron {
  transition: transform 0.15s ease;
  color: var(--kleur-tekst-gedimd);
}
.card--open .card__chevron { transform: rotate(180deg); }

.ster-knop {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--kleur-rand);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}
.ster-knop--actief { color: var(--kleur-goud); }

.pin-knop {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  filter: grayscale(1);
  opacity: 0.35;
}
.pin-knop--actief { filter: none; opacity: 1; }

.card__body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.2s ease;
  padding: 0 var(--ruimte-3);
}
.card--open .card__body {
  max-height: 2000px;
  padding: 0 var(--ruimte-3) var(--ruimte-3);
}

.akkoorden-blok {
  font-family: var(--lettertype-mono);
  font-size: 1.05rem;
  line-height: 1.6;
  font-weight: 500;
  white-space: pre;
  overflow-x: auto;
  background: var(--akkoorden-bg);
  color: var(--akkoorden-tekst);
  border: 1px solid var(--akkoorden-rand);
  border-radius: var(--straal-klein);
  padding: var(--ruimte-3);
  margin: 0;
}

.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}
.pill--repetitie { background: var(--kleur-groen-zacht); color: var(--kleur-groen); }
.pill--optreden { background: var(--kleur-goud-zacht); color: var(--kleur-goud); }

.kaart-agenda {
  display: flex;
  align-items: center;
  gap: var(--ruimte-3);
  padding: var(--ruimte-3);
}
.kaart-agenda__datum {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 56px;
  font-weight: 700;
  text-align: center;
}
.kaart-agenda__tijd { font-size: 0.75rem; color: var(--kleur-tekst-gedimd); font-weight: 400; }
.kaart-agenda__inhoud { flex: 1; }
.kaart-agenda__inhoud h3 { margin: 2px 0; font-size: 1rem; }
.kaart-agenda__acties { display: flex; gap: var(--ruimte-1); }
.kaart-agenda__acties form { display: inline; margin: 0; }

.tekst-muted { color: var(--kleur-tekst-gedimd); margin: 2px 0; font-size: 0.85rem; }

.formulier { display: flex; flex-direction: column; gap: var(--ruimte-3); max-width: 420px; }
.veld { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; font-weight: 600; }
.veld input, .veld textarea {
  font: inherit;
  padding: 10px 12px;
  border-radius: var(--straal-klein);
  border: 1px solid var(--kleur-rand);
  background: var(--kleur-oppervlak);
  color: var(--kleur-tekst);
}
.formulier__acties { display: flex; gap: var(--ruimte-2); justify-content: flex-end; }

.melding { padding: var(--ruimte-2) var(--ruimte-3); border-radius: var(--straal-klein); font-size: 0.85rem; margin: 0 0 var(--ruimte-3); }
.melding--ok { background: var(--kleur-groen-zacht); color: var(--kleur-groen); }
.melding--fout { background: var(--kleur-rood-zacht); color: var(--kleur-rood); }
.melding--info { background: var(--kleur-goud-zacht); color: var(--kleur-goud); }

.statrij { display: flex; gap: var(--ruimte-2); flex-wrap: wrap; margin-bottom: var(--ruimte-2); }
.stat {
  flex: 1;
  min-width: 140px;
  background: var(--kleur-oppervlak);
  border: 1px solid var(--kleur-rand);
  border-radius: var(--straal-groot);
  padding: var(--ruimte-3);
  box-shadow: var(--schaduw);
}
.stat__label { display: block; font-size: 0.75rem; color: var(--kleur-tekst-gedimd); }
.stat__waarde { display: block; font-size: 1.4rem; font-weight: 700; margin-top: 4px; }

.kaart-lid { display: flex; justify-content: space-between; padding: var(--ruimte-3); }
.kaart-lid__saldo { font-weight: 700; }

.leeg-state, .leeg-melding {
  text-align: center;
  color: var(--kleur-tekst-gedimd);
  padding: var(--ruimte-5) var(--ruimte-3);
}

.inlogscherm {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--ruimte-3);
}
.inlogkaart { padding: var(--ruimte-5) var(--ruimte-4); width: 100%; max-width: 340px; text-align: center; }
.inlogkaart h1 { margin: 0 0 4px; }
.inlogkaart .formulier { max-width: none; text-align: left; margin-top: var(--ruimte-3); }

.verleden-toggle { margin-top: var(--ruimte-4); }
.verleden-toggle summary { cursor: pointer; font-weight: 600; margin-bottom: var(--ruimte-2); }

/* Opnames: schakelaar song-/repetitieweergave en opnamelijst */
.schakelaar {
  display: inline-flex;
  border: 1px solid var(--kleur-rand);
  border-radius: var(--straal-klein);
  overflow: hidden;
}
.schakelaar__item {
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--kleur-tekst-gedimd);
  background: var(--kleur-oppervlak);
}
.schakelaar__item + .schakelaar__item { border-left: 1px solid var(--kleur-rand); }
.schakelaar__item--actief { background: var(--kleur-groen-zacht); color: var(--kleur-groen); }

.opnamelijst {
  list-style: none;
  margin: 0;
  padding: var(--ruimte-2) 0;
  display: flex;
  flex-direction: column;
  gap: var(--ruimte-3);
}
.opname-rij__kop {
  display: flex;
  align-items: center;
  gap: var(--ruimte-2);
  margin-bottom: 4px;
}
.opname-rij__datum { font-weight: 600; }
.opname-rij__notitie { color: var(--kleur-tekst-gedimd); font-size: 0.85rem; }
.opname-rij__songtitel { font-weight: 600; }
.opname-rij .ster-knop { margin-left: auto; }
.opname-speler { width: 100%; }
