/* Huisstijl: syla.DIGITAL (strak zwart-wit) met de klantkleuren van FoorNu (paars + goud) als accent. */
:root {
  --black: #0b0b0c;
  --bg: #f5f5f3;
  --surface: #ffffff;
  --ink: #0b0b0c;
  --ink-2: #4a4a50;
  --ink-3: #85858c;
  --line: #e6e6e3;
  --accent: #580c7f;
  --accent-2: #6e1d98;
  --accent-soft: #f2eaf7;
  --gold: #e4b23c;
  --ok: #1c7c46;
  --ok-soft: #e4f4ea;
  --warn: #a86400;
  --warn-soft: #fdf1dc;
  --bad: #b3261e;
  --bad-soft: #fbe6e4;
  --info: #2a5db0;
  --info-soft: #e5edfa;
  --muted-soft: #eef1f0;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16, 24, 23, .05), 0 1px 8px rgba(16, 24, 23, .04);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  font-size: 14px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
a { color: var(--accent); }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }

.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--black); color: #d9d9dc; padding: 20px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.brand { padding: 6px 8px 26px; }
.brand img { width: 128px; display: block; }
.brand small { display: block; color: #8d8d94; font-size: 12px; margin-top: 8px; letter-spacing: .02em; }
.nav a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 12px; border-radius: 10px; color: #c9c9ce; text-decoration: none; }
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a.active { background: #fff; color: var(--black); font-weight: 600; }
.nav .count { background: var(--accent); color: #fff; border-radius: 99px; font-size: 11px; font-weight: 700; padding: 1px 7px; }
.nav .count.warn { background: var(--gold); color: var(--black); }
.side .foot { margin-top: auto; font-size: 12px; color: #8d8d94; padding: 8px; line-height: 1.55; }
.side .syla { border-top: 1px solid #222226; margin-top: 12px; padding: 14px 8px 0; font-size: 12px; color: #8d8d94; }
.side .syla b { color: #fff; font-weight: 700; letter-spacing: -.01em; }
.side .syla b span { color: #8d8d94; font-weight: 500; }
.side .foot .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #4cd18a; margin-right: 6px; }

main { padding: 26px 32px 60px; max-width: 1320px; width: 100%; }
.top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.top h1 { font-family: "Inter Tight", Inter, sans-serif; font-size: 28px; margin: 0 0 6px; letter-spacing: -.025em; font-weight: 700; }
.top p { margin: 0; color: var(--ink-2); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn { border: 1px solid #d9d9d6; background: var(--surface); color: var(--ink); padding: 9px 16px; border-radius: 999px; font-weight: 550; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { border-color: #c5cfcc; }
.btn.primary { background: var(--black); border-color: var(--black); color: #fff; }
.btn.primary:hover { background: #2a2a2e; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { color: var(--bad); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: default; }

.grid { display: grid; gap: 16px; }
.kpis { grid-template-columns: repeat(4, 1fr); }
.two { grid-template-columns: 1.55fr 1fr; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 18px; }
.card h3 { margin: 0 0 12px; font-size: 14px; font-weight: 650; display: flex; justify-content: space-between; align-items: baseline; }
.card h3 small { font-weight: 400; color: var(--ink-3); }
.kpi .label { color: var(--ink-2); font-size: 13px; }
.kpi .value { font-family: "Inter Tight", Inter, sans-serif; font-size: 32px; font-weight: 700; margin: 6px 0 2px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .sub { color: var(--ink-3); font-size: 12.5px; }
.kpi.alert .value { color: var(--bad); }
.kpi a { text-decoration: none; color: inherit; display: block; }

.flow { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; margin-bottom: 16px; }
.flow .step { padding: 14px 16px; border-right: 1px solid var(--line); position: relative; }
.flow .step:last-child { border-right: 0; }
.flow .step .n { font-size: 11px; color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.flow .step b { display: block; margin: 3px 0; font-size: 13.5px; }
.flow .step span { font-size: 12.5px; color: var(--ink-2); }

.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .tip { position: absolute; pointer-events: none; background: var(--black); color: #fff; padding: 6px 9px; border-radius: 6px; font-size: 12px; white-space: nowrap; transform: translate(-50%, -110%); opacity: 0; transition: opacity .1s; }
.hbar { display: grid; grid-template-columns: 170px 1fr 88px; gap: 8px; align-items: center; font-size: 13px; margin: 7px 0; }
.hbar .track { height: 10px; background: var(--muted-soft); border-radius: 4px; overflow: hidden; }
.hbar .fill { height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; }
.hbar .v { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.hbar .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 600; font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; padding: 10px 10px; border-bottom: 1px solid var(--line); background: #fafbfb; position: sticky; top: 0; }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #f7faf9; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td .muted, .muted { color: var(--ink-3); }
.tablewrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; box-shadow: var(--shadow); }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.s-ontvangen { background: var(--info-soft); color: var(--info); }
.s-gecontroleerd { background: var(--ok-soft); color: var(--ok); }
.s-afwijkend { background: var(--bad-soft); color: var(--bad); }
.s-dubbel { background: var(--warn-soft); color: var(--warn); }
.s-geexporteerd { background: var(--muted-soft); color: var(--ink-2); }
.s-afgewezen { background: var(--muted-soft); color: var(--ink-3); text-decoration: line-through; }
.warnline { color: var(--warn); font-size: 12.5px; }

.filters { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.filters input, .filters select { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 8px 10px; }
.filters input[type=search] { min-width: 260px; }
.tabs { display: flex; gap: 4px; background: var(--muted-soft); padding: 3px; border-radius: 9px; }
.tabs button { border: 0; background: transparent; padding: 6px 12px; border-radius: 7px; color: var(--ink-2); font-weight: 550; }
.tabs button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

.drawer-bg { position: fixed; inset: 0; background: rgba(10, 20, 19, .35); opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 10; }
.drawer-bg.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(1020px, 96vw); background: var(--bg); transform: translateX(100%); transition: transform .2s ease; z-index: 11; display: flex; flex-direction: column; }
.drawer.open { transform: none; }
.drawer header { display: flex; align-items: center; justify-content: space-between; padding: 16px 22px; background: var(--surface); border-bottom: 1px solid var(--line); }
.drawer header h2 { margin: 0; font-size: 18px; }
.drawer .body { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 18px 22px; overflow: auto; flex: 1; }
.preview { background: #2c3332; border-radius: var(--radius); min-height: 420px; display: flex; align-items: flex-start; justify-content: center; overflow: auto; }
.preview img { max-width: 100%; display: block; }
.preview iframe { width: 100%; height: 78vh; border: 0; background: #fff; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.fields label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink-3); font-weight: 600; }
.fields label.full { grid-column: 1 / -1; }
.fields input, .fields select, .fields textarea { border: 1px solid var(--line); border-radius: 7px; padding: 8px 9px; background: var(--surface); font-size: 14px; color: var(--ink); font-weight: 400; }
.fields input[readonly] { background: #f7f9f8; }
.callout { border-radius: 8px; padding: 10px 12px; font-size: 13px; margin-bottom: 12px; }
.callout.warn { background: var(--warn-soft); color: #6d4300; }
.callout.bad { background: var(--bad-soft); color: #7d1a14; }
.callout.ok { background: var(--ok-soft); color: #145c33; }
.callout.info { background: var(--accent-soft); color: #164643; }
.callout ul { margin: 4px 0 0; padding-left: 18px; }
.mailitem { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--surface); margin-bottom: 8px; }
.mailitem .meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); margin-bottom: 4px; }
.mailitem pre { white-space: pre-wrap; font-family: inherit; margin: 6px 0 0; font-size: 13px; color: var(--ink-2); }
.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 700; margin: 18px 0 8px; }

.log { list-style: none; margin: 0; padding: 0; }
.log li { display: grid; grid-template-columns: 118px 1fr; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.log li:last-child { border-bottom: 0; }
.log time { color: var(--ink-3); font-variant-numeric: tabular-nums; font-size: 12px; }

.settings { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.settings .fields { grid-template-columns: 1fr; }
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 6px 12px; font-size: 13.5px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--muted-soft); font-size: 12.5px; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--black); color: #fff; padding: 11px 18px; border-radius: 9px; opacity: 0; transition: all .2s; z-index: 30; box-shadow: 0 8px 30px rgba(0, 0, 0, .2); }
.toast.show { opacity: 1; transform: translateX(-50%); }
.login { min-height: 100vh; display: grid; place-items: center; }
.login form { background: var(--surface); padding: 30px; border-radius: 14px; border: 1px solid var(--line); width: 340px; box-shadow: var(--shadow); }
.login input { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 8px; margin: 12px 0; }
.banner { background: var(--black); border: 0; color: #e8e8ea; border-radius: 14px; padding: 9px 14px; font-size: 13px; margin-bottom: 16px; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.empty { padding: 40px; text-align: center; color: var(--ink-3); }
.check { width: 16px; height: 16px; accent-color: var(--accent); }

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .two, .settings, .drawer .body { grid-template-columns: 1fr; }
  .flow { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
  main { padding: 18px; }
}
a.btn { text-decoration: none; }
.top .actions { flex-shrink: 0; justify-content: flex-end; }

.banner b { color: var(--gold); }
.banner .btn { background: #fff; border-color: #fff; }
.nav a.active .count { background: var(--accent); color: #fff; }
.login form .brandlogo { width: 150px; display: block; margin: 0 auto 6px; }
.login form .by { text-align: center; color: var(--ink-3); font-size: 12px; margin-top: 14px; }
.tabs button.on { color: var(--black); }

.login input { margin: 6px 0; }
.login form .brandlogo + div { margin-bottom: 10px; }
.side .me { border-top: 1px solid #222226; margin-top: 12px; padding-top: 12px; color: #fff; }
.side .me span { color: #8d8d94; }
.side .me a { color: #c9c9ce; }
.modal-bg { position: fixed; inset: 0; background: rgba(11, 11, 12, .45); z-index: 40; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--surface); border-radius: 18px; width: min(520px, 100%); max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.modal header { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px 8px; }
.modal header h2 { margin: 0; font-size: 18px; letter-spacing: -.01em; }
.modal-body { padding: 10px 22px; overflow: auto; }
.modal footer { display: flex; gap: 8px; padding: 14px 22px 18px; border-top: 1px solid var(--line); margin-top: 8px; }
.card h3 .btn { font-size: 12.5px; }

/* Mailbox koppelen */
.card.koppel { margin-bottom: 16px; border: 1px solid var(--line); }
.card.koppel .lead { margin: 0 0 14px; color: var(--ink-2); font-size: 14.5px; }
.koppel-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 16px; }
.koppel-tiles .tile { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 6px; background: var(--surface); }
.koppel-tiles .tile h4 { margin: 8px 0 0; font-size: 15px; }
.koppel-tiles .tile p { margin: 0 0 8px; color: var(--ink-2); font-size: 13.5px; flex: 1; }
.koppel-tiles .tile .btn { align-self: flex-start; }
.tile-logo { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; font-weight: 700; font-size: 18px; }
.tile-logo.ms { grid-template-columns: 1fr 1fr; gap: 2px; padding: 7px; background: #f3f3f3; }
.tile-logo.ms i { display: block; width: 100%; height: 100%; }
.tile-logo.ms i:nth-child(1) { background: #f25022; } .tile-logo.ms i:nth-child(2) { background: #7fba00; }
.tile-logo.ms i:nth-child(3) { background: #00a4ef; } .tile-logo.ms i:nth-child(4) { background: #ffb900; }
.tile-logo.g { background: #f3f3f3; color: #4285f4; }
.tile-logo.other { background: var(--accent-soft); color: var(--accent); }
.koppel-ok { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--ok-soft); }
.koppel-ok > div { flex: 1; }
.koppel-ok .check { width: 30px; height: 30px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; font-weight: 700; }
.koppel-steps p { margin: 14px 0 10px; color: var(--ink-2); }
.pill.ok { background: var(--ok); color: #fff; }
.small { font-size: 12.5px; }
details.dev { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
details.dev summary { cursor: pointer; color: var(--ink-3); font-size: 12.5px; }
details.dev .fields { margin-top: 12px; }
details.dev code { font-size: 12px; background: var(--muted-soft); padding: 1px 5px; border-radius: 4px; }
.modal label.optie, label.optie { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 14px; font-size: 14px; line-height: 1.45; color: var(--ink); font-weight: 400; }
label.optie input[type=checkbox] { width: 18px; height: 18px; min-width: 18px; flex: 0 0 18px; margin: 2px 0 0; padding: 0; accent-color: var(--accent); }
label.optie > span { flex: 1; }
