/* Isomind Planner */
@font-face { font-family: "Plex"; src: url("fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex"; src: url("fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex"; src: url("fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Plex Condensed"; src: url("fonts/ibm-plex-sans-condensed-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --paper: #edf0f4;
  --surface: #ffffff;
  --ink: #16202e;
  --ink-2: #4a5668;
  --ink-3: #6d7889;
  --line: #d3dae3;
  --cobalt: #2447d6;
  --cobalt-soft: #e4e9fb;
  --done: #1f8a5b;
  --doing: #b86e00;
  --blocked: #c2372e;
  --todo: #a9b3c1;
  --rail: #16202e;
  --rail-ink: #c9d2df;
  --sans: "Plex", "Segoe UI", system-ui, sans-serif;
  --cond: "Plex Condensed", "Plex", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.55 var(--sans); }
a { color: var(--cobalt); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3 { line-height: 1.2; margin: 0; font-weight: 600; }
h1 { font-size: 1.75rem; letter-spacing: -0.01em; }
h2 { font-size: 1.125rem; }
h3 { font-size: 0.9375rem; }
p { margin: 0 0 0.75rem; max-width: 72ch; }
ul, ol { margin: 0; padding: 0; }
.muted { color: var(--ink-3); }
.small { font-size: 0.875rem; }
.nowrap { white-space: nowrap; }
.code { font-family: var(--cond); font-weight: 600; font-variant-numeric: tabular-nums; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--surface); padding: 0.5rem 0.75rem; z-index: 10; }

/* ── raamwerk ── */
.shell { display: grid; grid-template-columns: 17.5rem minmax(0, 1fr); min-height: 100vh; }
.rail { background: var(--rail); color: var(--rail-ink); padding: 1.5rem 1.25rem; display: flex; flex-direction: column; gap: 1.5rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.rail a { color: inherit; text-decoration: none; }
main { padding: 2rem 2.5rem 4rem; max-width: 76rem; width: 100%; }

.brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 600; font-size: 1.125rem; color: #fff; margin: 0; }
.rail .brand { color: #fff; }
.brand-sub { font-weight: 400; color: var(--ink-3); }
.rail .brand-sub { color: #8d99aa; }
/* twee gelijke vormen: origineel en kopie */
.brand-mark { width: 1.375rem; height: 1.375rem; position: relative; flex: none; }
.brand-mark::before, .brand-mark::after { content: ""; position: absolute; width: 0.875rem; height: 0.875rem; border: 2px solid currentColor; border-radius: 2px; }
.brand-mark::before { left: 0; top: 0; opacity: 0.45; }
.brand-mark::after { right: 0; bottom: 0; background: var(--cobalt); border-color: var(--cobalt); }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { padding: 0.45rem 0.75rem; border-radius: 4px; font-weight: 500; }
.nav a:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.nav a[aria-current="page"] { background: var(--cobalt); color: #fff; }

.spine { list-style: none; display: flex; flex-direction: column; border-top: 1px solid rgba(255, 255, 255, 0.12); padding-top: 1rem; }
.spine-item a { display: grid; grid-template-columns: 1.75rem 1fr; gap: 0.5rem; padding: 0.55rem 0.25rem; border-radius: 4px; }
.spine-item a:hover { background: rgba(255, 255, 255, 0.05); }
.spine-code { font-family: var(--cond); font-weight: 600; font-size: 1.5rem; line-height: 1; color: #5d6a7d; }
.spine-doing .spine-code { color: #fff; }
.spine-done .spine-code { color: #5fc79a; }
.spine-body { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.spine-title { color: #fff; font-weight: 500; font-size: 0.9375rem; line-height: 1.3; }
.spine-meta { font-size: 0.8125rem; color: #8d99aa; }
.meter { display: block; height: 4px; background: rgba(255, 255, 255, 0.13); border-radius: 2px; margin-top: 0.3rem; overflow: hidden; }
.meter > span { display: block; height: 100%; background: #5fc79a; }
.logout { margin-top: auto; }
.link { background: none; border: 0; padding: 0; font: inherit; color: #8d99aa; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.link:hover { color: #fff; }

/* ── koppen ── */
.page-head { margin-bottom: 1.75rem; }
.page-head.row { display: flex; justify-content: space-between; align-items: flex-end; gap: 1.5rem; flex-wrap: wrap; }
.lede { color: var(--ink-2); margin: 0.4rem 0 0; }
.crumb { margin: 0 0 0.2rem; font-size: 0.875rem; }

.flash { padding: 0.7rem 1rem; border-radius: 4px; margin-bottom: 1.5rem; max-width: none; border-left: 4px solid var(--done); background: #e6f4ed; }
.flash-err { border-left-color: var(--blocked); background: #fbeae8; }

/* ── knoppen en formulieren ── */
.btn { display: inline-block; font: 500 0.9375rem/1.2 var(--sans); padding: 0.6rem 0.95rem; border-radius: 4px; border: 1px solid var(--ink); background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--paper); }
.btn-primary { background: var(--cobalt); border-color: var(--cobalt); color: #fff; }
.btn-primary:hover { background: #1b37ad; }
.btn-quiet { border-color: transparent; background: none; color: var(--cobalt); text-decoration: underline; text-underline-offset: 2px; padding-left: 0.3rem; padding-right: 0.3rem; }
.btn-quiet:hover { background: none; text-decoration-thickness: 2px; }
.btn-danger { border-color: var(--blocked); color: var(--blocked); }
.btn[disabled] { border-color: var(--line); background: var(--paper); color: var(--ink-3); cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin-top: 1.1rem; }
.actions.split { border-top: 1px solid var(--line); padding-top: 1.1rem; }
.inline { display: inline; }

label { display: block; font-weight: 500; font-size: 0.9375rem; margin: 1rem 0 0.3rem; }
input, select, textarea { font: inherit; color: inherit; width: 100%; padding: 0.55rem 0.7rem; border: 1px solid #9aa5b4; border-radius: 4px; background: var(--surface); }
textarea { resize: vertical; line-height: 1.5; }
input.short { max-width: 9rem; }
input[type="checkbox"] { width: 1.15rem; height: 1.15rem; padding: 0; accent-color: var(--done); flex: none; margin: 0.2rem 0 0; }
input[type="file"] { border: 0; padding: 0; }
.hint { font-size: 0.8125rem; color: var(--ink-3); margin: 0.3rem 0 0; }
.form { max-width: 46rem; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 0 1.25rem; }
.form-row.tight { grid-template-columns: 7rem 1fr; }
.danger { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); max-width: 46rem; }
.phase-form { padding-bottom: 1.5rem; margin-bottom: 0.5rem; border-bottom: 1px solid var(--line); }
.phase-form:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.phase-form .btn { margin-top: 0.9rem; }
.phase-form h3 { margin-top: 1rem; }

/* ── nu aan de beurt ── */
.now { display: grid; grid-template-columns: minmax(0, 1fr) 17rem; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; margin-bottom: 1.75rem; }
.now-main { padding: 1.75rem 2rem 1.75rem; min-width: 0; }
.now-head { display: flex; gap: 1.25rem; align-items: center; margin-bottom: 0.9rem; }
.now-code { font-family: var(--cond); font-weight: 600; font-size: 4.25rem; line-height: 0.9; color: var(--cobalt); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; flex: none; }
.now-label { margin: 0 0 0.15rem; color: var(--ink-2); font-size: 0.9375rem; }
.now h2 { font-size: 1.5rem; letter-spacing: -0.01em; }
.now h2 a { color: inherit; text-decoration: none; }
.now h2 a:hover { text-decoration: underline; }
.now-goal { font-size: 1.0625rem; color: var(--ink-2); max-width: 62ch; }
.now-cols { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 2rem; margin-top: 1.4rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.now-cols h3, .now-next h3 { margin-bottom: 0.6rem; }
.now-next { border-left: 1px solid var(--line); padding: 1.75rem 1.5rem; background: #f8f9fb; border-radius: 0 6px 6px 0; }
.next-list { list-style: none; display: flex; flex-direction: column; gap: 0.15rem; }
.next-list a { display: grid; grid-template-columns: 2.4rem 1fr; gap: 0.4rem; padding: 0.5rem 0.4rem; margin: 0 -0.4rem; border-radius: 4px; color: inherit; text-decoration: none; line-height: 1.35; }
.next-list a:hover { background: var(--cobalt-soft); }
.next-list .code { color: var(--ink-3); font-size: 1.0625rem; }
.next-list .small { display: block; }
.count { font-weight: 400; color: var(--ink-3); margin-left: 0.4rem; }

.plain { list-style: none; }
.plain li { padding-left: 1rem; position: relative; margin-bottom: 0.35rem; line-height: 1.45; }
.plain li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 0.4rem; height: 2px; background: var(--ink-3); }
.plain + .small { margin-top: 0.9rem; }

.checks { list-style: none; }
.checks li { border-top: 1px solid var(--line); }
.checks li:first-child { border-top: 0; }
.checks label { display: flex; gap: 0.7rem; margin: 0; padding: 0.55rem 0; font-weight: 400; font-size: 1rem; line-height: 1.45; cursor: pointer; }
.checks input:checked + span { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--todo); }
.checks .muted { padding: 0.55rem 0; }

/* ── cijfers ── */
.figures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 0 1.75rem; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); }
.figures > div { padding: 1rem 1.25rem 1.1rem 0; }
.figures > div + div { padding-left: 1.25rem; border-left: 1px solid var(--line); }
.figures dt { color: var(--ink-2); font-size: 0.9375rem; }
.figures dd { margin: 0.15rem 0 0; font-family: var(--cond); font-weight: 600; font-size: 2.125rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.figures dd span { display: block; font: 400 0.875rem/1.4 var(--sans); color: var(--ink-3); margin-top: 0.2rem; }

/* ── grafieken ── */
.charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.chart { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 1.25rem 1.4rem 1.1rem; min-width: 0; }
.chart-wide { grid-column: 1 / -1; }
.chart figcaption { font-weight: 600; margin-bottom: 0.9rem; }
.canvas-box { position: relative; height: 15rem; }
.chart-wide .canvas-box { height: 17rem; }

/* ── lijsten met stappen ── */
.filters { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1.5rem; }
.filters a { padding: 0.3rem 0.75rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); text-decoration: none; font-size: 0.9375rem; }
.filters a[aria-current="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.phase { margin-bottom: 2.5rem; scroll-margin-top: 1rem; }
.phase h2 { font-size: 1.375rem; display: flex; gap: 0.6rem; align-items: baseline; }
.phase h2 .code { color: var(--cobalt); font-size: 1.75rem; }
.phase-goal { color: var(--ink-2); margin: 0.3rem 0 0.9rem; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.steps { width: 100%; border-collapse: collapse; min-width: 44rem; }
.steps th { text-align: left; font-weight: 500; font-size: 0.875rem; color: var(--ink-2); padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--line); background: #f8f9fb; }
.steps td { padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.steps tr:last-child td { border-bottom: 0; }
.steps td.code { font-size: 1.125rem; color: var(--ink-2); width: 3.5rem; }
.steps td a { font-weight: 500; color: var(--ink); }
.steps .sub { display: block; color: var(--ink-3); font-size: 0.875rem; line-height: 1.4; margin-top: 0.15rem; max-width: 60ch; }
.steps .num { text-align: right; font-variant-numeric: tabular-nums; }
.steps tr.is-done td a { color: var(--ink-3); }

.pill { display: inline-block; font-size: 0.8125rem; font-weight: 500; padding: 0.15rem 0.6rem; border-radius: 999px; white-space: nowrap; border: 1px solid; }
.pill-todo { color: var(--ink-2); border-color: var(--todo); background: #f3f5f8; }
.pill-doing { color: #7a4900; border-color: #e0b56f; background: #fdf3e0; }
.pill-done { color: #14633f; border-color: #8fcdb0; background: #e6f4ed; }
.pill-blocked { color: #8f251e; border-color: #e3a29d; background: #fbeae8; }

/* ── één stap ── */
.step-head { display: grid; grid-template-columns: auto 1fr auto; gap: 1.5rem; align-items: center; }
.step-meta { color: var(--ink-2); margin: 0.5rem 0 0; }
.step-meta .pill { margin-right: 0.5rem; }
.step-grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 2.5rem; align-items: start; }
.step-text section { margin-bottom: 1.75rem; }
.step-text h2, .panel h2 { margin-bottom: 0.5rem; }
.step-text p { font-size: 1.0625rem; line-height: 1.6; max-width: 62ch; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 1.4rem 1.5rem 1.5rem; margin-bottom: 1.25rem; }
.panel > p { color: var(--ink-2); }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.pager a { text-decoration: none; color: var(--ink); font-weight: 500; }
.pager a:hover { color: var(--cobalt); }
.pager .small { display: block; font-weight: 400; }
.pager .right { text-align: right; }

/* ── tijdlijn ── */
.gantt-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.gantt { min-width: 60rem; padding: 0.5rem 1.25rem 1rem 0; }
.gantt-row { display: grid; grid-template-columns: 19rem 1fr; align-items: center; min-height: 1.875rem; }
.gantt-label { padding: 0 1rem 0 1.25rem; font-size: 0.875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: sticky; left: 0; background: var(--surface); z-index: 2; }
.gantt-label a { color: var(--ink); text-decoration: none; }
.gantt-label a:hover { color: var(--cobalt); text-decoration: underline; }
.gantt-label .code { color: var(--ink-3); display: inline-block; min-width: 2.1rem; }
.gantt-track { position: relative; height: 1.875rem; }
.gantt-months { min-height: 2rem; border-bottom: 1px solid var(--line); }
.gantt-months .gantt-track { height: 2rem; }
.month { position: absolute; top: 0.45rem; font-size: 0.8125rem; color: var(--ink-2); padding-left: 0.35rem; border-left: 1px solid var(--line); white-space: nowrap; }
.gantt-phase .gantt-label { font-weight: 600; font-size: 0.9375rem; padding-top: 0.7rem; }
.gantt-phase .gantt-label .code { color: var(--cobalt); font-size: 1.125rem; min-width: 1.2rem; }
.gantt-phase { min-height: 2.5rem; align-items: end; }
.grid { position: absolute; top: 0; bottom: 0; width: 1px; background: #eceff3; }
.today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--cobalt); z-index: 1; }
.bar { position: absolute; top: 0.45rem; height: 0.8rem; border-radius: 2px; background: var(--todo); }
.bar-doing { background: var(--doing); }
.bar-done { background: var(--done); }
.bar-blocked { background: var(--blocked); }
.base { position: absolute; top: 1.4rem; height: 3px; background: #c3cbd6; border-radius: 1px; }
.legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; margin-top: 0.9rem; font-size: 0.875rem; color: var(--ink-2); max-width: none; }
.legend span { display: inline-flex; align-items: center; gap: 0.4rem; }
.legend i { position: static; display: inline-block; width: 1.5rem; }
.legend i.bar { height: 0.7rem; }
.legend i.today { width: 2px; height: 0.9rem; }

/* ── inloggen ── */
.login-page { display: grid; place-items: center; min-height: 100vh; padding: 1.5rem; }
.login { width: 100%; max-width: 22rem; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 2rem 2rem 2.25rem; }
.login .brand { color: var(--ink); margin-bottom: 1.5rem; }
.login h1 { font-size: 1.375rem; margin-bottom: 0.5rem; }
.login .btn { margin-top: 1.4rem; width: 100%; }
.login .flash { margin: 0.75rem 0 0; }

/* ── smalle schermen ── */
@media (max-width: 62rem) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; padding: 1rem 1.25rem; gap: 0.9rem; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .spine { flex-direction: row; overflow-x: auto; padding-top: 0.75rem; gap: 0.5rem; }
  .spine-item { flex: 0 0 11.5rem; }
  .logout { margin-top: 0; }
  main { padding: 1.5rem 1.25rem 3rem; }
  .now { grid-template-columns: 1fr; }
  .now-next { border-left: 0; border-top: 1px solid var(--line); border-radius: 0 0 6px 6px; }
  .step-grid { grid-template-columns: 1fr; gap: 1rem; }
}
@media (max-width: 44rem) {
  h1 { font-size: 1.5rem; }
  .now-main { padding: 1.25rem; }
  .now-code { font-size: 3.25rem; }
  .now-cols { grid-template-columns: 1fr; gap: 1.25rem; }
  .figures { grid-template-columns: 1fr 1fr; }
  .figures > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .figures > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .charts { grid-template-columns: 1fr; }
  .step-head { grid-template-columns: auto 1fr; }
  .step-head .btn { grid-column: 1 / -1; justify-self: start; }
  .form-row.tight { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: no-preference) {
  .meter > span { transition: width 0.3s ease; }
}

/* knop onder het notitieformulier op een eigen regel */
.panel form > .btn { display: block; margin-top: 1rem; }
