/* Mobile-first: basisstijlen gelden voor telefoon (<640px), daarna verbreden
   we via media queries voor tablet (>=640px) en desktop (>=1024px). */

:root {
  /* Officiële ManegePlanner-huisstijlkleuren (uit huisstijl-bestand) */
  --kleur-primair: #4a647c;
  --kleur-primair-donker: #374d61;
  --kleur-primair-licht: #eef2f5;
  --kleur-accent: #c5a059;
  --kleur-accent-donker: #a9853f;
  --kleur-accent-licht: #faf3e6;
  --kleur-geel: #93610a;
  --kleur-geel-bg: #fff3d6;
  --kleur-blauw: #0b5f8a;
  --kleur-blauw-bg: #e3f2fb;
  --kleur-rood: #a3252c;
  --kleur-rood-bg: #fbe4e4;
  --kleur-groen: #2e6b3e;
  --kleur-groen-bg: #e5f3e8;
  --kleur-grijs: #5b6770;
  --kleur-grijs-bg: #eef0f1;
  --kleur-rand: #dde2e6;
  --kleur-tekst: #202a30;
  --kleur-achtergrond: #f5f6f8;

  --radius: 10px;
  --radius-klein: 6px;
  --schaduw: 0 1px 2px rgba(32, 42, 48, 0.06), 0 2px 8px rgba(32, 42, 48, 0.06);
  --schaduw-groot: 0 4px 16px rgba(32, 42, 48, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--kleur-tekst);
  background: var(--kleur-achtergrond);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--kleur-blauw); }
a:hover { text-decoration-thickness: 2px; }

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* --- Topbar --- */

header.topbar {
  background: var(--kleur-primair);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}

.topbar-binnen {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  max-width: 1180px;
  margin: 0 auto;
}

.topbar-binnen a.logo {
  color: white;
  font-weight: 700;
  text-decoration: none;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
}

.topbar-binnen a.logo img { display: block; }

.hamburger {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  display: block;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-klein);
}
.hamburger:hover { background: rgba(255, 255, 255, 0.12); }

nav.hoofdmenu {
  display: none;
  flex-direction: column;
  background: var(--kleur-primair-donker);
}

nav.hoofdmenu.open { display: flex; }

nav.hoofdmenu a, nav.hoofdmenu button.link-knop {
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  padding: 0.85rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: none;
  border-left: none; border-right: none; border-bottom: none;
  text-align: left;
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  width: 100%;
}
nav.hoofdmenu a.actief { color: white; font-weight: 700; }

@media (min-width: 640px) {
  .hamburger { display: none; }
  nav.hoofdmenu {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    background: none;
    gap: 0.25rem;
  }
  nav.hoofdmenu a, nav.hoofdmenu button.link-knop {
    border-top: none;
    width: auto;
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius-klein);
  }
  nav.hoofdmenu a:hover, nav.hoofdmenu button.link-knop:hover { background: rgba(255, 255, 255, 0.12); }
  nav.hoofdmenu a.actief { background: rgba(255, 255, 255, 0.16); }
}

/* --- Sub-nav (beheer-secties) --- */

.subnav {
  background: white;
  border-bottom: 1px solid var(--kleur-rand);
  overflow-x: auto;
}
.subnav-binnen {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  gap: 0.25rem;
  padding: 0 0.75rem;
}
.subnav a {
  display: inline-block;
  padding: 0.85rem 1rem;
  color: var(--kleur-grijs);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}
.subnav a:hover { color: var(--kleur-primair); }
.subnav a.actief { color: var(--kleur-primair); border-bottom-color: var(--kleur-accent); }

/* --- Algemeen --- */

main.container { padding-top: 1.75rem; padding-bottom: 3.5rem; }

h1 { font-size: 1.65rem; font-weight: 700; margin: 0 0 0.35rem; letter-spacing: -0.01em; }
h2 { font-size: 1.15rem; font-weight: 700; margin: 0 0 0.75rem; }
h3 { font-size: 0.95rem; font-weight: 700; margin: 0 0 0.5rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--kleur-grijs); }
h1, h2 { line-height: 1.25; color: var(--kleur-primair-donker); }

.paginakop {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--kleur-rand);
}

.kaart {
  background: white;
  border: 1px solid var(--kleur-rand);
  border-radius: var(--radius);
  box-shadow: var(--schaduw);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.kaart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.kaart-header h2 { margin: 0; }

.beheer-hub-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 640px) {
  .beheer-hub-grid { grid-template-columns: repeat(3, 1fr); }
}
.beheer-hub-tegel {
  background: white;
  border: 1px solid var(--kleur-rand);
  border-radius: var(--radius);
  box-shadow: var(--schaduw);
  padding: 1.5rem;
  text-decoration: none;
  color: var(--kleur-tekst);
  display: block;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.beheer-hub-tegel:hover { transform: translateY(-2px); box-shadow: var(--schaduw-groot); }
.beheer-hub-tegel .aantal { font-size: 2rem; font-weight: 700; color: var(--kleur-primair); }
.beheer-hub-tegel .label { color: var(--kleur-grijs); font-size: 0.9rem; }
.beheer-hub-tegel .pijl { color: var(--kleur-accent-donker); font-weight: 600; font-size: 0.875rem; }

/* --- Knoppen --- */

.knop {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--kleur-primair);
  color: white;
  border: none;
  border-radius: var(--radius-klein);
  padding: 0.65rem 1.15rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.12s ease, box-shadow 0.12s ease;
}
.knop:hover { background: var(--kleur-primair-donker); }
.knop:focus-visible { outline: 2px solid var(--kleur-accent); outline-offset: 2px; }
.knop.accent { background: var(--kleur-accent); color: var(--kleur-primair-donker); }
.knop.accent:hover { background: var(--kleur-accent-donker); color: white; }
.knop.gevaar { background: white; color: var(--kleur-rood); border: 1px solid var(--kleur-rood); }
.knop.gevaar:hover { background: var(--kleur-rood-bg); }
.knop.secundair { background: white; color: var(--kleur-primair); border: 1px solid var(--kleur-rand); }
.knop.secundair:hover { background: var(--kleur-primair-licht); }
.knop.klein { padding: 0.4rem 0.75rem; font-size: 0.85rem; }
.knop[disabled] { opacity: 0.5; cursor: not-allowed; }

/* --- Formulieren --- */

.veld { margin-bottom: 1rem; }
.veld label { display: block; margin-bottom: 0.3rem; font-weight: 600; font-size: 0.9rem; }
.veld .hint { font-weight: 400; color: var(--kleur-grijs); }
.veld input, .veld select, .veld textarea {
  width: 100%;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--kleur-rand);
  border-radius: var(--radius-klein);
  font-size: 0.95rem;
  font-family: inherit;
  background: white;
}
.veld input:focus, .veld select:focus, .veld textarea:focus {
  outline: none;
  border-color: var(--kleur-primair);
  box-shadow: 0 0 0 3px rgba(74, 100, 124, 0.15);
}

.formulier { max-width: 460px; }
.email-sjabloon-formulier { max-width: 640px; }
.email-sjabloon-formulier textarea { font-family: inherit; resize: vertical; }
.email-sjabloon-formulier code {
  background: var(--kleur-grijs-bg, #f0f0f0);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  font-size: 0.85em;
}

.formulier-rij {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: flex-end;
}
.formulier-rij .veld { margin-bottom: 0; flex: 1 1 160px; }

.uitklap-toggle {
  margin-bottom: 1rem;
}

.uitklap-paneel {
  border-top: 1px solid var(--kleur-rand);
  padding-top: 1rem;
  margin-top: 0.25rem;
}

/* --- Meldingen / feedback --- */

.foutmelding, .succesmelding {
  border-radius: var(--radius-klein);
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.92rem;
  border-left: 4px solid transparent;
}
.foutmelding { background: var(--kleur-rood-bg); color: var(--kleur-rood); border-left-color: var(--kleur-rood); }
.succesmelding { background: var(--kleur-groen-bg); color: var(--kleur-groen); border-left-color: var(--kleur-groen); }

.melding {
  display: inline-block;
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 600;
  margin: 0.15rem 0.25rem 0.15rem 0;
}
.melding.warning { background: var(--kleur-geel-bg); color: var(--kleur-geel); }
.melding.info { background: var(--kleur-blauw-bg); color: var(--kleur-blauw); }
.melding.voorkeur { background: var(--kleur-accent-licht); color: var(--kleur-accent-donker); }

.vervallen-banner {
  background: var(--kleur-rood-bg);
  color: var(--kleur-rood);
  border-radius: var(--radius-klein);
  padding: 0.75rem 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.info-banner {
  background: var(--kleur-blauw-bg);
  color: var(--kleur-blauw);
  border-radius: var(--radius-klein);
  padding: 0.75rem 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

/* --- Statuspillen --- */

.pil {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 700;
}
.pil.groen { background: var(--kleur-groen-bg); color: var(--kleur-groen); }
.pil.geel { background: var(--kleur-geel-bg); color: var(--kleur-geel); }
.pil.rood { background: var(--kleur-rood-bg); color: var(--kleur-rood); }
.pil.grijs { background: var(--kleur-grijs-bg); color: var(--kleur-grijs); }
.pil.blauw { background: var(--kleur-blauw-bg); color: var(--kleur-blauw); }

.leskaart-indicator {
  display: inline-block;
  border-radius: 999px;
  width: 0.6rem; height: 0.6rem;
  margin-right: 0.4rem;
  flex-shrink: 0;
}
.leskaart-indicator.ok { background: var(--kleur-groen); }
.leskaart-indicator.bijna-op { background: var(--kleur-geel); }
.leskaart-indicator.op { background: var(--kleur-rood); }

/* --- Lege staat --- */

.lege-staat {
  text-align: center;
  padding: 2.5rem 1.5rem;
  color: var(--kleur-grijs);
}
.lege-staat .icoon { font-size: 2.2rem; margin-bottom: 0.5rem; }
.lege-staat p { margin: 0 0 1rem; }

/* --- Tabellen (beheerlijsten) --- */

.tabel-wrap { overflow-x: auto; }
.tabel { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.tabel th {
  text-align: left;
  padding: 0.6rem 0.75rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--kleur-grijs);
  border-bottom: 2px solid var(--kleur-rand);
  white-space: nowrap;
}
.tabel td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--kleur-rand);
  vertical-align: middle;
}
.tabel tbody tr:hover { background: var(--kleur-primair-licht); }
.tabel select { padding: 0.35rem 0.5rem; font-size: 0.85rem; }
.tabel tbody tr.gedimd { opacity: 0.55; }

/* --- Ruiter: card-view --- */

.les-kaart-lijst {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}
@media (min-width: 640px) {
  .les-kaart-lijst { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .les-kaart-lijst { grid-template-columns: repeat(3, 1fr); }
}

/* --- Beheerder: puzzel-grid --- */
/* Mobiel (<640px): ruiters en paarden staan onder elkaar, tik-selectie.
   Vanaf tablet: twee kolommen naast elkaar, met drag-and-drop als extra. */

.puzzel-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 1024px) {
  .puzzel-layout { grid-template-columns: 1fr 1fr; }
}

.kaartjes-lijst {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 60vh;
  overflow-y: auto;
  padding: 0.15rem;
}

.kaartje {
  border: 1px solid var(--kleur-rand);
  border-radius: var(--radius-klein);
  padding: 0.6rem 0.8rem;
  background: white;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  transition: border-color 0.1s ease, background 0.1s ease;
}
.kaartje:hover { border-color: var(--kleur-primair); }
.kaartje.geselecteerd {
  border-color: var(--kleur-accent);
  background: var(--kleur-accent-licht);
}
.kaartje[draggable="true"] { cursor: grab; }
.kaartje.blessure, .kaartje.rust { opacity: 0.6; }
.kaartje.bezet {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--kleur-grijs-bg);
  border-style: dashed;
}
.kaartje.bezet::after {
  content: "Bezet";
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--kleur-grijs);
  background: white;
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
}

/* Geschiktheid van een paard t.o.v. de geselecteerde ruiter */
.geschiktheid-badge:empty { display: none; }
.geschiktheid-badge {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  white-space: nowrap;
}
.kaartje.voorkeur-match {
  border-color: var(--kleur-accent);
  background: var(--kleur-accent-licht);
}
.kaartje.voorkeur-match .geschiktheid-badge { background: var(--kleur-accent); color: white; }
.kaartje.geschikt-match { border-color: var(--kleur-groen); }
.kaartje.geschikt-match .geschiktheid-badge { background: var(--kleur-groen-bg); color: var(--kleur-groen); }
.kaartje.waarschuwing-match .geschiktheid-badge { background: var(--kleur-geel-bg); color: var(--kleur-geel); }

.slot-lijst { display: flex; flex-direction: column; gap: 0.75rem; }
.slot-kaart.dropzone-actief { outline: 2px dashed var(--kleur-accent); outline-offset: 2px; }
.slot-kaart.actief-slot { border-color: var(--kleur-accent); box-shadow: 0 0 0 1px var(--kleur-accent); }

.slot-kop { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.5rem; }

.actiebalk {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  align-items: center;
}

.tekst-klein { font-size: 0.875rem; color: var(--kleur-grijs); }

/* --- Auth-paginas (login/uitnodiging/wachtwoord) --- */

.auth-wrap {
  display: flex;
  justify-content: center;
  padding-top: 2rem;
}
.auth-kaart {
  background: white;
  border: 1px solid var(--kleur-rand);
  border-radius: var(--radius);
  box-shadow: var(--schaduw-groot);
  padding: 2rem;
  width: 100%;
  max-width: 420px;
}
.auth-kaart.breed { max-width: 560px; }
.auth-kaart h1 { text-align: center; margin-bottom: 0.35rem; }
.auth-kaart .subtitel { text-align: center; color: var(--kleur-grijs); margin-bottom: 1.5rem; font-size: 0.9rem; }
.auth-kaart .knop { width: 100%; justify-content: center; }
.auth-links { text-align: center; margin-top: 1.25rem; font-size: 0.875rem; }

/* --- Stat-balk (dashboard/hub) --- */
.stat-balk {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.stat {
  background: white;
  border: 1px solid var(--kleur-rand);
  border-radius: var(--radius);
  padding: 0.85rem 1.25rem;
  box-shadow: var(--schaduw);
  min-width: 120px;
}
.stat .getal { font-size: 1.5rem; font-weight: 700; color: var(--kleur-primair); }
.stat .label { font-size: 0.8rem; color: var(--kleur-grijs); }
