:root {
  --bg: #f4f6fa;
  --card: #fff;
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e8ef;
  --brand: #0a5cff;
  --brand-soft: #e8f0ff;
  --hot: #e5484d;
  --hot-soft: #fdecec;
  --ok: #12a150;
  --ok-soft: #e6f6ec;
  --warn: #b7791f;
  --warn-soft: #fdf3e1;
  --ret: #7c3aed;
  --ret-soft: #f1eafe;
  --hs: #ff7a59;
  --hs-soft: #fff0eb;
  --radius: 10px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); font-size: 14px; line-height: 1.45; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 15px; margin: 0 0 12px; }
h3 { font-size: 13px; margin: 18px 0 8px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
code { background: #eef1f6; padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.num { text-align: right; }
.right { text-align: right; }
.center { text-align: center; justify-content: center; }
.grow { flex: 1; }

/* topbar */
.topbar { display: flex; align-items: center; gap: 28px; padding: 0 24px; height: 56px; background: #0b1220; color: #fff; position: sticky; top: 0; z-index: 10; }
.topbar a { color: #cbd5e1; }
.topbar nav { display: flex; gap: 4px; }
.topbar nav a { padding: 8px 12px; border-radius: 8px; }
.topbar nav a.active, .topbar nav a:hover { background: #1e293b; color: #fff; text-decoration: none; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff !important; font-size: 15px; }
.brand:hover { text-decoration: none; }
.brand-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--brand); color: #fff; font-weight: 700; font-size: 12px; }
.user { margin-left: auto; }
.menu summary { cursor: pointer; list-style: none; color: #cbd5e1; font-size: 13px; }
.menu summary::-webkit-details-marker { display: none; }
.menu[open] .menu-body { position: absolute; right: 20px; top: 52px; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; width: 260px; box-shadow: 0 10px 30px rgba(0,0,0,.12); display: grid; gap: 10px; }

main { max-width: 1180px; margin: 0 auto; padding: 24px; }
main.wide { max-width: 1480px; }

/* cards & forms */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.card.empty { text-align: center; padding: 48px 24px; }
.stack { display: grid; gap: 10px; }
label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 500; }
label.check { display: flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 400; }
input, select, textarea { font: inherit; color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; width: 100%; }
input[type=checkbox] { width: auto; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
textarea { resize: vertical; }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.inline input, .inline select { width: auto; flex: 1; min-width: 120px; }
.w80 { max-width: 80px; } .w120 { max-width: 120px; }
form.inl { display: inline; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: grid; gap: 10px; align-content: start; margin: 0; }
legend { font-weight: 600; padding: 0 6px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.full-row { grid-column: 1 / -1; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--brand); background: var(--brand); color: #fff; font: inherit; font-weight: 600; padding: 9px 14px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.btn:hover { filter: brightness(1.07); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn.full { width: 100%; }
.btn.ghost { background: #fff; color: var(--brand); border-color: var(--line); }
.btn.danger { background: #fff; color: var(--hot); border-color: #f5c2c3; }
.btn.busy { opacity: .6; pointer-events: none; }
.icon-btn { border: 1px solid var(--line); background: #fff; color: var(--muted); border-radius: 8px; width: 30px; height: 30px; display: inline-grid; place-items: center; cursor: pointer; font-size: 16px; }
.icon-btn:hover, .icon-btn.on { color: var(--ok); border-color: var(--ok); background: var(--ok-soft); }
.icon-btn.neg:hover, .icon-btn.neg.on { color: var(--hot); border-color: var(--hot); background: var(--hot-soft); }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; border: 1px solid; }
.flash.ok { background: var(--ok-soft); border-color: #b7e4c7; color: #0b6b35; }
.flash.error { background: var(--hot-soft); border-color: #f5c2c3; color: #9b1c1f; }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: #eef1f6; color: #374151; white-space: nowrap; }
.badge.hot, .badge.lvl-high { background: var(--hot-soft); color: var(--hot); }
.badge.ret { background: var(--ret-soft); color: var(--ret); }
.badge.new { background: var(--brand-soft); color: var(--brand); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn, .badge.lvl-negative { background: var(--warn-soft); color: var(--warn); }
.badge.lvl-medium { background: var(--brand-soft); color: var(--brand); }
.badge.hs { background: var(--hs-soft); color: #c2410c; }
a.badge:hover { text-decoration: none; filter: brightness(.97); }
.labels { display: flex; gap: 4px; flex-wrap: wrap; }

/* dashboard */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 2px; color: var(--ink); }
a.tile:hover { text-decoration: none; border-color: var(--brand); }
.tile.on { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.tile-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.tile-value { font-size: 26px; font-weight: 700; }
.tile-value.hot { color: var(--hot); }
.tile-sub { font-size: 12px; color: var(--muted); }

.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.filters input, .filters select { width: auto; }
.filters input.grow { flex: 1; min-width: 200px; }
.seg { display: inline-flex; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.seg a, .seg button { padding: 6px 10px; border-radius: 6px; color: var(--muted); font: inherit; font-size: 12px; font-weight: 600; border: 0; background: none; cursor: pointer; }
.seg a:hover, .seg button:hover { text-decoration: none; color: var(--ink); }
.seg .on { background: var(--brand); color: #fff !important; }
.seg .on.ok { background: var(--ok); }
.seg .on.neg { background: var(--hot); }

.card.list { padding: 0; overflow: hidden; }
.row { display: grid; grid-template-columns: minmax(260px, 2.2fr) minmax(160px, 1.4fr) minmax(180px, 1.6fr) 90px 110px 110px 72px; gap: 14px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row.head { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #fafbfd; padding-top: 9px; padding-bottom: 9px; }
.row.company:hover { background: #fafbff; }
.row.status-not_interesting { opacity: .55; }
.who { display: flex; gap: 12px; align-items: center; color: var(--ink); min-width: 0; }
.who:hover { text-decoration: none; }
.who:hover strong { color: var(--brand); }
.who-text { display: grid; min-width: 0; }
.who-text strong, .who-text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logo { flex: none; width: 38px; height: 38px; border-radius: 9px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: 13px; overflow: hidden; border: 1px solid var(--line); }
.logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.logo.lg { width: 64px; height: 64px; font-size: 20px; border-radius: 14px; }
.pages { display: flex; gap: 4px; flex-wrap: wrap; }
.chip { font-size: 11px; padding: 2px 7px; border-radius: 6px; background: #f1f3f7; color: #4b5563; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.chip em { font-style: normal; color: var(--muted); }
.chip.lvl-high { background: var(--hot-soft); color: var(--hot); }
.chip.lvl-medium { background: var(--brand-soft); color: var(--brand); }
.chip.lvl-negative { background: var(--warn-soft); color: var(--warn); }
.score { display: inline-block; width: 60px; height: 6px; border-radius: 3px; background: #eceff4; margin-right: 6px; vertical-align: middle; overflow: hidden; }
.score span { display: block; height: 100%; width: calc(var(--s) * 1%); background: linear-gradient(90deg, #f7b267, var(--hot)); }
.actions { display: flex; gap: 4px; justify-content: flex-end; }

/* company page */
.back { display: inline-block; margin-bottom: 10px; font-size: 13px; }
.company-head { display: flex; gap: 18px; align-items: flex-start; }
.company-head .meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 13px; margin: 2px 0 8px; }
.company-head .desc { color: #374151; margin: 0 0 10px; max-width: 820px; }
.head-side { display: grid; gap: 10px; justify-items: end; }
.gauge { --s: 0; width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; align-content: center; background: conic-gradient(var(--hot) calc(var(--s) * 1%), #eceff4 0); position: relative; }
.gauge::before { content: ""; position: absolute; inset: 7px; background: #fff; border-radius: 50%; }
.gauge span, .gauge small { position: relative; line-height: 1; }
.gauge span { font-size: 20px; font-weight: 700; }
.gauge small { font-size: 10px; color: var(--muted); }
.cols { display: grid; grid-template-columns: 1fr 420px; gap: 16px; align-items: start; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline > li { border-left: 2px solid var(--line); padding: 0 0 16px 16px; position: relative; }
.timeline > li::before { content: ""; position: absolute; left: -6px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }
.t-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin-bottom: 6px; }
.pv { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.pv li { display: grid; grid-template-columns: 44px 1fr auto 56px; gap: 10px; align-items: center; padding: 5px 8px; border-radius: 6px; }
.pv li:nth-child(odd) { background: #fafbfd; }
.pv li.lvl-high { background: var(--hot-soft); }
.pv-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl td, .tbl th { padding: 7px 6px; border-bottom: 1px solid var(--line); text-align: left; }
.tbl th { font-size: 11px; text-transform: uppercase; color: var(--muted); }
.tbl tr:last-child td { border-bottom: 0; }
.titles textarea { margin: 6px 0 10px; font-size: 12px; }
.titles summary { cursor: pointer; margin-bottom: 8px; }
.person, .contact { display: flex; gap: 10px; justify-content: space-between; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.person:last-child, .contact:last-child { border-bottom: 0; }
.contact-main, .person-main { display: grid; min-width: 0; }
.contact-actions { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
#people-results { margin-top: 10px; }
.activity { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.subnav { display: flex; gap: 14px; margin: 6px 0 16px; font-size: 13px; }
.snippet { background: #0b1220; color: #e2e8f0; padding: 12px 14px; border-radius: 8px; overflow-x: auto; font-size: 12px; cursor: copy; position: relative; }
.snippet.copied::after { content: "Gekopieerd"; position: absolute; right: 10px; top: 10px; color: #86efac; }
.test-out { min-height: 16px; }

.login-wrap { min-height: 80vh; display: grid; place-items: center; }
.login { width: 360px; display: grid; gap: 12px; padding: 28px; }
.login .brand { color: var(--ink) !important; justify-content: center; }

@media (max-width: 1100px) {
  .row { grid-template-columns: 1fr auto; }
  .row.head { display: none; }
  .row .labels, .row .pages { grid-column: 1 / -1; }
  .cols { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  main { padding: 14px; }
  .company-head { flex-direction: column; }
  .head-side { justify-items: start; }
  .topbar { gap: 12px; padding: 0 14px; }
  .brand span:last-child { display: none; }
}
