:root {
  --ink: #172033;
  --muted: #5b6478;
  --line: #d8deea;
  --panel: #fff;
  --soft: #f5f7fb;
  --sky: #dff3ff;
  --mint: #dff7e8;
  --sun: #ffe49d;
  --rose: #ffdbe4;
  --violet: #e8e0ff;
  --green: #23824d;
  --red: #b3374b;
  font-family: ui-rounded, "SF Pro Rounded", "SF Pro Display", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(47, 111, 219, .08) 1px, transparent 1px),
    linear-gradient(rgba(47, 111, 219, .08) 1px, transparent 1px),
    #f8fafc;
  background-size: 32px 32px;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; }

.top-lock {
  background: #172033;
  color: #fff;
  padding: 10px 18px;
  font-weight: 800;
  text-align: center;
}
.top-lock span { color: var(--sun); }

.app {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: calc(100vh - 44px);
}
.sidebar {
  background: rgba(255,255,255,.92);
  border-right: 1px solid var(--line);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}
.brand-mark, .avatar {
  width: 48px;
  height: 48px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  box-shadow: 4px 4px 0 #172033;
  display: grid;
  place-items: center;
  background: conic-gradient(from 180deg, var(--sky), var(--sun), var(--mint), var(--rose), var(--sky));
  font-weight: 900;
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: 1.35rem; line-height: 1.1; }
h2 { font-size: clamp(1.8rem, 3vw, 2.9rem); line-height: 1; }
h3 { font-size: 1.18rem; }
.subtitle { color: var(--muted); font-size: .94rem; margin-top: 3px; }

.nav { display: grid; gap: 8px; }
.nav a {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  border: 2px solid transparent;
}
.nav a.active {
  border-color: var(--ink);
  background: var(--sky);
  box-shadow: 3px 3px 0 #172033;
  font-weight: 900;
}
.nav svg, .button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.account {
  margin-top: auto;
  display: grid;
  gap: 10px;
}
.account-card {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  align-items: center;
  background: var(--soft);
  padding: 10px;
  border-radius: 8px;
}
.avatar { width: 42px; height: 42px; background: var(--sun); box-shadow: none; }

main { padding: 28px; min-width: 0; }
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 20px;
}
.actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.button, button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 9px 12px;
  text-decoration: none;
  font-weight: 850;
  box-shadow: 3px 3px 0 #172033;
  cursor: pointer;
}
.button.primary, button.primary { background: var(--sun); }
.button.danger, button.danger { background: var(--rose); }

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
  gap: 18px;
  align-items: start;
}
.grid.lower { margin-top: 18px; }
.section {
  background: rgba(255,255,255,.88);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 4px 24px rgba(23, 32, 51, .07);
  padding: 18px;
}
.section + .section { margin-top: 18px; }
.section-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}
.list { display: grid; gap: 10px; }
.row {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 10px;
  align-items: center;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}
.state {
  width: 28px;
  height: 28px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #fff;
  font-weight: 900;
}
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 8px;
  background: #fff;
  color: var(--muted);
  font-size: .84rem;
  white-space: nowrap;
}
.tag.good { background: var(--mint); color: var(--green); border-color: #a7ddbb; }
.tag.warn { background: var(--sun); color: #7b4d00; border-color: #e4c15e; }
.tag.bad { background: var(--rose); color: var(--red); border-color: #edaabd; }

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.card {
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 14px;
  box-shadow: 3px 3px 0 #172033;
}
.card p { color: var(--muted); font-size: .92rem; line-height: 1.35; margin-top: 4px; }

.form-grid {
  display: grid;
  gap: 10px;
}
.form-grid.wide {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
}
.form-grid.wide label:has(textarea) { grid-column: 1 / -1; }
.spaced { margin-top: 14px; }
label { font-weight: 850; display: grid; gap: 5px; }
input, select, textarea {
  min-height: 42px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
}
textarea { min-height: 92px; resize: vertical; }
.inline-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 8px;
  align-items: end;
}
.notice {
  border: 2px solid var(--ink);
  background: var(--sky);
  box-shadow: 3px 3px 0 #172033;
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 18px;
}
.notice.small { margin-bottom: 12px; box-shadow: none; }
.kid-shell {
  min-height: 620px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: linear-gradient(180deg, var(--sky), #fff 45%, var(--mint));
  padding: 22px;
  box-shadow: 0 14px 40px rgba(23,32,51,.12);
}
.quest-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 14px;
  margin-top: 20px;
}
.quest {
  min-height: 150px;
  display: grid;
  place-items: center;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 900;
}
.quest-emoji {
  display: block;
  font-size: 2rem;
  line-height: 1;
  letter-spacing: 0;
}
.kid-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 18px;
}
.kid-choice.compact .kid-card { min-height: 170px; }
.kid-card {
  min-height: 240px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  box-shadow: 5px 5px 0 #172033;
  background: linear-gradient(160deg, var(--sun), #fff 48%, var(--sky));
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  text-decoration: none;
  text-align: center;
}
.kid-card.bouw { background: linear-gradient(160deg, var(--mint), #fff 48%, var(--rose)); }
.kid-card span {
  width: 86px;
  height: 86px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #fff;
  font-size: 3rem;
  font-weight: 950;
}
.kid-card strong { font-size: 2rem; }
.kid-card small { color: var(--muted); font-weight: 800; }
.kid-note {
  margin-top: 18px;
  font-weight: 900;
  color: var(--muted);
}
.kid-panel {
  margin-top: 22px;
  background: rgba(255,255,255,.82);
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 14px;
}
.kid-panel h3 { margin-bottom: 10px; }
.kid-wizard {
  display: grid;
  gap: 14px;
  max-width: 640px;
}
.kid-wizard label {
  font-size: 1.15rem;
}
.big {
  min-height: 62px;
  font-size: 1.12rem;
}
.decision-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid { grid-template-columns: 1fr; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inline-form, .form-grid.wide { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  main { padding: 16px; }
  .topbar, .section-header { display: grid; }
  .nav, .cards, .quest-grid, .inline-form, .form-grid.wide, .kid-choice { grid-template-columns: 1fr; }
  .row { grid-template-columns: 34px 1fr; }
  .row .tag, .row form { grid-column: 2; justify-self: start; }
  h2 { font-size: 2rem; }
  .kid-card { min-height: 190px; }
}
