:root {
  --page: #f5f5f0;
  --month-bg: #fff9cc;
  --paper: #ffffff;
  --ink: #111111;
  --muted: #666666;
  --brand: #111111;
  --accent: #fff200;
  --line: #2b2b2b;
  --vakantie: #f4c7a1;
  --leden: #8fd3e8;
  --bestuursvergadering: #FDE382;
  --combioverleg: #efb3d1;
  --groepsraad: #b18ad6;
  --deadline: #d40000;
  --kampen: #9bd27d;
  --no-meeting: #c56a2d;
  --radius: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--page);
}

.page {
  max-width: 1260px;
  margin: 0 auto;
  padding: 24px;
}

header {
  background: var(--brand);
  color: white;
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
}

h1 {
  margin: 0 0 8px;
  font-size: clamp(1.5rem, 3vw, 2.6rem);
  line-height: 1.1;
}

header p {
  margin: 0;
  color: #eeeeee;
  max-width: 78ch;
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  background: var(--paper);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
}

.top-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.search {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #cccccc;
  border-radius: 12px;
  font-size: 1rem;
}

.tabs,
.switches,
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

button,
label.filter-pill {
  border: 1px solid #bbbbbb;
  background: white;
  color: #111111;
  padding: 9px 12px;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  user-select: none;
}

button.active {
  background: var(--accent);
  color: #111111;
  border-color: #111111;
  box-shadow: inset 0 0 0 2px #111111;
}

label.filter-pill input { margin-right: 6px; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 20px;
  font-size: .9rem;
}

.legend span {
  padding: 5px 8px;
  border-radius: 7px;
  border: 1px solid rgba(0,0,0,.25);
  background: white;
}

.year-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 960px) {
  .year-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.month-card {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 12px;
  background: var(--month-bg);
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 4px 14px rgba(0,0,0,.1);
  overflow: hidden;
  break-inside: avoid;
  align-content: start;
  align-items: start;
}

.month-card > div {
  align-self: start;
}

@media (max-width: 680px) {
  .month-card { grid-template-columns: 1fr; }
}

.month-title {
  grid-column: 1 / -1;
  margin: -12px -12px 0;
  height: 34px;
  padding: 0 12px;
  background: #111111;
  color: var(--accent);
  font-weight: 800;
  text-align: center;

  display: flex;
  align-items: center;
  justify-content: center;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

table.calendar {
  width: 100%;
  border-collapse: collapse;
  background: #fffce0;
  font-size: .82rem;
}

.calendar th,
.calendar td {
  border: 1px solid var(--line);
  text-align: center;
  height: 26px;
  padding: 2px;
}

.calendar th {
  background: #111111;
  color: var(--accent);
  font-size: .75rem;
}

.calendar .weeknr {
  background: #111111;
  color: var(--accent);
  width: 32px;
  font-style: italic;
}

.calendar .outside {
  color: #aaaaaa;
  background: #fff8b8;
}

.calendar .weekend { background: #eeeeee; }

.calendar .has-event {
  outline: 2px solid rgba(0,0,0,.35);
  outline-offset: -2px;
}

.calendar .special-day { font-weight: 800; }
.calendar .deadline-day { color: #d40000; }

.events-list {
  display: grid;
  gap: 4px;
  align-content: start;
  font-size: .9rem;
}

.event-row {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 8px;
  border-radius: 7px;
  padding: 4px 6px;
  line-height: 1.25;
}

.event-date {
  font-variant-numeric: tabular-nums;
  color: #222222;
}

.deadline-icon {
  color: #d40000;
  font-weight: 900;
  margin-right: 4px;
}

.agenda-list {
  display: grid;
  gap: 10px;
}

.agenda-month { margin: 24px 0 6px; }

.agenda-item {
  background: white;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 3px 12px rgba(0,0,0,.08);
  border-left: 10px solid #dddddd;
}

.agenda-item h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
}

.agenda-meta {
  color: var(--muted);
  font-size: .92rem;
}

.empty {
  background: white;
  border-radius: 12px;
  padding: 24px;
  color: var(--muted);
}

@media print {
  body { background: white; }
  .toolbar { display: none; }
  .page { max-width: none; padding: 0; }
  .month-card, .agenda-item, header { box-shadow: none; }
  .year-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
