/*
 * traject-board.css — the cross-app trajecten phase board (Story 15-8).
 * Ported from the locked mockup (ux-trajecten-board-2026-06-14/mockups/trajecten-board.html).
 * Tokens-only (survey-shared.css); `tb-` namespaced to avoid clashing with index.css /
 * trajecten-prototype.css. survey-shared.css is NOT edited.
 *
 * Layout: rows = trajecten (stable), columns = lifecycle phases. Clicking a phase
 * changes the lens (accent + per-cell action); rows never move. Neutral greyscale
 * except the active lens; non-selected nodes carry a hover tooltip.
 */

/* ── Board container ───────────────────────────────────────────────── */
.tb-board { margin: 0; }

/* shared grid template — header + every row use it so columns line up */
.tb-row { display: grid; grid-template-columns: minmax(220px, 1.2fr) repeat(4, minmax(132px, 1fr)); align-items: stretch; }

/* ── Header (new-traject + phase lens tabs) ────────────────────────── */
.tb-head { border-bottom: 1.5px solid var(--border); margin-bottom: 2px; }
.tb-new {
  align-self: center; justify-self: start; margin: 0 0 8px;
  font-family: 'Epilogue', sans-serif; font-size: 13px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px;
  background: var(--charcoal); color: var(--surface); border: 2px solid var(--charcoal);
  border-radius: 0; cursor: pointer; transition: filter .15s ease, transform .15s ease;
}
.tb-new:hover { transform: translateY(-1px); filter: brightness(1.18); }
.tb-new svg { width: 14px; height: 14px; }
.tb-phase {
  font-family: 'Epilogue', sans-serif; font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 12px 8px; background: none; border: none; border-bottom: 3px solid transparent;
  color: var(--charcoal-60); cursor: pointer; transition: color .15s ease, background .15s ease;
}
.tb-phase:hover { color: var(--text); background: var(--surface2); }
.tb-phase .tb-phn { white-space: nowrap; }
.tb-phase svg { width: 16px; height: 16px; }
.tb-phase.tb-sel { color: var(--pa); border-bottom-color: var(--pa); }
.tb-phase:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }

/* ── Rows ──────────────────────────────────────────────────────────── */
.tb-row.tb-traj { border-bottom: 1.5px solid var(--border-soft); transition: background .12s ease; }
.tb-row.tb-traj:hover { background: var(--surface2); }

.tb-name { display: flex; gap: 12px; align-items: flex-start; padding: 16px 14px 16px 4px; min-width: 0; }
.tb-avatar {
  width: 36px; height: 36px; border-radius: 3px; background: var(--surface2);
  border: 1.5px solid var(--border); color: var(--charcoal); font-family: 'Epilogue', sans-serif;
  font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; letter-spacing: .02em;
}
.tb-avatar.tb-stack { box-shadow: 3px 3px 0 0 var(--surface), 4px 4px 0 0 var(--border); }
.tb-info { min-width: 0; }
.tb-tname {
  font-family: 'Lora', Georgia, serif; font-size: 15.5px; font-weight: 600; color: var(--text);
  text-decoration: none; cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
  margin-bottom: 5px; word-break: break-word;
}
.tb-tname:hover { text-decoration: underline; text-underline-offset: 3px; }
.tb-tname .tb-ext { width: 12px; height: 12px; opacity: 0; transition: opacity .12s ease; }
.tb-tname:hover .tb-ext { opacity: .5; }
.tb-sub { font-size: 12px; color: var(--charcoal-60); display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.tb-waveno { font-size: 10px; letter-spacing: .04em; text-transform: uppercase; color: var(--teal-dark); border: 1.5px solid var(--teal-mid); border-radius: 2px; padding: 0 5px; }
.tb-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.tb-dot--live { background: var(--success); } .tb-dot--closed { background: var(--charcoal-60); } .tb-dot--draft { background: var(--amber); }
.tb-st { font-weight: 600; }
.tb-st--live { color: var(--success-dark); } .tb-st--closed { color: var(--charcoal-60); } .tb-st--draft { color: var(--amber); }
.tb-earlier { font-family: 'Epilogue', sans-serif; font-size: 12px; color: var(--charcoal-60); background: none; border: none; padding: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 3px; text-decoration: none; }
.tb-earlier svg { width: 12px; height: 12px; }
.tb-earlier:hover { color: var(--teal-dark); text-decoration: underline; }

/* ── Phase cells (track + action) ──────────────────────────────────── */
.tb-cell { position: relative; padding: 0 8px 14px; cursor: pointer; }
.tb-cell.tb-sel { background: var(--pa-soft); }
.tb-rail { position: relative; height: 32px; display: flex; align-items: center; justify-content: center; }
.tb-conn { position: absolute; top: 15px; height: 2px; background: var(--border); }
.tb-conn.tb-l { left: 0; width: 50%; } .tb-conn.tb-r { right: 0; width: 50%; }
.tb-conn.tb-reached { background: var(--charcoal-60); }
.tb-conn.tb-hidden { display: none; }
.tb-node {
  width: 15px; height: 15px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border);
  z-index: 1; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: box-shadow .12s ease;
}
.tb-node:hover { box-shadow: 0 0 0 5px rgba(51,65,85,.07); }
/* Reached/current phase nodes are one-click links straight to that phase's screen.
   inline-flex keeps the node's size/centering inside .tb-rail; the dot keeps its own hover. */
.tb-node-link { display: inline-flex; text-decoration: none; }
.tb-node.tb-done { background: var(--charcoal-60); border-color: var(--charcoal-60); }
.tb-node.tb-done svg { width: 9px; height: 9px; stroke: var(--surface); }
.tb-node.tb-current { background: var(--charcoal); border-color: var(--charcoal); box-shadow: 0 0 0 4px var(--border-soft); }
.tb-cell.tb-sel .tb-node.tb-current { background: var(--pa); border-color: var(--pa); box-shadow: 0 0 0 4px var(--pa-soft); }
.tb-node[data-tip]:hover::after {
  content: attr(data-tip); position: absolute; left: 50%; transform: translateX(-50%);
  bottom: calc(100% + 9px); background: var(--charcoal); color: var(--surface); font-size: 11px; font-weight: 500;
  letter-spacing: .02em; padding: 5px 9px; white-space: nowrap; z-index: 20; pointer-events: none;
}
.tb-node[data-tip]:hover::before {
  content: ''; position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(100% + 4px);
  border: 5px solid transparent; border-top-color: var(--charcoal); z-index: 20; pointer-events: none;
}
.tb-detail { min-height: 24px; display: flex; justify-content: center; align-items: center; }
.tb-btn {
  font-family: 'Epilogue', sans-serif; font-size: 12.5px; font-weight: 600; display: inline-flex;
  align-items: center; gap: 5px; padding: 6px 14px; background: var(--pa); color: var(--surface); border: 2px solid var(--pa);
  border-radius: 0; cursor: pointer; text-decoration: none; transition: filter .15s ease, transform .15s ease;
}
.tb-btn:hover { transform: translateY(-1px); filter: brightness(1.06); }
.tb-btn.tb-muted { background: transparent; color: var(--pa); }
.tb-btn svg { width: 13px; height: 13px; }
/* router: not actionable in this lens yet → go where you can act (neutral, quiet) */
.tb-route { font-family: 'Epilogue', sans-serif; font-size: 12.5px; font-weight: 500; color: var(--charcoal-60); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.tb-route:hover { color: var(--text); text-decoration: underline; }
.tb-route svg { width: 12px; height: 12px; }
.tb-lock { display: inline-flex; color: var(--charcoal-60); opacity: .3; }
.tb-lock svg { width: 14px; height: 14px; }

/* ── Auto-open / context note + legend ─────────────────────────────── */
.tb-note { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text-muted); background: var(--surface2); border: 1.5px solid var(--border-soft); padding: 9px 12px; margin: 0 0 16px; line-height: 1.5; }
.tb-note svg { width: 16px; height: 16px; flex-shrink: 0; stroke: var(--charcoal-60); }
.tb-legend { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 16px; font-size: 11px; color: var(--charcoal-60); align-items: center; }
.tb-legend .tb-sw { display: inline-flex; align-items: center; gap: 6px; }
.tb-legend .tb-node { position: static; box-shadow: none; cursor: default; }
.tb-empty { font-size: 14px; color: var(--text-muted); font-style: italic; padding: 24px 4px; }

@media (max-width: 720px) {
  .tb-row { grid-template-columns: 1fr; }
  .tb-cell { border-top: 1px solid var(--border-soft); padding-top: 8px; }
  .tb-conn { display: none; }
}

/* ── Picker chrome (Story 15-9) ────────────────────────────────────────
   The heading shown above a mounted board when an app opens with no target
   selected (Resultaten / Actieplannen no-traject entry). Shared so every
   app's "pick a traject" screen reads identically. Tokens-only. */
.tb-pick { max-width: 1180px; margin: 0 auto; padding: 32px 28px 48px; }
.tb-pick-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--charcoal-60); margin: 0 0 8px; }
.tb-pick-title { font-family: 'Lora', Georgia, serif; font-size: 28px; font-weight: 600; margin: 0 0 8px; color: var(--charcoal); }
.tb-pick-sub { font-size: 14px; color: var(--text-muted); line-height: 1.6; margin: 0 0 20px; max-width: 60ch; }

/* ── Stage-filter toggle (Story 15-10b) ────────────────────────────────
   A subtle, right-aligned, text-only toggle on a picker: "Only this stage ·
   All stages" (no label). Active = charcoal + underline; rest muted. */
.tb-filter { display: flex; justify-content: flex-end; align-items: center; gap: 7px; margin: 0 0 6px; }
.tb-ftog { font-family: inherit; font-size: 12px; font-weight: 500; color: var(--text-muted); cursor: pointer; background: none; border: none; padding: 0; }
.tb-ftog:hover { color: var(--text); }
.tb-ftog.tb-on { color: var(--text); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.tb-fdot { color: var(--border); }
