/* Verkoop: een rustig werkinstrument in de huisstijl van Shape Tomorrow.
   Licht werkvlak, nachtblauwe balk, horizonblauw als accent. Weinig randen. */
:root {
  --night: #0F1B2D;
  --horizon: #739BB5;
  --horizon-strong: #3F6A88;
  --sky: #A9C4D8;
  --sky-soft: #EDF3F8;

  --bg: #F4F6F9;
  --surface: #FFFFFF;
  --column: #EBEFF4;
  --ink: #16222F;
  --ink-muted: #607084;
  --line: #E3E8EE;
  --focus: #3F6A88;

  --warn: #B7791F;
  --warn-bg: #FFF8EC;
  --late: #B4372B;
  --ok: #2F7A55;
  --ok-bg: #E6F4EC;

  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 27, 45, 0.06), 0 1px 1px rgba(15, 27, 45, 0.04);
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;

  --font: "Avenir Next", "Mulish", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--horizon-strong); text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 var(--space-3); font-weight: 600; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1rem; }
h3 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-muted); }
p { margin: 0 0 var(--space-3); }
.muted { color: var(--ink-muted); }
.small { font-size: 0.85rem; }
.empty { color: var(--ink-muted); margin: 0; }
.pre { white-space: pre-line; }
.late { color: var(--late); font-weight: 600; }
.quiet-link { color: inherit; text-decoration: none; }
.quiet-link:hover, .quiet-link:focus-visible { text-decoration: underline; color: var(--horizon-strong); }

/* Balk */
.topbar { background: var(--night); color: #fff; position: sticky; top: 0; z-index: 20; }
.topbar__inner { max-width: 1400px; margin: 0 auto; padding: 6px var(--space-4); display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap; }
.topbar__brand { display: flex; align-items: center; gap: var(--space-2); color: #fff; text-decoration: none; font-weight: 600; }
.topbar__brand img { width: 22px; height: 22px; }
.topbar nav { display: flex; gap: 2px; flex-wrap: wrap; }
.topbar nav a { color: #C9D7E3; text-decoration: none; padding: 6px 10px; border-radius: 6px; }
.topbar nav a:hover, .topbar nav a[aria-current="page"] { background: rgba(169, 196, 216, 0.16); color: #fff; }
.topbar nav .count { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: var(--late); color: #fff; font-size: 0.75rem; text-align: center; }
.topbar__search { margin-left: auto; }
.topbar__search input[type="search"] { border: 0; background: rgba(255, 255, 255, 0.1); color: #fff; border-radius: 6px; padding: 6px 10px; width: 15rem; max-width: 100%; font: inherit; min-height: 0; }
.topbar__search input[type="search"]::placeholder { color: #9FB3C6; }
.topbar__sync { border: 1px solid rgba(169, 196, 216, 0.4); background: transparent; color: #fff; border-radius: 6px; padding: 5px 10px; font: inherit; font-size: 0.85rem; cursor: pointer; }
.topbar__sync:hover { background: rgba(169, 196, 216, 0.16); }
.topbar__sync:disabled { opacity: 0.7; cursor: progress; }
.topbar__user { display: flex; align-items: center; gap: var(--space-2); color: #C9D7E3; font-size: 0.85rem; }
.topbar__user button { background: none; border: 0; color: #C9D7E3; text-decoration: underline; cursor: pointer; font: inherit; padding: 0; min-height: 0; }
@media (max-width: 760px) {
  .topbar__search { margin-left: 0; width: 100%; order: 5; }
  .topbar__search input { width: 100%; }
  .topbar__user { margin-left: auto; }
}

/* Pagina */
.page { max-width: 1100px; margin: 0 auto; padding: var(--space-6) var(--space-4) var(--space-8); }
.page--wide { max-width: 1400px; }
.page__head { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-4); }
.page__head h1 { margin: 0; }
.page__head .actions { margin-left: auto; display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }
.flash { padding: var(--space-2) var(--space-4); border-radius: var(--radius); margin-bottom: var(--space-4); background: var(--sky-soft); }
.flash--alert { background: var(--warn-bg); color: #6B4A0E; }

.card { background: var(--surface); border-radius: var(--radius); padding: var(--space-4); box-shadow: var(--shadow); }
.stack > * + * { margin-top: var(--space-4); }
.grid { display: grid; gap: var(--space-4); }
@media (min-width: 900px) { .grid--company { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; } }

/* Knoppen en formulieren */
.button, button.button, input.button, input[type="submit"] {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--horizon-strong); background: var(--horizon-strong); color: #fff;
  padding: 6px 14px; border-radius: 8px; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; min-height: 36px;
}
.button:hover, input[type="submit"]:hover { background: var(--night); border-color: var(--night); }
.button.button--quiet, input.button--quiet { background: var(--surface); color: var(--ink); border-color: var(--line); font-weight: 500; }
.button.button--quiet:hover, input.button--quiet:hover { background: var(--sky-soft); }
.button--small, input.button--small { padding: 2px 10px; min-height: 28px; font-size: 0.85rem; }
.button.button--danger { background: var(--surface); color: var(--late); border-color: var(--line); }
.inline-form { display: inline; }
.check { width: 26px; height: 26px; min-height: 26px; padding: 0; border-radius: 50%; border: 2px solid var(--sky); background: var(--surface); color: transparent; cursor: pointer; font-size: 13px; line-height: 1; flex: none; }
.check:hover, .check:focus-visible { border-color: var(--ok); color: var(--ok); background: var(--ok-bg); }

.form { display: grid; gap: var(--space-3); }
.form--cols { grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
.field { display: grid; gap: 4px; }
.field--wide { grid-column: 1 / -1; }
label { font-weight: 600; font-size: 0.85rem; }
.hint { font-weight: 400; color: var(--ink-muted); font-size: 0.8rem; }
input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="url"],
input[type="tel"], input[type="date"], input[type="datetime-local"], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid #D3DBE4; border-radius: 8px; padding: 7px 10px; min-height: 38px;
}
textarea { min-height: 5rem; resize: vertical; }
.checkbox { display: flex; gap: var(--space-2); align-items: center; font-weight: 400; }
.form__errors { background: var(--warn-bg); color: #6B4A0E; padding: var(--space-3); border-radius: 8px; }
.form__errors ul { margin: 0; padding-left: 1.2rem; }
details > summary { cursor: pointer; }
details.fold > summary { list-style: none; color: var(--horizon-strong); font-weight: 600; font-size: 0.9rem; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: "+ "; }
details.fold[open] > summary::before { content: "- "; }
details.fold[open] > summary { margin-bottom: var(--space-3); }

/* Statuslabels */
.pill { display: inline-block; font-size: 0.75rem; font-weight: 600; line-height: 1.5; padding: 1px 9px; border-radius: 999px; background: var(--sky-soft); color: #2A4A63; white-space: nowrap; }
.pill--interesse, .pill--klant { background: var(--ok-bg); color: #1E5A3C; }
.pill--nee, .pill--niet_benaderen, .pill--demo_verwijderd { background: #EEF0F2; color: #5D6670; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); flex: none; }

/* Pijplijn */
.summary { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.summary a { display: inline-flex; gap: 6px; align-items: center; background: var(--surface); box-shadow: var(--shadow); border-radius: 999px; padding: 4px 12px; text-decoration: none; color: var(--ink); font-size: 0.9rem; }
.summary a strong { font-variant-numeric: tabular-nums; }
.summary a.is-late strong { color: var(--late); }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(210px, 1fr); gap: var(--space-3); overflow-x: auto; padding-bottom: var(--space-3); align-items: start; }
.column { background: var(--column); border-radius: var(--radius); padding: var(--space-2); display: flex; flex-direction: column; max-height: calc(100vh - 180px); min-height: 200px; }
.column__head { display: flex; align-items: baseline; gap: 6px; padding: 4px 6px 2px; font-weight: 600; }
.column__head .count { color: var(--ink-muted); font-weight: 500; font-size: 0.85rem; }
.column__hint { font-size: 0.75rem; color: var(--ink-muted); padding: 0 6px 6px; }
.column__cards { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; min-height: 80px; padding: 2px; flex: 1; }
.column--muted { background: #F0F2F4; }
.column--muted .bcard { opacity: 0.75; }
.bcard { background: var(--surface); border-radius: 8px; padding: 8px 10px; box-shadow: var(--shadow); cursor: grab; display: block; color: var(--ink); text-decoration: none; }
.bcard:hover { box-shadow: 0 2px 6px rgba(15, 27, 45, 0.12); }
.bcard[hidden] { display: none; }
.bcard__name { font-weight: 600; display: flex; gap: 6px; align-items: center; }
.bcard__name > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bcard__next { font-size: 0.82rem; color: var(--ink-muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bcard__meta { font-size: 0.75rem; color: var(--ink-muted); margin-top: 2px; }
.bcard.is-ghost { opacity: 0.35; }
.bcard.is-chosen { cursor: grabbing; }
.board-filter { margin-left: auto; }
.board-filter input { width: 14rem; min-height: 34px; }

dialog { border: 0; border-radius: var(--radius); padding: var(--space-6); box-shadow: 0 10px 40px rgba(15, 27, 45, 0.25); max-width: 26rem; width: calc(100% - 32px); }
dialog::backdrop { background: rgba(15, 27, 45, 0.4); }
dialog h2 { font-size: 1.1rem; }

/* Takenlijst */
.day + .day { margin-top: var(--space-6); }
.tasks { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.tasks li { display: flex; gap: var(--space-3); align-items: center; padding: 9px var(--space-4); border-top: 1px solid var(--line); }
.tasks li:first-child { border-top: 0; }
.task__main { flex: 1; min-width: 0; }
.task__line { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task__company { font-weight: 600; color: var(--ink); text-decoration: none; }
.task__company:hover { text-decoration: underline; }
.task__sub { font-size: 0.8rem; color: var(--ink-muted); }
.task__side { display: flex; gap: var(--space-2); align-items: center; white-space: nowrap; font-size: 0.85rem; color: var(--ink-muted); }
.news { display: grid; gap: var(--space-4); margin-bottom: var(--space-6); }
@media (min-width: 900px) { .news { grid-template-columns: 1fr 1fr; } }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs a { padding: 4px 12px; border-radius: 999px; text-decoration: none; color: var(--ink); background: var(--surface); box-shadow: var(--shadow); font-size: 0.9rem; }
.tabs a[aria-current="true"] { background: var(--night); color: #fff; }

/* Lijsten algemeen */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: var(--space-2) 0; border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; padding-top: 0; }
.row { display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; }
.row__main { flex: 1 1 14rem; min-width: 0; }

/* Bedrijfspagina */
.company-head { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
.company-head h1 { margin: 0; }
.company-head .actions { margin-left: auto; display: flex; gap: var(--space-2); flex-wrap: wrap; }
.company-sub { color: var(--ink-muted); margin: 4px 0 var(--space-4); }
.company-sub > * + *::before { content: " · "; color: var(--sky); }
.status-select { border: 0; border-radius: 999px; padding: 2px 28px 2px 12px; min-height: 30px; font-weight: 600; font-size: 0.85rem; width: auto; background-color: var(--sky-soft); color: #2A4A63; cursor: pointer; }
.callout { border-left: 4px solid var(--warn); background: var(--warn-bg); padding: var(--space-3) var(--space-4); border-radius: 0 var(--radius) var(--radius) 0; }
.callout p:last-child { margin-bottom: 0; }
.callout strong { color: #6B4A0E; }
.section-title { display: flex; align-items: baseline; gap: var(--space-2); margin-bottom: var(--space-2); }
.section-title h2 { margin: 0; }
.section-title .actions { margin-left: auto; display: flex; gap: var(--space-2); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 80px 1fr; gap: var(--space-3); padding: 10px 0; border-top: 1px solid var(--line); }
.timeline li:first-child { border-top: 0; }
.timeline__when { font-size: 0.8rem; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.timeline__what { font-size: 0.8rem; color: var(--ink-muted); }
.timeline__title { font-weight: 600; }
.timeline__body { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.timeline li.is-in .timeline__what { color: var(--warn); font-weight: 600; }
.timeline li.is-visit { color: var(--ink-muted); font-size: 0.85rem; padding: 6px 0; }
/* Markdown from the notes */
.md { overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 var(--space-2); }
.md ul, .md ol { margin: 0 0 var(--space-2); padding-left: 1.25rem; }
.md li + li { margin-top: 4px; }
.md li > ul, .md li > ol { margin: 4px 0 0; }
.md h3, .md h4 { font-size: 0.85rem; margin: var(--space-3) 0 var(--space-1); text-transform: none; letter-spacing: 0; color: var(--ink); }
.md code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85em; background: rgba(15, 27, 45, 0.06); padding: 1px 4px; border-radius: 4px; }
.md blockquote { margin: 0 0 var(--space-2); padding-left: var(--space-3); border-left: 3px solid var(--line); color: var(--ink-muted); }
.callout .md { margin-bottom: var(--space-3); }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px var(--space-3); margin: 0; font-size: 0.9rem; }
.facts dt { color: var(--ink-muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.mailbody { white-space: pre-wrap; background: var(--bg); border-radius: 8px; padding: var(--space-4); overflow-wrap: anywhere; }

/* Tabel met bedrijven */
.table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.table th, .table td { text-align: left; padding: 9px 12px; border-top: 1px solid var(--line); vertical-align: top; }
.table th { border-top: 0; font-size: 0.8rem; color: var(--ink-muted); font-weight: 600; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: var(--space-4); }
.filters a { text-decoration: none; }
.filters a[aria-current="true"] .pill { background: var(--night); color: #fff; }
@media (max-width: 720px) {
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { border-top: 1px solid var(--line); padding: var(--space-2) 0; }
  .table td { border: 0; padding: 2px 12px; }
}

/* Inloggen */
.bare { min-height: 100vh; display: grid; place-items: center; background: var(--night); padding: var(--space-4); }
.bare__brand { display: flex; align-items: center; gap: var(--space-2); justify-content: center; color: #fff; margin-bottom: var(--space-4); font-weight: 600; }
.bare__brand img { width: 30px; height: 30px; }
