/* Facturen Dashboard: stijl */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --text: #111827;
  --text-2: #374151;
  --muted: #6b7280;
  --faint: #9ca3af;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #eaf0ff;
  --danger: #b42318;
  --danger-soft: #fee4e2;
  --ok: #067647;
  --ok-soft: #dcfae6;
  --warn: #b54708;
  --warn-soft: #fef0c7;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px -12px rgba(16, 24, 40, .16);
  --nav-w: 220px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px; line-height: 1.45;
  color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; font-weight: 600; letter-spacing: -.01em; margin: 0; }
h2 { font-size: 15px; font-weight: 600; margin: 0 0 12px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; background: #f3f4f6; padding: 1px 5px; border-radius: 4px; }

/* Layout */
#app { display: flex; min-height: 100vh; }
#app.auth { display: block; }
nav {
  width: var(--nav-w); flex: none; background: var(--panel); border-right: 1px solid var(--border);
  padding: 20px 12px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
nav .brand { font-weight: 700; font-size: 15px; padding: 4px 12px 18px; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
nav .brand .dot { width: 10px; height: 10px; border-radius: 3px; background: var(--accent); }
nav .brand .brand-logo, nav .brand-logo { height: 26px; width: auto; display: block; }
nav a.item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; color: var(--text-2); border-radius: var(--radius-sm); font-weight: 500; }
nav a.item:hover { background: #f3f4f6; text-decoration: none; }
nav a.item.active { background: var(--accent-soft); color: var(--accent); }
nav a.item svg { width: 16px; height: 16px; flex: none; opacity: .8; }
nav a.item .kbd { margin-left: auto; }
nav .spacer { flex: 1; }
nav .user { padding: 10px 12px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--border); line-height: 1.6; }
nav .user strong { color: var(--text-2); font-weight: 500; display: block; overflow: hidden; text-overflow: ellipsis; }
main { flex: 1; padding: 28px 36px 60px; max-width: 1180px; min-width: 0; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .grow { flex: 1; }
.page-head .crumb { color: var(--muted); font-size: 13px; }
.page-head .crumb a { color: var(--muted); }

/* Panels & tables */
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.panel.flush { padding: 0; overflow: hidden; }
.panel.flush h2 { padding: 14px 20px 0; }
.panel.notice { border-color: #fcd34d; background: #fffbeb; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-weight: 500; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
tbody tr:last-child td { border-bottom: none; }
tr.clickable { cursor: pointer; }
tr.clickable:hover { background: #f9fafb; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.strong { font-weight: 500; }
tfoot td { font-weight: 600; border-top: 1px solid var(--border-strong); }
.empty { color: var(--muted); padding: 40px 20px; text-align: center; }
.empty .big { font-size: 15px; color: var(--text-2); font-weight: 500; margin-bottom: 6px; }
.empty .btn { margin-top: 14px; }

/* KPI's */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); cursor: pointer; }
.kpi:hover { border-color: var(--border-strong); }
.kpi .label { color: var(--muted); font-size: 12px; font-weight: 500; }
.kpi .value { font-size: 24px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi .hint { margin-top: 2px; }
.kpi.danger .value { color: var(--danger); }
.kpi.ok .value { color: var(--ok); }

/* Omzetgrafiek */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 120px; padding: 8px 0 0; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.bars .bar i { display: block; width: 100%; background: var(--accent-soft); border-radius: 4px 4px 0 0; min-height: 2px; transition: background .15s; }
.bars .bar.cur i { background: var(--accent); }
.bars .bar:hover i { background: var(--accent-hover); }
.bars .bar span { font-size: 11px; color: var(--muted); }
.bars .bar[data-tip] { position: relative; }
.bars .bar:hover::after { content: attr(data-tip); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); background: var(--text); color: #fff; padding: 4px 8px; border-radius: 5px; font-size: 11px; white-space: nowrap; margin-bottom: 4px; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.badge.draft { background: #f3f4f6; color: var(--muted); }
.badge.open { background: var(--accent-soft); color: var(--accent); }
.badge.overdue { background: var(--danger-soft); color: var(--danger); }
.badge.paid { background: var(--ok-soft); color: var(--ok); }
.badge.cancelled { background: #f3f4f6; color: var(--muted); text-decoration: line-through; }
.badge.credit { background: var(--warn-soft); color: var(--warn); }
.badge.source { background: #e0f2fe; color: #075985; }
.menu-hint { padding: 8px 10px; font-size: 12px; color: var(--muted); }

/* Forms */
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 20px; align-items: start; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid .span2 { grid-column: span 2; }
.form-grid h3.section, .mollie-panel h3.section { grid-column: 1 / -1; margin: 10px 0 -4px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.form-grid h3.section:first-child { margin-top: 0; padding-top: 0; border-top: none; }
label { display: block; font-size: 12px; font-weight: 500; color: var(--text-2); margin-bottom: 5px; }
.field > label { height: 18px; line-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row.nowrap { flex-wrap: nowrap; }
.row.nowrap input { min-width: 0; }
@media (max-width: 1100px) { .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .form-grid .span2 { grid-column: span 2; } }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } .form-grid .span2 { grid-column: auto; } }
label .opt { color: var(--faint); font-weight: 400; }
.entity-switch-wrap {
  margin: 4px 12px 18px;
}
.entity-switch-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
#entity-switch {
  width: 100%;
  padding: 8px 30px 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background-color: var(--panel);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path d='M1 1l4 4 4-4' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s ease;
}
#entity-switch:hover {
  border-color: var(--accent);
}
#entity-switch:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input, select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font: inherit; color: var(--text); background: #fff; transition: border-color .12s, box-shadow .12s;
}
input:hover, select:hover, textarea:hover { border-color: #b8bec8; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input:disabled, select:disabled, textarea:disabled { background: #f9fafb; color: var(--text-2); border-color: var(--border); }
textarea { min-height: 72px; resize: vertical; }
input[type=color] { padding: 2px 4px; height: 36px; width: 60px; }
input[type=date] { min-width: 150px; }
.inline-color { display: flex; gap: 8px; align-items: center; }
.inline-color input[type=text] { width: 110px; font-family: ui-monospace, monospace; }

/* Buttons */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: #fff; color: var(--text); font: inherit; font-weight: 500; cursor: pointer; line-height: 1.2;
  transition: background .12s, border-color .12s; white-space: nowrap;
}
button:hover, .btn:hover { background: #f3f4f6; text-decoration: none; }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover, .btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button.danger { color: var(--danger); }
button.danger:hover { background: var(--danger-soft); border-color: #f0b3ad; }
button.ghost, .btn.ghost { border-color: transparent; background: transparent; color: var(--text-2); }
button.ghost:hover, .btn.ghost:hover { background: #f3f4f6; }
button.small, .btn.small { padding: 5px 10px; font-size: 12.5px; }
button.icon { padding: 6px; width: 30px; height: 30px; }
button:disabled { opacity: .5; cursor: default; pointer-events: none; }
button.busy { position: relative; color: transparent !important; }
button.busy::after { content: ''; position: absolute; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.5); border-top-color: #fff; border-radius: 50%; animation: spin .6s linear infinite; }
button.busy:not(.primary)::after { border-color: #d1d5db; border-top-color: var(--text-2); }
@keyframes spin { to { transform: rotate(360deg); } }
.kbd { font-family: inherit; font-size: 11px; color: var(--faint); border: 1px solid var(--border); border-radius: 4px; padding: 0 5px; line-height: 16px; }

.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .grow { flex: 1; }
.toolbar input, .toolbar select { width: auto; }
.toolbar input[type=search] { min-width: 240px; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; background: #fff; }
.seg button { border: none; border-radius: 0; border-right: 1px solid var(--border); padding: 7px 12px; font-weight: 500; color: var(--text-2); }
.seg button:last-child { border-right: none; }
.seg button.active { background: var(--accent-soft); color: var(--accent); }

/* Invoice editor */
.editor-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.editor-head .title { display: flex; align-items: center; gap: 10px; }
.editor-head .meta { color: var(--muted); font-size: 13px; }
table.lines th, table.lines td { padding: 6px 6px; }
table.lines th:first-child, table.lines td:first-child { padding-left: 0; }
table.lines input, table.lines select { padding: 7px 9px; }
table.lines .desc { width: 46%; }
table.lines .qty { width: 90px; }
table.lines .period { width: 190px; }
table.lines .price { width: 130px; }
table.lines .vat { width: 150px; }
table.lines .tot { width: 120px; text-align: right; font-variant-numeric: tabular-nums; }
table.lines .act { width: 34px; }
table.lines tbody tr:last-child td { border-bottom: 1px solid var(--border); }
table.lines.readonly td { padding: 10px 6px; }
.totals { margin: 14px 0 0 auto; width: 320px; }
.totals > div, .totals #t-vat-rows > div { display: flex; justify-content: space-between; padding: 4px 0; font-variant-numeric: tabular-nums; }
.totals #t-vat-rows { display: block; padding: 0; }
.totals .grand { font-weight: 600; border-top: 1px solid var(--border-strong); margin-top: 6px; padding-top: 10px; font-size: 17px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.status-strip { display: flex; gap: 20px; flex-wrap: wrap; color: var(--text-2); font-size: 13px; }
.status-strip b { font-weight: 500; color: var(--text); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.timeline li:last-child { border-bottom: none; }
.timeline .when { color: var(--muted); width: 120px; flex: none; font-variant-numeric: tabular-nums; }
.autosave { color: var(--faint); font-size: 12px; }

/* Combobox (klant zoeken) */
.combo { position: relative; }
.combo ul { position: absolute; z-index: 20; top: 100%; left: 0; right: 0; background: #fff; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow); list-style: none; margin: 4px 0 0; padding: 4px; max-height: 260px; overflow: auto; }
.combo li { padding: 7px 10px; border-radius: 5px; cursor: pointer; }
.combo li:hover, .combo li.active { background: var(--accent-soft); }
.combo li small { color: var(--muted); margin-left: 6px; }

/* Login */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login { width: 100%; max-width: 400px; padding: 32px; box-shadow: var(--shadow); }
.login-logo { width: 40px; height: 40px; display: block; margin-bottom: 14px; }
.login h1 { font-size: 22px; margin-bottom: 4px; }
.login .sub { color: var(--muted); margin-bottom: 22px; }
.login .field { margin-bottom: 14px; }
.login input { padding: 10px 12px; font-size: 15px; }
.login button.primary { width: 100%; padding: 11px 14px; font-size: 15px; margin-top: 6px; }
.login .alt { display: flex; width: 100%; margin-top: 10px; background: none; border: none; color: var(--accent); padding: 8px; font-size: 14px; }
.login .alt:hover { background: var(--accent-soft); }

/* Toast, loader, dialog */
#toast {
  position: fixed; bottom: 20px; right: 20px; z-index: 100; background: var(--text); color: #fff;
  padding: 10px 16px; border-radius: 8px; opacity: 0; transform: translateY(6px); transition: opacity .15s, transform .15s; pointer-events: none; max-width: 420px; font-size: 13.5px; box-shadow: var(--shadow);
}
#toast.show { opacity: 1; transform: none; }
#toast.error { background: var(--danger); }
.loader { color: var(--muted); padding: 60px; text-align: center; }
.skeleton { background: linear-gradient(90deg, #f3f4f6 25%, #e9ebee 37%, #f3f4f6 63%); background-size: 400% 100%; animation: shimmer 1.2s infinite; border-radius: 6px; height: 14px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
dialog.modal { border: none; border-radius: 12px; padding: 0; box-shadow: var(--shadow); max-width: 460px; width: calc(100% - 32px); }
dialog.modal::backdrop { background: rgba(17, 24, 39, .35); }
dialog.modal .body { padding: 22px 24px; }
dialog.modal h2 { margin-bottom: 8px; }
dialog.modal p { margin: 0 0 16px; color: var(--text-2); }
dialog.modal .actions { display: flex; justify-content: flex-end; gap: 8px; }

.muted { color: var(--muted); }
.faint { color: var(--faint); }
.right { text-align: right; }
.mt { margin-top: 16px; }
.mt-s { margin-top: 8px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.logo-preview { height: 48px; max-width: 200px; object-fit: contain; display: block; margin-bottom: 8px; }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 6px; border: 1px solid rgba(0,0,0,.08); }

@media (max-width: 860px) {
  #app { flex-direction: column; }
  nav { width: auto; height: auto; position: static; flex-direction: row; flex-wrap: wrap; padding: 8px; gap: 2px; }
  nav .brand { padding: 8px; width: 100%; }
  nav .spacer, nav .user, nav .kbd { display: none; }
  main { padding: 16px; }
  .two-col { grid-template-columns: 1fr; }
  .totals { width: 100%; }
  table.lines .desc { width: auto; }
}
@media print { nav, .toolbar, #toast { display: none; } }

/* herinneringsschema (handelsnaam) */
.check { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; cursor: pointer; line-height: 1.4; }
.check input { margin-top: 3px; }
label.inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted, #6b7280); }
.rem-step { border: 1px solid var(--border, #e5e7eb); border-radius: 10px; padding: 14px 16px; margin-bottom: 12px; background: var(--surface-2, #fafafa); }
.rem-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.rem-step .field { margin-bottom: 10px; }
.rem-step .field:last-child { margin-bottom: 0; }
.check input[type="checkbox"] { width: auto; flex: 0 0 auto; margin: 3px 0 0; }
.row > input[type="date"] { width: 170px; }

/* v7: navigatie, documentweergave, producten, mailvenster */
nav .new-btn { margin: 0 4px 14px; justify-content: space-between; }
nav .new-btn .kbd { color: rgba(255,255,255,.75); border-color: rgba(255,255,255,.35); }
.page-sub { color: var(--muted); font-size: 13px; }
.panel-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.panel-head h2 { margin: 0; }
.panel-head .grow { flex: 1; }
.panel.collapsed .ent-form { display: none; }
.panel.collapsed .panel-head { margin-bottom: 0; }
.panel.collapsed > h2.mt { margin-top: 18px; }
.menu { position: relative; }
.menu-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; background: #fff; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 4px; min-width: 220px; display: flex; flex-direction: column; }
.menu-list button { border: none; background: none; justify-content: flex-start; border-radius: 5px; padding: 8px 10px; font-weight: 400; }
.menu-list button:hover { background: #f3f4f6; }
.menu-list button.danger:hover { background: var(--danger-soft); }
.doc .doc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 18px; }
.doc .label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 4px; }
.doc .strong { font-weight: 600; font-size: 15px; }
.doc-meta { display: grid; grid-template-columns: 130px 1fr; gap: 4px 12px; margin: 0; font-size: 13.5px; }
.doc-meta dt { color: var(--muted); }
.doc-meta dd { margin: 0; }
.doc-intro { margin: 0 0 14px; white-space: pre-wrap; }
.doc table.lines th, .doc table.lines td { padding: 9px 8px; }
.doc table.lines th:first-child, .doc table.lines td:first-child { padding-left: 0; }
.doc table.lines th:last-child, .doc table.lines td:last-child { padding-right: 0; }
.note-panel { background: #fffdf5; border-color: #f3e3a3; }
.note-panel textarea { background: transparent; border-color: #e8d891; min-height: 48px; }
.note-panel .autosave { display: block; margin-top: 4px; }
.pay-form { display: grid; grid-template-columns: 120px 150px 120px auto; gap: 10px; align-items: end; }
.pay-form .field { margin: 0; }
.prod-list { position: absolute; z-index: 20; top: 100%; left: 0; min-width: 320px; background: #fff; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow); list-style: none; margin: 4px 0 0; padding: 4px; max-height: 260px; overflow: auto; }
.prod-list li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 10px; border-radius: 5px; cursor: pointer; }
.prod-list li:hover, .prod-list li.active { background: var(--accent-soft); }
.prod-list li small { color: var(--muted); white-space: nowrap; }
table.lines td.combo { position: relative; }
tr.inactive td { opacity: .55; }
dialog.modal.wide { max-width: 640px; }
.mail-meta { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--text-2); background: #f9fafb; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 14px; }
.mail-meta b { font-weight: 500; color: var(--muted); display: inline-block; width: 60px; }
dialog.modal .field { margin-bottom: 12px; }
th .opt { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--faint); }
@media (max-width: 860px) {
  .doc .doc-grid { grid-template-columns: 1fr; }
  .pay-form { grid-template-columns: 1fr 1fr; }
  nav .new-btn { display: none; }
}
.menu-list[hidden] { display: none; }
.timeline .when { width: 138px; }
@media (max-width: 860px) {
  .panel.flush, .doc { overflow-x: auto; }
  .doc table.lines { min-width: 520px; }
  .menu-list { right: auto; left: 0; }
}
.att-list { list-style: none; margin: 0; padding: 0; }
.att-list li { display: flex; align-items: center; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.att-list li:last-child { border-bottom: none; }
.att-list li a { flex: 1; }
label.btn { margin: 0; font-size: 12.5px; }

/* Mollie-paneel bij bedrijf */
.mollie-panel { border-top: 1px solid var(--border); padding-top: 4px; }
.mollie-panel h3.section { border-top: none; padding-top: 0; margin: 8px 0 8px; }
.mollie-panel h3.section .opt { text-transform: none; letter-spacing: 0; font-weight: 400; }
.mollie-panel .mollie-status { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mollie-panel .row.nowrap input { flex: 1 1 260px; }

/* klant-keuze: duidelijk herkenbaar als keuzelijst */
.combo > input#i-customer-q { padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }

/* PDF-voorbeeld */
dialog.modal.pdf { max-width: 960px; width: calc(100% - 48px); height: calc(100vh - 48px); display: flex; flex-direction: column; overflow: hidden; }
dialog.modal.pdf .pdf-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: #fff; }
dialog.modal.pdf iframe { flex: 1; width: 100%; border: none; background: #525659; }

/* ---------- rapporten: tabs, kpi-warn, charts, donut, entity-bars ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 4px 0 16px; flex-wrap: wrap; }
.tab-btn { background: none; border: none; padding: 9px 14px; font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; border-radius: 0; }
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.kpi.warn { border-color: var(--warn-soft); background: var(--warn-soft); }
.kpi.warn .value { color: var(--warn); }
.kpi .hint { font-size: 11px; margin-top: 4px; }

.chart-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }

.grid-2 { display: grid; grid-template-columns: minmax(260px, 1fr) 2fr; gap: 16px; margin-top: 16px; }
@media (max-width: 760px) { .grid-2 { grid-template-columns: 1fr; } }

.donut-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.donut-legend { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.donut-legend .legend-item { justify-content: flex-start; font-size: 13px; color: var(--text-2); width: 100%; }
.donut-legend .legend-item b { margin-left: auto; color: var(--text); font-weight: 600; }

.entity-bars { display: flex; flex-direction: column; gap: 12px; }
.entity-bar-row { display: grid; grid-template-columns: 120px 1fr auto; align-items: center; gap: 10px; }
.entity-bar-label { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entity-bar-track { background: var(--bg); border-radius: 6px; height: 10px; overflow: hidden; }
.entity-bar-fill { background: var(--accent); height: 100%; border-radius: 6px; }
.entity-bar-value { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; }

.empty-note { color: var(--muted); font-size: 13px; padding: 8px 2px 4px; }

/* ---------- v22: inkoop en bank ---------- */
main.ink-wide { max-width: 1500px; }
main.wide { max-width: 1520px; }
main.wide .panel.flush { overflow-x: auto; }
.ink-mail { display: flex; flex-direction: column; gap: 4px; border-style: dashed; transition: background .15s, border-color .15s; }
.ink-mail.drag { background: var(--accent-soft); border-color: var(--accent); }
.ink-addr { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; user-select: all; }
.ink-attn { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: var(--warn-soft); color: var(--warn); font-weight: 700; font-size: 12px; cursor: help; }
.ink-attn-list ul { margin: 6px 0 0; padding-left: 18px; }
.ink-review { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.ink-preview { position: sticky; top: 16px; height: calc(100vh - 120px); min-height: 480px; display: flex; }
.ink-preview iframe { flex: 1; width: 100%; border: none; background: #fff; }
.ink-preview .loader, .ink-preview .empty { margin: auto; }
.ink-img { flex: 1; overflow: auto; background: #f3f4f6; display: flex; align-items: flex-start; justify-content: center; }
.ink-img img { max-width: 100%; height: auto; display: block; }
.ink-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
table.ink-lines td { padding: 4px 6px; }
table.ink-lines th { padding: 6px; }
table.ink-lines input { text-align: right; }
table.ink-lines td:first-child select { min-width: 80px; }
.ink-totals { margin-top: 10px; margin-left: auto; max-width: 320px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.ink-totals > div { display: flex; justify-content: space-between; gap: 12px; }
.ink-totals .grand { border-top: 1px solid var(--border); padding-top: 6px; font-size: 15px; }
.ink-warn { color: var(--warn); font-size: 13px; font-weight: 500; }
.ink-meta { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.ink-meta .muted { display: inline-block; min-width: 82px; }
table.ink-pays td { padding: 6px 8px; }
.ink-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; line-height: 1.5; }
.ink-todo { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; border-color: #fcd34d; background: #fffbeb; }
.ink-neg { color: var(--danger); }
.ink-pos { color: var(--ok); }
.ink-nowrap { white-space: nowrap; }
.ink-nowrap .btn, .ink-nowrap button { margin-left: 4px; }
table.ink-bank .ink-desc { max-height: 3em; max-width: 340px; color: var(--text-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
table.ink-bank tr.open td { background: #f9fafb; border-bottom-color: transparent; }
tr.ink-detail > td { background: #f9fafb; padding: 0 12px 16px; }
.ink-tx { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px; padding-top: 4px; }
.ink-tx-info, .ink-tx-linked { grid-column: 1 / -1; font-size: 13px; }
.ink-tx-col h3 { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 6px 0 8px; }
.ink-tx-col select, .ink-tx-col input { width: 100%; }
table.ink-sugs td { padding: 6px 8px; background: #fff; }
.ink-link { white-space: nowrap; }
@media (max-width: 1100px) {
  .ink-review { grid-template-columns: 1fr; }
  .ink-preview { position: static; height: 70vh; }
}
@media (max-width: 760px) {
  .ink-form { grid-template-columns: 1fr; }
  .ink-form .span2 { grid-column: auto; }
  .ink-tx { grid-template-columns: 1fr; }
}

.ink-paybox { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #f9fafb; }
.ink-paylabel { font-size: 12px; font-weight: 500; color: var(--text-2); margin-bottom: 6px; }

#ink-drop-overlay { position: fixed; inset: 0; z-index: 1000; display: none; align-items: center; justify-content: center; background: rgba(37, 99, 235, .12); border: 3px dashed var(--accent); pointer-events: none; }
#ink-drop-overlay.show { display: flex; }
#ink-drop-overlay > div { background: #fff; padding: 18px 26px; border-radius: 12px; box-shadow: var(--shadow); font-size: 16px; color: var(--accent); }
