:root {
  --ink: #20262b;
  --ink-soft: #5e666d;
  --paper: #f6f3ee;
  --card: #fffdfa;
  --line: #e4ded4;
  --side: #1e2a30;
  --side-text: #c8d0d3;
  --claret: #7c2f3f;
  --claret-dark: #5f2130;
  --gold: #a9812f;
  --ok: #2f6b57;
  --warn: #a4611b;
  --bad: #a22e35;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.5 var(--sans);
}
body.bare { display: flex; align-items: center; justify-content: center; padding: 24px; }

a { color: var(--claret); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0; }
h1 { font-size: 30px; }
h2 { font-size: 19px; margin-bottom: 14px; }
h3 { font-size: 16px; margin: 18px 0 8px; }
p { margin: 0 0 8px; }

.side {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 26px 16px 18px;
  background: var(--side);
  color: var(--side-text);
}
.brand { font: 600 30px/1 var(--serif); color: #fff; letter-spacing: .02em; padding: 0 10px; }
.brand:hover { text-decoration: none; }
.brand em { color: #d2a95b; font-style: italic; }
.side nav { display: grid; gap: 2px; margin-top: 30px; }
.side nav a { color: var(--side-text); padding: 8px 10px; border-radius: 6px; }
.side nav a:hover { background: rgba(255, 255, 255, .07); text-decoration: none; }
.side nav a[aria-current] { background: rgba(255, 255, 255, .12); color: #fff; }
.user { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid rgba(255, 255, 255, .12); font-size: 13px; }
.user span { display: block; color: #fff; }
.link { background: none; border: 0; padding: 0; color: var(--side-text); font: inherit; cursor: pointer; text-decoration: underline; }

main { padding: 32px 40px 72px; max-width: 1240px; width: 100%; }

.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.top p { margin: 6px 0 0; }
.crumb { font-size: 13px; }
.sub { color: var(--ink-soft); font-size: 13px; }
.count {
  display: inline-block;
  min-width: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: var(--line);
  color: var(--ink-soft);
  font: 600 12px/20px var(--sans);
  text-align: center;
  vertical-align: middle;
}

.btn {
  display: inline-block;
  padding: 7px 13px;
  border: 1px solid #cfc7b9;
  border-radius: 6px;
  background: var(--card);
  color: var(--ink);
  font: 500 14px/1.3 var(--sans);
  cursor: pointer;
}
.btn:hover { border-color: var(--claret); text-decoration: none; }
.btn.primary, button.primary {
  padding: 8px 15px;
  border: 1px solid var(--claret);
  border-radius: 6px;
  background: var(--claret);
  color: #fff;
  font: 500 14px/1.3 var(--sans);
  cursor: pointer;
}
.btn.primary:hover, button.primary:hover { background: var(--claret-dark); }

.card { margin-bottom: 18px; padding: 20px 22px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; }
.columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.empty { padding: 26px; color: var(--ink-soft); text-align: center; }

.pipeline { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin-bottom: 30px; }
.stage { padding: 14px 14px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; color: var(--ink); }
.stage:hover { border-color: var(--claret); text-decoration: none; }
.stage b { display: block; font: 600 28px/1.1 var(--serif); }
.stage span { font-size: 13px; color: var(--ink-soft); }

.alerts { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.alerts li { border-left: 3px solid var(--line); }
.alerts li + li { border-top: 1px solid var(--line); }
.alerts li.lvl1 { border-left-color: var(--bad); }
.alerts li.lvl2 { border-left-color: var(--gold); }
.alerts a { display: grid; grid-template-columns: 210px 220px minmax(0, 1fr); gap: 12px; padding: 10px 16px; color: var(--ink); }
.alerts a:hover { background: #fbf7f0; text-decoration: none; }
.alerts strong { font-weight: 600; }
.alerts .detail { color: var(--ink-soft); }

.pill { display: inline-block; padding: 1px 9px; border-radius: 11px; background: #ece7dd; color: var(--ink); font-size: 12.5px; white-space: nowrap; }
.s-lead, .s-concept { background: #ece7dd; }
.s-intake_gepland, .s-intake_gedaan, .s-profiel_in_opmaak, .s-voorgesteld, .s-pay-deels { background: #f6e9cf; color: #6d4c0f; }
.s-actief, .s-wederzijds, .s-contact_gedeeld, .s-ontmoeting_gepland, .s-ontmoet, .s-feedback, .s-vervolg, .s-pay-betaald { background: #dceee6; color: #1f5441; }
.s-gematcht, .s-koppel { background: #f1dfe2; color: var(--claret-dark); }
.s-gepauzeerd { background: #e2e7ea; color: #3e4c54; }
.s-afgesloten, .s-geannuleerd { background: #e6e3de; color: #5b5a56; }
.s-geweigerd, .s-pay-open { background: #f5dcdc; color: #842429; }
.mark { display: inline-block; width: 20px; height: 20px; border-radius: 50%; background: var(--side); color: #fff; font: 600 11px/20px var(--sans); text-align: center; vertical-align: middle; }

.scroll { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 18px; }
table { width: 100%; border-collapse: collapse; }
th { padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--ink-soft); font-size: 12.5px; font-weight: 600; text-align: left; white-space: nowrap; }
td { padding: 9px 14px; border-bottom: 1px solid #efeae1; vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tr.warn td { background: #fbf1e6; }

.filters { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 16px; }
.filters .field { margin: 0; min-width: 210px; }

.field { display: block; margin-bottom: 12px; }
.field > span { display: block; margin-bottom: 4px; font-size: 13px; font-weight: 500; }
.field i { color: var(--bad); font-style: normal; }
.field small { display: block; margin-top: 3px; color: var(--ink-soft); }
.field small.err, .field.bad > span { color: var(--bad); }
input, select, textarea { width: 100%; padding: 7px 9px; border: 1px solid #cfc7b9; border-radius: 6px; background: #fff; color: var(--ink); font: 14px/1.4 var(--sans); }
textarea { resize: vertical; }
.field.bad input, .field.bad select { border-color: var(--bad); }

.form fieldset { margin: 0 0 18px; padding: 0; border: 0; }
.form legend { padding: 0; margin-bottom: 10px; font: 600 17px var(--serif); }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }
.grid > .actions, .grid > input[type=hidden] { grid-column: 1 / -1; }
.actions { margin-top: 6px; }
.check { display: flex; gap: 9px; align-items: flex-start; margin-top: 6px; }
.check input { width: auto; margin-top: 4px; }
.row { display: flex; align-items: flex-end; gap: 10px; }
.row .field { flex: 1; margin-bottom: 0; }

.status-move { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 20px; padding: 10px 14px; background: #efe9df; border-radius: 8px; }
.status-move span { color: var(--ink-soft); font-size: 13px; }
.status-move input { flex: 1; min-width: 180px; }

dl { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 6px 14px; margin: 0; }
dt { color: var(--ink-soft); font-size: 13.5px; }
dd { margin: 0; overflow-wrap: anywhere; }

.plain { list-style: none; margin: 0; padding: 0; }
.plain li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; padding: 6px 0; border-top: 1px solid #efeae1; }
.plain li:first-child { border-top: 0; }

.timeline { list-style: none; margin: 16px 0 0; padding: 0; }
.timeline li { padding: 10px 0; border-top: 1px solid #efeae1; }
.meta { margin-bottom: 2px; color: var(--ink-soft); font-size: 13px; }
.note { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }

.contract { padding: 10px 0; border-bottom: 1px solid #efeae1; }
.meter { height: 8px; margin: 8px 0 6px; border-radius: 4px; background: #e9e3d8; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--ok); }
.meter.behind i { background: var(--warn); }
.w0 { width: 0; } .w10 { width: 10%; } .w20 { width: 20%; } .w30 { width: 30%; } .w40 { width: 40%; } .w50 { width: 50%; }
.w60 { width: 60%; } .w70 { width: 70%; } .w80 { width: 80%; } .w90 { width: 90%; } .w100 { width: 100%; }
details { margin-top: 12px; }
summary { color: var(--claret); cursor: pointer; }
details .grid { margin-top: 12px; }

.proposal { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid #efeae1; }

.board { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 12px; }
.col { flex: 0 0 196px; padding: 10px; background: #efe9df; border-radius: 8px; min-height: 170px; }
.col h2 { font: 600 13px/1.3 var(--sans); margin-bottom: 8px; }
.tile { display: block; margin-bottom: 7px; padding: 8px 10px; background: var(--card); border: 1px solid var(--line); border-radius: 6px; color: var(--ink); }
.tile:hover { border-color: var(--claret); text-decoration: none; }
.tile b { display: block; font-size: 13.5px; font-weight: 500; }
.tile span { color: var(--ink-soft); font-size: 12px; }
.closed { margin-top: 16px; }

.parties { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.party h3 { margin-top: 0; }

.flow { display: flex; flex-wrap: wrap; gap: 8px 22px; list-style: none; margin: 0 0 8px; padding: 0; }
.flow li { position: relative; display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: #efe9df; border-radius: 6px; }
.flow li + li::before { content: "→"; position: absolute; left: -17px; color: var(--ink-soft); }
.flow b { color: var(--ink-soft); font-weight: 600; font-size: 13px; }
.assume { margin: 0; padding-left: 18px; }
.assume li { margin-bottom: 6px; }

.demo { margin-bottom: 16px; padding: 6px 12px; border-left: 3px solid var(--gold); background: #f6e9cf; color: #6d4c0f; font-size: 13px; }

.flash { margin-bottom: 18px; padding: 9px 14px; border-radius: 6px; background: #dceee6; color: #1f5441; }
.flash.bad { background: #f5dcdc; color: #842429; }

.login { width: 340px; padding: 30px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.login .brand { padding: 0; color: var(--side); margin-bottom: 18px; }
.login .brand em { color: var(--claret); }
.login h1 { font-size: 22px; margin-bottom: 16px; }
.login .primary { width: 100%; margin-top: 4px; }

@media (max-width: 960px) {
  body { display: block; }
  .side { position: static; height: auto; flex-direction: row; align-items: center; gap: 14px; padding: 12px 16px; overflow-x: auto; }
  .side nav { display: flex; margin: 0; }
  .side nav a { white-space: nowrap; }
  .user { margin: 0 0 0 auto; padding: 0; border: 0; white-space: nowrap; }
  main { padding: 22px 16px 56px; }
  .columns, .parties { grid-template-columns: minmax(0, 1fr); }
  .pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .alerts a { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .filters { flex-wrap: wrap; }
}
