@font-face { font-family: Poppins; font-weight: 400; font-style: normal; font-display: swap; src: url('/assets/fonts/poppins-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: Poppins; font-weight: 500; font-style: normal; font-display: swap; src: url('/assets/fonts/poppins-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: Poppins; font-weight: 600; font-style: normal; font-display: swap; src: url('/assets/fonts/poppins-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: Poppins; font-weight: 700; font-style: normal; font-display: swap; src: url('/assets/fonts/poppins-latin-700-normal.woff2') format('woff2'); }
/* Merkkleuren: pas deze variabelen aan op de SiteNest-huisstijl. */
:root {
  --brand: #1e3a5f;
  --brand-dark: #1e3a5f;
  --brand-hover: #152b47;
  --accent: #4caf50;
  --ink: #1d2433;
  --muted: #667085;
  --line: #e4e7ec;
  --bg: #f6f7f9;
  --card: #ffffff;
  --ok: #067647;
  --ok-bg: #ecfdf3;
  --err: #b42318;
  --err-bg: #fef3f2;
  --warn: #b54708;
  --warn-bg: #fffaeb;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 Poppins, system-ui, Arial, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: 0; font-weight: 600; }
h1 small { color: var(--muted); font-weight: 400; font-size: 1rem; }
h2 { font-size: 1.1rem; margin: 1.5rem 0 .6rem; font-weight: 600; }
code { background: #eef1f5; padding: .1em .35em; border-radius: 4px; font-size: .9em; }

.top { display: flex; align-items: center; gap: 1.5rem; padding: .35rem 1.5rem; border-bottom: 3px solid var(--accent); background: var(--brand-dark); color: #fff; flex-wrap: wrap; }
.top a { color: #fff; }
.brand { display: flex; align-items: center; }
.brand img { height: 52px; width: auto; display: block; }
.auth-logo { display: block; margin: 0 auto 1rem; height: 96px; width: auto; }
.invoice-logo { height: 84px; width: auto; display: block; margin: -1.2rem 0 -.2rem -2.2rem; }
.top nav { display: flex; gap: .25rem; flex: 1; flex-wrap: wrap; }
.top nav.sys { flex: 0 0 auto; }
.top nav.sys a { font-size: .9rem; }
.top nav a { padding: .35rem .7rem; border-radius: 6px; opacity: .85; }
.top nav a:hover, .top nav a.active { background: rgba(255,255,255,.16); opacity: 1; text-decoration: none; }
.dd { position: relative; }
.dd summary { list-style: none; cursor: pointer; padding: .35rem .7rem; border-radius: 6px; opacity: .85; user-select: none; }
.dd summary::-webkit-details-marker { display: none; }
.dd summary::after { content: ""; display: inline-block; margin-left: .45rem; vertical-align: .15em; border: .3em solid transparent; border-top-color: currentColor; border-bottom-width: 0; }
.dd summary:hover, .dd[open] summary, .dd.active summary { background: rgba(255,255,255,.16); opacity: 1; }
.dd-menu { position: absolute; top: calc(100% + 4px); left: 0; z-index: 20; min-width: 12rem; background: #fff; border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.2); padding: .3rem; display: flex; flex-direction: column; }
.top nav.sys .dd-menu { left: auto; right: 0; }
.top .dd-menu a { color: var(--ink); opacity: 1; padding: .45rem .7rem; font-size: .95rem; }
.top .dd-menu a:hover { background: #eef1f5; }
.top .dd-menu a.active { background: #e3ebf5; font-weight: 600; }
.logout { display: flex; align-items: center; gap: .6rem; margin: 0; }
.who { opacity: .85; font-size: .9rem; }
.codes { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .4rem; padding: 0; margin: .5rem 0 0; }
.codes code { background: #fff; display: block; padding: .3rem .5rem; text-align: center; user-select: all; }
.sessions { margin-top: 1rem; }

main { max-width: 1200px; margin: 0 auto; padding: 1.5rem; }
.narrow { max-width: 460px; margin: 1.5rem auto 3rem; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.actions form { margin: 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; }
section { margin-bottom: 1rem; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 1.25rem; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1rem; align-items: start; }

.btn, button.btn { display: inline-block; padding: .5rem 1rem; border: 1px solid var(--brand); background: var(--brand); color: #fff; border-radius: 8px; font: inherit; cursor: pointer; }
.btn:hover { background: var(--brand-hover); text-decoration: none; }
.btn-secondary, button.btn-secondary { background: #fff; color: var(--brand); }
.btn-secondary:hover, button.btn-secondary:hover { background: #eef6f9; }
.btn-danger, button.btn-danger { background: #fff; color: var(--err); border-color: var(--err); }
.btn-danger:hover, button.btn-danger:hover { background: var(--err-bg); }
button.link { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; cursor: pointer; }
.top button.link { color: #fff; opacity: .85; }
button.link:hover { text-decoration: underline; }

.flash { padding: .7rem 1rem; border-radius: 8px; margin-bottom: 1rem; border: 1px solid; }
.flash ul { margin: 0; padding-left: 1.2rem; }
.flash-ok { background: var(--ok-bg); border-color: #abefc6; color: var(--ok); }
.flash-err { background: var(--err-bg); border-color: #fecdca; color: var(--err); }
.key { display: block; margin-top: .4rem; padding: .5rem; background: #fff; word-break: break-all; user-select: all; }

.filters { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
input, select, textarea { font: inherit; padding: .5rem .6rem; border: 1px solid #cdd2da; border-radius: 8px; background: #fff; width: 100%; }
.filters input, .filters select { width: auto; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); border-color: var(--brand); }

.form .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 1.25rem; }
.cell.wide { grid-column: 1 / -1; }
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; margin-bottom: .25rem; font-size: .9rem; }
.check { display: inline-flex; align-items: center; gap: .5rem; font-weight: 400 !important; }
.check input { width: auto; }
.err { color: var(--err); margin: .25rem 0 0; font-size: .85rem; }
.hint { color: var(--muted); margin: .25rem 0 0; font-size: .85rem; }
.form-actions { display: flex; gap: .5rem; margin-top: .5rem; }
.inline-form { display: flex; gap: 1rem; align-items: end; flex-wrap: wrap; }
.inline-form .field { margin: 0; }
.danger-zone { margin-top: 1.5rem; display: flex; gap: .5rem; flex-wrap: wrap; }
.danger-zone form { margin: 0; }

.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .6rem .8rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: #fafbfc; }
tr:last-child td { border-bottom: 0; }
.num { text-align: right; white-space: nowrap; }
.row-actions { text-align: right; white-space: nowrap; }
.row-actions form { display: inline; margin: 0 .5rem 0 0; }
.empty { color: var(--muted); }
.pager { display: flex; gap: 1rem; justify-content: center; margin: 1rem 0; align-items: center; }

.badge { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .78rem; background: #eef1f5; color: var(--muted); font-weight: 600; }
.b-active, .b-paid { background: var(--ok-bg); color: var(--ok); }
.b-final { background: #fff4d6; color: #7a5a00; }
.b-sent, .b-prospect, .b-monthly, .b-quarterly, .b-yearly { background: #e8f3f7; color: var(--brand-dark); }
.b-overdue, .b-suspended { background: var(--warn-bg); color: var(--warn); }
.b-internal { background: #eef1f5; color: var(--brand); }
.b-external { background: #e8f3f7; color: var(--brand-dark); }
.steps { margin: .5rem 0 1rem; padding-left: 1.2rem; }
.b-cancelled, .b-inactive { background: var(--err-bg); color: var(--err); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 1rem; display: flex; flex-direction: column; }
.stat-n { font-size: 1.5rem; font-weight: 700; }
.stat-l { color: var(--muted); font-size: .85rem; }
.stat-warn .stat-n { color: var(--warn); }
.activity { list-style: none; padding: 0; margin: 0; font-size: .9rem; }
.activity li { padding: .35rem 0; border-bottom: 1px solid var(--line); }
.activity span { color: var(--muted); margin-right: .4rem; }

.details { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; margin: 0; }
.details dt { color: var(--muted); }
.details dd { margin: 0; }
.notes { margin-top: 1rem; padding-top: .8rem; border-top: 1px solid var(--line); color: var(--muted); }

.lines-edit input { min-width: 100px; }
.lines-edit td:first-child input { min-width: 280px; }
.num-in { text-align: right; }

.invoice { max-width: 820px; padding: 2rem; }
.invoice-head { display: flex; justify-content: space-between; gap: 2rem; margin-bottom: 2rem; flex-wrap: wrap; }
.invoice-head h2 { margin-top: 0; }
.invoice-meta { text-align: right; }
.plain th, .plain td { border: 0; padding: .1rem .4rem; background: none; text-transform: none; letter-spacing: 0; font-size: .9rem; }
.plain th { color: var(--muted); font-weight: 500; }
.bill-to { margin-bottom: 1.5rem; }
.lines { margin-bottom: 1.5rem; }
.lines tfoot td { border: 0; padding-top: .25rem; padding-bottom: .25rem; }
.lines .grand td { font-weight: 700; border-top: 2px solid var(--ink); }
.invoice-foot { color: var(--muted); font-size: .9rem; }

@media print {
  .top, .no-print, .flash { display: none !important; }
  body { background: #fff; }
  main { padding: 0; max-width: none; }
  .invoice { border: 0; padding: 0; max-width: none; }
}

.lines-edit tr.muted { color: var(--muted); }
.check { display: block; margin: 1rem 0; }
.tabs { display: flex; gap: .5rem; margin: .5rem 0 1rem; flex-wrap: wrap; }
.tabs a { padding: .3rem .8rem; border-radius: 999px; background: #eef1f5; color: var(--brand); text-decoration: none; font-weight: 600; font-size: .9rem; }
.tabs a.on { background: var(--brand); color: #fff; }
.dialog { border: 0; border-radius: 10px; padding: 1.5rem; max-width: 460px; width: calc(100% - 2rem); box-shadow: 0 10px 40px rgba(30,58,95,.3); }
.dialog::backdrop { background: rgba(30,58,95,.45); }
.dialog h2 { margin-top: 0; }
.row-actions a { margin-right: .5rem; }

/* Leverdatum / periode per factuurregel */
.line-note { color: var(--muted); font-size: .82rem; margin-top: .1rem; }
.line-period { display: flex; flex-wrap: wrap; gap: .5rem 1rem; margin-top: .35rem; font-size: .8rem; color: var(--muted); }
.line-period label { display: inline-flex; align-items: center; gap: .35rem; }
.line-period input[type=date] { width: auto; padding: .2rem .4rem; font-size: .8rem; }

/* Betalingen, herinneringen, uploads */
.badge.b-partial { background: #fff4d6; color: #8a5a00; }
label.inline { display: inline; font-weight: normal; }
.inline-form { margin-top: 1rem; }

/* Voorbeeld van het geüploade bestand naast het formulier */
.with-preview { display: grid; gap: 1rem; grid-template-columns: 1fr; }
.file-preview iframe { width: 100%; height: 60vh; border: 1px solid var(--line, #d5dae1); border-radius: 8px; background: #fff; }
.file-preview img { max-width: 100%; height: auto; border: 1px solid var(--line, #d5dae1); border-radius: 8px; }
@media (min-width: 1000px) {
  .with-preview { grid-template-columns: 1fr 1fr; align-items: start; }
  .with-preview .file-preview { order: 2; position: sticky; top: 1rem; }
  .file-preview iframe { height: 80vh; }
}
.quick-upload input[type=file] { width: 100%; padding: 1rem; font-size: 1rem; }

/* QR-code voor 2FA */
.qr { margin: .5rem 0 1rem; }
.qr img { display: block; width: 220px; height: 220px; image-rendering: pixelated; background: #fff; padding: 4px; border: 1px solid var(--line, #d5dae1); border-radius: 8px; }
