:root {
  /* SUPERSUM — afgestemd op supersum.nl: licht, rustig, één oranje accent */
  --bg: #ffffff;
  --surface: #f3f7f9;        /* lichtblauwe kaart */
  --surface-2: #e9f1f6;
  --text: #152d41;           /* donkerblauw, koppen en tekst */
  --body: #3d4f5e;
  --muted: #607181;
  --line: #dbe5ec;
  --primary: #152d41;
  --primary-text: #ffffff;
  --accent: #cc4800;         /* oranje CTA */
  --accent-text: #ffffff;
  --blue: #01689f;
  --tint-blue: #e4f0f7;
  --tint-orange: #fbeee6;
  --danger: #b3261e;
  --warn: #cc4800;
  --ok: #01689f;
  --info: #01689f;
  --radius: 14px;
  --shadow: none;
  --nav-h: 62px;
  --font: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font); background: var(--bg); color: var(--body);
  font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
}
a { color: var(--info); }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 24px; color: var(--text); font-weight: 700; }
h2, h3 { color: var(--text); }
.list .title, .pcard .name, .kv dd strong, .stat .value { color: var(--text); }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; }
[hidden] { display: none !important; }

/* Layout */
.shell { min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 20; background: var(--bg); color: var(--text); border-bottom: 1px solid var(--line);
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px; display: flex; align-items: center; gap: 12px;
}
.topbar .brand { display: flex; align-items: center; gap: 12px; flex: 1; }
.topbar .brand img { height: 24px; width: auto; display: block; }
.topbar .brand span { font-size: 12px; color: var(--accent); letter-spacing: .12em; text-transform: uppercase; font-weight: 700; }
.topbar .date { font-size: 13px; color: var(--muted); }
.topbar .gear { color: var(--muted); display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; margin-right: -8px; }
.topbar .gear svg { width: 22px; height: 22px; }
.topbar .gear.active, .topbar .gear:hover { color: var(--text); background: var(--surface); }
.page { padding: 16px 16px 90px; max-width: 1100px; margin: 0 auto; }
.page-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.page-title h1 { font-size: 22px; }

.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--line);
  display: flex; justify-content: space-around;
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 600;
}
.tabbar a svg { width: 24px; height: 24px; flex-shrink: 0; }
.tabbar a.active { color: var(--primary); }

.fab {
  font-weight: 300; position: fixed; right: 18px; bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom)); z-index: 21;
  width: 56px; height: 56px; border-radius: 50%; border: none; background: var(--accent); color: var(--accent-text);
  font-size: 30px; line-height: 1; box-shadow: 0 6px 18px rgba(21,45,65,.22); display: grid; place-items: center;
}

@media (min-width: 860px) {
  body { padding-bottom: 0; }
  .shell { display: grid; grid-template-columns: 220px 1fr; }
  .topbar { grid-column: 1 / -1; }
  .tabbar {
    position: sticky; top: 56px; height: auto; align-self: start; flex-direction: column; justify-content: flex-start;
    border-top: none; border-right: 1px solid var(--line); min-height: calc(100vh - 56px); padding: 12px 8px;
  }
  .tabbar a { flex: 0 0 auto; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 10px 12px; border-radius: 10px; font-size: 14px; }
  .tabbar a.active { background: var(--surface); color: var(--text); }
  .page { padding: 24px 32px; }
  .fab { bottom: 28px; right: 28px; }
}

/* Cards & lists */
.card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px; }
.card h2 { margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card h2 .count { font-size: 13px; color: var(--muted); font-weight: 500; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: none; }
.list .main { flex: 1; min-width: 0; }
.list .title { font-weight: 600; }
.list .sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .actions { display: flex; gap: 6px; flex-shrink: 0; }
.row-link { text-decoration: none; color: inherit; display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.empty { color: var(--muted); font-size: 14px; padding: 8px 0; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 700px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

/* Badges */
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.badge.lead { background: var(--tint-blue); color: var(--blue); }
.badge.klant { background: var(--surface-2); color: var(--text); }
.badge.oud-klant { background: var(--tint-orange); color: var(--accent); }
.badge.netwerk { background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.badge.overdue { background: var(--accent); color: #fff; }
.badge.today { background: var(--tint-orange); color: var(--accent); }
.badge.stale { background: var(--surface-2); color: var(--muted); }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--tint-blue); color: var(--blue); display: grid; place-items: center; font-weight: 700; font-size: 15px; flex-shrink: 0; }

/* Buttons */
.btn { border: 1px solid var(--line); background: var(--bg); color: var(--primary); padding: 8px 14px; border-radius: 10px; font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { border-color: var(--primary); }
.btn.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.btn.primary:hover { background: #b34000; border-color: #b34000; }
.btn.accent { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.btn.accent:hover { background: #b34000; border-color: #b34000; }
.btn.danger { color: var(--danger); }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn.icon { padding: 6px 8px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* Goals & streak */
.hero { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.stat { background: var(--surface); border-radius: var(--radius); padding: 16px 18px; }
.stat .label { font-size: 11px; color: var(--accent); text-transform: uppercase; letter-spacing: .14em; font-weight: 700; }
.stat .value { font-size: 32px; font-weight: 700; line-height: 1.1; margin-top: 4px; color: var(--primary); }
.stat .value.accent { color: var(--accent); }
.stat .hint { font-size: 12px; color: var(--muted); margin-top: 2px; }
.goal { margin: 10px 0; }
.goal .goal-head { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 4px; }
.goal .goal-head span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; }
.bar { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; }
.bar > div { height: 100%; background: var(--blue); border-radius: 999px; transition: width .3s; }
.bar > div.done { background: var(--accent); }
.tip { background: var(--surface); color: var(--text); border-radius: 10px; padding: 12px 14px; font-size: 14px; margin-top: 12px; }
.tip strong { display: block; margin-bottom: 2px; }

/* Pipeline */
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.column { flex: 0 0 82vw; max-width: 300px; scroll-snap-align: start; background: var(--surface); border-radius: var(--radius); padding: 10px; min-height: 200px; }
@media (min-width: 860px) { .column { flex: 0 0 260px; } }
.column h3 { display: flex; justify-content: space-between; align-items: center; font-size: 14px; padding: 4px 6px 10px; }
.column h3 .count { color: var(--muted); font-weight: 600; font-size: 12px; }
.column .sum { font-size: 12px; color: var(--muted); padding: 0 6px 8px; margin-top: -6px; }
.pcard { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.pcard a { text-decoration: none; color: inherit; }
.pcard .name { font-weight: 700; color: var(--primary); }
.pcard .meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.pcard .pc-actions { display: flex; gap: 6px; margin-top: 8px; }
.pcard.stale { border-left: 3px solid var(--warn); }

/* Contacts list */
.searchbar { display: flex; gap: 8px; margin-bottom: 10px; }
.searchbar input { flex: 1; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 600; color: var(--muted); }
.chip.active { background: var(--text); color: #fff; border-color: var(--text); }

/* Contact detail */
.detail-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.detail-head .avatar { width: 56px; height: 56px; font-size: 20px; }
.page-title .muted, .card h2 .count { font-weight: 600; }
.detail-head h1 { font-size: 22px; }
.detail-head .sub { color: var(--muted); font-size: 14px; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 34px 1fr; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.timeline li:first-child { border-top: none; }
.timeline .ico { width: 30px; height: 30px; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; font-size: 15px; }
.timeline .t-head { display: flex; justify-content: space-between; font-size: 14px; }
.timeline .t-head span:last-child { color: var(--muted); font-size: 12px; }
.timeline .t-note { font-size: 14px; white-space: pre-wrap; }
.timeline .t-del { border: none; background: none; color: var(--muted); font-size: 12px; padding: 0; margin-top: 2px; }

/* Forms & modals */
.modal-backdrop { position: fixed; inset: 0; background: rgba(21, 45, 65, .45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 700px) { .modal-backdrop { align-items: center; } }
.modal { background: var(--bg); width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; border-radius: 18px 18px 0 0; padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); }
@media (min-width: 700px) { .modal { border-radius: 18px; } }
.modal h2 { margin-bottom: 12px; font-size: 19px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.field input, .field select, .field textarea, .searchbar input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--text); font-size: 16px;
}
.field textarea { min-height: 70px; resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field .check { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--text); font-weight: 500; }
.field .check input { width: auto; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.form-actions .spacer { flex: 1; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button { border: 1px solid var(--line); background: var(--bg); color: var(--text); padding: 8px 10px; border-radius: 10px; font-size: 14px; }
.seg button.active { background: var(--text); color: #fff; border-color: var(--text); }

/* LinkedIn-posts */
.avatar.post { background: var(--tint-orange); font-size: 18px; }
.post { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; background: var(--bg); }
.post.gepland { border-left: 3px solid var(--accent); }
.post.geplaatst { opacity: .75; }
.post-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.post-title { font-weight: 700; color: var(--text); }
.post-text { font-size: 14px; white-space: pre-wrap; margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; color: var(--body); }
.badge.idee { background: var(--surface-2); color: var(--muted); }
.badge.concept { background: var(--tint-blue); color: var(--blue); }
.badge.gepland { background: var(--tint-orange); color: var(--accent); }
.badge.geplaatst { background: var(--surface-2); color: var(--text); }
.page-title .btn { flex-shrink: 0; }

/* Settings */
.stage-row { display: flex; gap: 6px; align-items: center; padding: 6px 0; }
.stage-row input { flex: 1; min-width: 0; }
.stage-row select.kind { width: 104px; }
.stage-row input.prob { flex: 0 0 62px; text-align: right; }
.stage-row.head { font-size: 12px; color: var(--muted); font-weight: 600; padding-bottom: 0; }
.stage-row.head .prob { width: 62px; text-align: right; } .stage-row.head .kind { width: 104px; }
/* Forecast */
.forecast .bar.stacked { display: flex; height: 10px; }
.forecast .bar .realised { background: var(--blue); border-radius: 999px 0 0 999px; }
.forecast .bar .weighted { background: var(--accent); }
.forecast .bar .realised:only-child, .forecast .bar .weighted:first-child { border-radius: 999px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.legend i.realised { background: var(--blue); } .legend i.weighted { background: var(--accent); }
.fc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.fc-grid .label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.fc-grid .num { font-size: 20px; font-weight: 700; color: var(--primary); margin-top: 2px; }
.fc-grid .num.accent { color: var(--accent); }
.fc-grid .hint { font-size: 12px; color: var(--muted); }
@media (max-width: 480px) { .fc-grid { grid-template-columns: 1fr 1fr; } .fc-grid .num { font-size: 18px; } }
.qtable { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 13px; font-variant-numeric: tabular-nums; }
.qtable th { text-align: right; font-weight: 600; color: var(--muted); padding: 4px 6px; border-bottom: 1px solid var(--line); font-size: 12px; }
.qtable td { text-align: right; padding: 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.qtable th:first-child, .qtable td:first-child { text-align: left; }
.qtable th:last-child, .qtable td:last-child { text-align: left; padding-left: 10px; }
.qtable tr.cur td { font-weight: 700; color: var(--primary); }
.qtable tr.past td { color: var(--muted); }
.qtable tr.total td { border-bottom: none; font-weight: 700; border-top: 2px solid var(--line); }
@media (max-width: 480px) { .qtable { font-size: 12px; } .qtable td, .qtable th { padding: 5px 3px; } }
.stage-row input, .stage-row select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); font-size: 14px; }
.help { font-size: 13px; color: var(--muted); margin: 4px 0 10px; }

/* Login */
.login { max-width: 360px; margin: 18vh auto; padding: 0 20px; text-align: center; }
.login .logo { width: 220px; margin: 0 auto 18px; display: block; }
.login .logo.dark { display: none; }
.login .card h2 { margin-bottom: 6px; }
.login .slogan { font-style: italic; color: var(--muted); font-size: 14px; margin: -4px 0 20px; }
.login .card { text-align: left; background: var(--surface); border: none; }
.error { color: var(--danger); font-size: 14px; margin-top: 8px; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 80px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--text); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 60; box-shadow: var(--shadow); max-width: 90vw; }
@media (min-width: 860px) { .toast { bottom: 40px; } }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mt { margin-top: 12px; }
