:root {
  --green: #14564f;
  --purple: #27104f;
  --lilac: #ddd3ff;
  --mint: #c9ece5;
  --sand: #e5e2d6;
  --page: #f7f5f0;
  --paper: #fff;
  --muted: #5d5966;

  --level0: #ebe9e2;
  --level1: #ddd3ff;
  --level2: #c9ece5;
  --level3: #78bfb2;
  --level4: #14564f;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--page);
  color: var(--purple);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}


/* Header */

.site-header {
  padding: 14px 0;
  background: var(--green);
  color: #fff;
}

.header-inner,
.shell {
  width: min(1160px, calc(100% - 48px));
  margin: 0 auto;
}

.header-inner {
  min-height: 58px;
  display: flex;
  align-items: center;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.brand-text strong {
  font-size: 1rem;
}

.brand-text span {
  margin-top: 3px;
  color: rgb(255 255 255 / 75%);
  font-size: 0.75rem;
}


/* Layout */

.shell {
  padding: 22px 0 24px;
}

.section-block {
  margin-bottom: 18px;
}

.section-block:last-child {
  margin-bottom: 0;
}

.surface {
  padding: 18px 20px;
  background: var(--paper);
  border-top: 4px solid var(--green);
}


/* Legenda */

.section-heading {
  margin-bottom: 12px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  color: var(--muted);
  font-size: 0.78rem;
}

.legend span {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.legend i {
  width: 13px;
  height: 13px;
  flex: none;
}

.level-0 { background: var(--level0); }
.level-1 { background: var(--level1); }
.level-2 { background: var(--level2); }
.level-3 { background: var(--level3); }
.level-4 { background: var(--level4); }


/* Heatmap */

.heatmap-wrap {
  width: 100%;
  padding: 7px 0 4px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.heatmap {
  display: grid;
  width: max-content;
  min-width: max-content;
  align-items: center;
  gap: 3px 7px;
}

.heatmap .name {
  width: 120px;
  display: flex;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.day-header {
  width: 30px;
  min-height: 34px;
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  text-align: center;
}

.day-header small {
  display: block;
  margin-top: 3px;
  color: #8a8690;
  font-size: 0.62rem;
  font-weight: 400;
  text-transform: uppercase;
}

.cell {
  width: 30px;
  height: 30px;
  border: 0;
}

.cell:hover {
  outline: 2px solid var(--purple);
  outline-offset: 2px;
}


/* Studentkaarten */

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.card {
  min-width: 0;
  padding: 15px 16px 14px;
}

.card:nth-child(3n + 1) { background: var(--lilac); }
.card:nth-child(3n + 2) { background: var(--mint); }
.card:nth-child(3n) { background: var(--sand); }

.card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
}

.person {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  font-weight: 700;
  white-space: nowrap;
}

.percentage {
  color: var(--green);
  font-size: 1.35rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.progress {
  height: 5px;
  margin-bottom: 11px;
  background: rgb(255 255 255 / 62%);
}

.progress > div {
  height: 100%;
  background: var(--green);
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  color: #514b60;
  font-size: 0.72rem;
}

.stats strong {
  display: block;
  margin-bottom: 1px;
  color: var(--purple);
  font-size: 0.88rem;
}


/* Tooltip */

.tooltip {
  position: fixed;
  z-index: 100;
  max-width: 300px;
  padding: 11px 13px;
  background: var(--purple);
  color: #fff;
  font-size: 12px;
  line-height: 1.5;
  pointer-events: none;
}

.tooltip strong {
  display: block;
  margin-bottom: 3px;
}

.tooltip .muted {
  color: #ddd6eb;
}


/* Grote desktop */

@media (min-width: 1400px) and (min-height: 850px) {
  .cards {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}


/* Tablet */

@media (max-width: 900px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* Mobiel */

@media (max-width: 700px) {
  .header-inner,
  .shell {
    width: calc(100% - 24px);
  }

  .site-header {
    padding: 12px 0;
  }

  .header-inner {
    min-height: 54px;
  }

  .brand-text strong {
    font-size: 0.95rem;
  }

  .brand-text span {
    font-size: 0.7rem;
  }

  .shell {
    padding: 18px 0 24px;
  }

  .surface {
    padding: 14px 12px;
  }

  .legend {
    gap: 7px 12px;
    font-size: 0.7rem;
  }

  .legend i {
    width: 12px;
    height: 12px;
  }

  .heatmap-wrap {
    overscroll-behavior-x: contain;
  }

  .heatmap {
    gap: 3px 5px;
  }

  .heatmap .name {
    width: 90px;
    min-width: 90px;
    height: 28px;
    font-size: 0.76rem;
  }

  .day-header {
    width: 28px;
    min-width: 28px;
    min-height: 36px;
    font-size: 0.68rem;
  }

  .day-header small {
    font-size: 0.55rem;
  }

  .cell {
    width: 28px;
    min-width: 28px;
    height: 28px;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 18px 14px;
  }

  .card-top {
    margin-bottom: 12px;
  }

  .percentage {
    font-size: 1.3rem;
  }

  .stats {
    gap: 8px 20px;
  }
}