:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --ink: #16222e;
  --muted: #64748b;
  --line: #e2e8f0;
  --accent: #0b5fff;
  --accent-soft: #e8f0ff;
  --ok: #0f7b3d;
  --ok-soft: #e3f5ea;
  --warn: #92610a;
  --warn-soft: #fdf1d7;
  --bad: #b3261e;
  --bad-soft: #fdecea;
  --hand: #5b21b6;
  --hand-soft: #f1e9fe;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 15px/1.5 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

header {
  background: linear-gradient(135deg, #0c2a4d, #0b5fff);
  color: #fff;
  padding: 28px 0 24px;
  margin-bottom: 24px;
}
header h1 { margin: 0; font-size: 22px; letter-spacing: 0.3px; }
header h1 span { opacity: 0.5; }
.tagline { margin: 6px 0 0; opacity: 0.85; font-size: 14px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 1px 2px rgb(15 23 42 / 4%);
}

.dropzone {
  display: flex;
  gap: 16px;
  align-items: center;
  border: 2px dashed #b9c6da;
  border-radius: 10px;
  padding: 24px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.dropzone:hover, .dropzone.over { background: var(--accent-soft); border-color: var(--accent); }
.dz-icon { font-size: 34px; }

.status { margin-top: 10px; min-height: 1.2em; }

.folderbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 14px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 10px; background: #fafcff;
}
.folderbar .fb-icon { font-size: 22px; }
.folderbar .fb-info { flex: 1; min-width: 220px; display: flex; flex-direction: column; }

.filelist { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; margin-top: 14px; }
.filechip {
  display: flex; gap: 10px; align-items: center;
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
  background: #fafcff;
}
.filechip.statement { border-color: #9db9f2; background: var(--accent-soft); }
.filechip.error { border-color: #efb1ad; background: var(--bad-soft); }
.filechip .ic { font-size: 20px; }
.filechip .fi { min-width: 0; flex: 1; }
.filechip .fn { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fs { font-size: 12px; color: var(--muted); }
.filechip .del {
  border: 0; background: none; color: var(--muted); cursor: pointer;
  font-size: 13px; padding: 4px;
}
.filechip .del:hover { color: var(--bad); }

.toolbar { margin-top: 14px; display: flex; gap: 10px; }

.btn {
  border: 0; border-radius: 8px; padding: 9px 16px; font-size: 14px;
  cursor: pointer; background: var(--accent); color: #fff; font-weight: 600;
}
.btn.secondary { background: #eef2f7; color: var(--ink); border: 1px solid var(--line); }
.btn:hover { filter: brightness(0.96); }

.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.card-head h2 { margin: 0 0 2px; font-size: 17px; }
.qbadge {
  background: var(--accent); color: #fff; font-weight: 700;
  border-radius: 8px; padding: 8px 14px; font-size: 15px; white-space: nowrap;
}

table.txns { width: 100%; border-collapse: collapse; font-size: 14px; }
.txns th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px;
  color: var(--muted); border-bottom: 2px solid var(--line); padding: 8px 10px;
}
.txns td { border-bottom: 1px solid var(--line); padding: 9px 10px; vertical-align: top; }
.txns tr.nvt td { color: var(--muted); background: #fafafa; }
.r { text-align: right; }
.nowrap { white-space: nowrap; }

.chip {
  display: inline-block; border-radius: 999px; padding: 3px 10px;
  font-size: 12px; font-weight: 700; white-space: nowrap;
}
.status-zeker { background: var(--ok-soft); color: var(--ok); }
.status-mogelijk { background: var(--warn-soft); color: var(--warn); }
.status-geen { background: var(--bad-soft); color: var(--bad); }
.status-handmatig { background: var(--hand-soft); color: var(--hand); }
.status-nvt { background: #eef2f7; color: var(--muted); }

.invsel { max-width: 320px; width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; font-size: 13px; background: #fff; }

.invlink {
  color: var(--accent); text-decoration: none; font-weight: 600; font-size: 13px;
  word-break: break-all;
}
.invlink:hover { text-decoration: underline; }

.editbtn {
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  border-radius: 6px; font-size: 12px; padding: 2px 8px; cursor: pointer;
  margin-left: 8px; vertical-align: middle;
}
.editbtn:hover { color: var(--ink); border-color: #b9c6da; }
.editbtn.confirm { color: var(--ok); border-color: #bfe3cc; background: var(--ok-soft); }
.editbtn.confirm:hover { filter: brightness(0.97); }

.pdfpreview {
  position: absolute; z-index: 50; background: #fff;
  border: 1px solid var(--line); border-radius: 10px; padding: 6px;
  box-shadow: 0 10px 30px rgb(15 23 42 / 22%);
  pointer-events: none;
}
.pdfpreview img { display: block; width: 320px; border-radius: 6px; }
.pdfpreview .pv-loading { width: 320px; padding: 30px 0; text-align: center; color: var(--muted); font-size: 13px; }

.missing {
  background: var(--bad-soft); border: 1px solid #f0c4c0; border-radius: 8px;
  padding: 10px 14px; margin-top: 14px; font-size: 13px;
}
.missing-title { font-weight: 700; color: var(--bad); margin-bottom: 4px; }
.missing ul { margin: 0; padding-left: 20px; }
.missing li { margin: 2px 0; }

.why { border: 0; background: none; color: var(--accent); cursor: pointer; font-size: 13px; font-weight: 600; white-space: nowrap; }
.reasons { font-size: 12px; color: var(--muted); text-align: left; margin-top: 6px; max-width: 260px; }

.card-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.summary { display: flex; gap: 8px; flex-wrap: wrap; }
.procbox .chip { font-size: 13px; padding: 6px 12px; }

.files-title {
  margin: 0 0 10px; font-size: 15px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700;
}

.unused { margin: 0; padding-left: 20px; }
.unused li { margin: 4px 0; }
.unused .fs { margin-left: 8px; }

.muted { color: var(--muted); }

footer { padding: 10px 20px 40px; font-size: 13px; }

@media (max-width: 720px) {
  .card-head { flex-direction: column; }
  .txns { display: block; overflow-x: auto; }
}
