/* Verver.com administratie — huisstijl (bron: verver-com-brand) */
:root {
  --navy-dark: #0D2137;
  --navy: #1B4F72;
  --blue: #2E86C1;
  --blue-light: #5BA3C9;
  --blue-pale: #A9CCE3;
  --bg: #FAFAFA;
  --surface: #FFFFFF;
  --ink: #1A2433;
  --muted: #5C6B7A;
  --line: #E3E8ED;
  --danger: #B23A48;
  --ok: #2E7D54;
  --radius: 12px;
  --shadow: 0 10px 30px rgba(13, 33, 55, 0.10);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* Dot-grid achtergrondtextuur, verwijst naar de brand-banner */
body {
  min-height: 100vh;
  background-image: radial-gradient(var(--blue-pale) 1.6px, transparent 1.6px);
  background-size: 22px 22px;
  background-attachment: fixed;
}

.shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.brand .mark {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 4px rgba(46, 134, 193, 0.16);
}
.brand .name { font-weight: 700; letter-spacing: 0.2px; color: var(--navy); }
.brand .name span { color: var(--blue); }

h1 { font-size: 20px; margin: 14px 0 4px; color: var(--navy-dark); }
.sub { color: var(--muted); font-size: 14px; margin: 0 0 22px; }

label { display: block; font-size: 13px; font-weight: 600; color: var(--navy); margin: 14px 0 6px; }
input[type="email"], input[type="password"], input[type="text"] {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 15px;
  font-family: var(--font);
  background: #FBFCFD;
  transition: border-color .15s, box-shadow .15s;
}
input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(46, 134, 193, 0.15);
  background: #fff;
}

button {
  font-family: var(--font);
  cursor: pointer;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 16px;
}
.btn-primary {
  width: 100%;
  margin-top: 20px;
  background: var(--blue);
  color: #fff;
  transition: background .15s, transform .05s;
}
.btn-primary:hover { background: #2877ad; }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { background: var(--blue-light); cursor: not-allowed; }

.btn-link {
  background: none;
  color: var(--blue);
  padding: 8px 0;
  font-size: 14px;
  text-align: center;
  width: 100%;
  margin-top: 12px;
}
.btn-link:hover { text-decoration: underline; }

.msg { margin-top: 16px; font-size: 14px; padding: 10px 12px; border-radius: 8px; display: none; }
.msg.show { display: block; }
.msg.error { background: #FBEAEC; color: var(--danger); }
.msg.ok { background: #E9F4EE; color: var(--ok); }
.msg.info { background: #EAF2F9; color: var(--navy); }

.qr-wrap { text-align: center; margin: 18px 0; }
.qr-wrap img, .qr-wrap svg { width: 200px; height: 200px; }
.secret {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
  background: #F2F5F8;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  word-break: break-all;
  color: var(--navy-dark);
  text-align: center;
}

.hidden { display: none !important; }

/* Beveiligde lege omgeving (na login + 2FA) */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--navy-dark);
  color: #fff;
}
.topbar .brand .name, .topbar .brand .name span { color: #fff; }
.topbar .who { font-size: 13px; color: var(--blue-pale); }
.topbar button { background: rgba(255,255,255,0.12); color: #fff; padding: 8px 14px; font-size: 13px; }
.topbar button:hover { background: rgba(255,255,255,0.22); }

.empty-state {
  max-width: 640px;
  margin: 80px auto;
  text-align: center;
  padding: 0 24px;
}
.empty-state .badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--ok);
  background: #E9F4EE;
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.empty-state h2 { color: var(--navy-dark); font-size: 24px; margin: 0 0 10px; }
.empty-state p { color: var(--muted); font-size: 15px; line-height: 1.55; }

/* ---------- App-layout ---------- */
.layout { display: flex; min-height: calc(100vh - 64px); }
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-item {
  text-align: left;
  background: none;
  color: var(--navy);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-item:hover:not(:disabled) { background: #EFF4F8; }
.nav-item.active { background: var(--blue); color: #fff; }
.nav-item:disabled { color: var(--muted); cursor: default; opacity: 0.7; }
.nav-item .soon {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  background: var(--line); color: var(--muted); padding: 2px 6px; border-radius: 999px;
}
.main { flex: 1; padding: 28px 32px; max-width: 1100px; }

.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.page-head h2 { color: var(--navy-dark); font-size: 22px; margin: 0; }
.page-head .btn-primary { width: auto; margin: 0; padding: 10px 16px; }

.toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.search { flex: 1; max-width: 360px; }
.count { color: var(--muted); font-size: 13px; }

.loading, .empty {
  color: var(--muted); font-size: 15px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; text-align: center;
}

/* ---------- Datatabel ---------- */
.data-table {
  width: 100%; border-collapse: collapse;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
}
.data-table th {
  text-align: left; font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.3px; color: var(--muted);
  padding: 12px 14px; border-bottom: 1px solid var(--line); background: #FBFCFD;
}
.data-table td { padding: 13px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
.data-table tbody tr { cursor: pointer; transition: background .1s; }
.data-table tbody tr:hover { background: #F4F8FB; }
.data-table tbody tr:last-child td { border-bottom: none; }
.muted2 { color: var(--muted); font-weight: 400; }

.badge-ok, .badge-off { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.badge-ok { background: #E9F4EE; color: var(--ok); }
.badge-off { background: #F1F3F5; color: var(--muted); }

/* ---------- Knoppen extra ---------- */
.btn-secondary { background: #EEF2F6; color: var(--navy); padding: 11px 16px; }
.btn-secondary:hover { background: #E2E9EF; }

/* ---------- Formulier in modal ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-field { display: flex; flex-direction: column; }
.form-field-full { grid-column: 1 / -1; }
.form-field label { margin: 0 0 6px; }
.form-field .req { color: var(--danger); }
.form-field textarea {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px;
  font-family: var(--font); font-size: 15px; background: #FBFCFD; resize: vertical;
}
.form-field textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(46,134,193,.15); background: #fff; }
.form-field.check label { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--ink); cursor: pointer; }
.form-field.check input { width: auto; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(13,33,55,0.45);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 48px 20px; opacity: 0; transition: opacity .18s; z-index: 1000; overflow-y: auto;
}
.modal-overlay.show { opacity: 1; }
.modal {
  width: 100%; max-width: 520px; background: var(--surface);
  border-radius: var(--radius); box-shadow: 0 20px 60px rgba(13,33,55,.30);
  transform: translateY(-8px); transition: transform .18s;
}
.modal-overlay.show .modal { transform: translateY(0); }
.modal-wide { max-width: 720px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; color: var(--navy-dark); font-size: 18px; }
.modal-close { background: none; font-size: 24px; color: var(--muted); padding: 0 6px; line-height: 1; }
.modal-close:hover { color: var(--navy-dark); }
.modal-body { padding: 22px 24px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--line); }
.modal-foot .btn-primary { width: auto; margin: 0; padding: 11px 20px; }

/* ---------- Toast ---------- */
#toast-root { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 1100; }
.toast {
  min-width: 240px; max-width: 360px; padding: 13px 16px; border-radius: 8px;
  color: #fff; font-size: 14px; box-shadow: var(--shadow);
  opacity: 0; transform: translateX(16px); transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translateX(0); }
.toast.ok { background: var(--ok); }
.toast.error { background: var(--danger); }
.toast.info { background: var(--navy); }

/* ---------- Status-badges facturen ---------- */
.badge-status { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.st-concept { background: #F1F3F5; color: var(--muted); }
.st-verstuurd { background: #EAF2F9; color: var(--navy); }
.st-betaald { background: #E9F4EE; color: var(--ok); }
.st-deels { background: #FCF3E3; color: #97601A; }
.st-oninbaar { background: #FBEAEC; color: var(--danger); }
.st-credit { background: #EFEAF7; color: #5B3E8E; }

/* ---------- Hint + losse kaartformulieren (instellingen) ---------- */
.hint { color: var(--muted); font-size: 14px; margin: 0 0 16px; }
.card-form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; }
.form-actions { margin-top: 18px; display: flex; justify-content: flex-end; }
.form-actions .btn-primary { width: auto; margin: 0; padding: 11px 22px; }

/* ---------- Factuurregels in editor ---------- */
.regels-table { width: 100%; border-collapse: collapse; margin-top: 16px; }
.regels-table th {
  text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase;
  color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line);
}
.regels-table td { padding: 5px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.regels-table input, .regels-table select {
  width: 100%; padding: 7px 8px; font-size: 14px; border: 1px solid var(--line);
  border-radius: 6px; background: #FBFCFD; font-family: var(--font);
}
.regels-table .r-aantal, .regels-table .r-prijs { max-width: 90px; }
.regels-table .r-bedrag { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.regels-table .r-del {
  background: none; color: var(--muted); font-size: 18px; padding: 2px 8px; line-height: 1;
}
.regels-table .r-del:hover { color: var(--danger); }
.regels-table.view th, .regels-table.view td { padding: 8px; }
.regels-table.view td:nth-child(n+2) { text-align: right; white-space: nowrap; }
.regels-table.view th:nth-child(n+2) { text-align: right; }

.totalen { margin-top: 14px; margin-left: auto; max-width: 280px; }
.tot-rij { display: flex; justify-content: space-between; padding: 4px 0; font-size: 14px; color: var(--ink); }
.tot-rij span:last-child { font-variant-numeric: tabular-nums; }
.tot-eind { border-top: 2px solid var(--line); margin-top: 6px; padding-top: 8px; font-weight: 700; color: var(--navy-dark); font-size: 16px; }

/* ---------- Factuurdetail ---------- */
.detail-kop { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 8px; }
.detail-kop strong { font-size: 18px; color: var(--navy-dark); }
.detail-meta { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.detail-acties { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.detail-acties .btn-primary, .detail-acties .btn-secondary { width: auto; margin: 0; }

/* ---------- Dashboard ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.kpi-val { font-size: 24px; font-weight: 700; color: var(--navy-dark); font-variant-numeric: tabular-nums; }
.kpi-lbl { font-size: 13px; color: var(--muted); margin-top: 4px; }
.kpi-sub { display: block; font-size: 11px; color: var(--blue-light); margin-top: 2px; }
.kpi-alert { border-color: #F0C9CE; background: #FCF4F5; }
.kpi-alert .kpi-val { color: var(--danger); }
.blok-titel { font-size: 15px; color: var(--navy); margin: 24px 0 10px; }
.dash-twee { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }

/* ---------- Bank ---------- */
.bedrag-bij { color: var(--ok); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bedrag-af { color: var(--danger); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bank-oms { color: var(--muted); font-size: 13px; max-width: 280px; }
.koppel-lijst { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.koppel-optie { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.koppel-optie:hover { background: #F4F8FB; }
.koppel-optie input { width: auto; }
.koppel-optie .match { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--ok); background: #E9F4EE; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }

/* ---------- Btw-overzicht ---------- */
.btw-table { width: 100%; border-collapse: collapse; }
.btw-table th, .btw-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); font-size: 14px; }
.btw-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); text-align: left; }
.btw-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.btw-table tr.kop td { background: #FBFCFD; font-weight: 700; color: var(--navy); font-size: 12px; text-transform: uppercase; letter-spacing: .3px; }
.btw-table tr.subtot td { font-weight: 700; color: var(--navy-dark); }
.btw-saldo { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; padding: 16px 18px; border-radius: 10px; }
.btw-saldo span { font-weight: 600; }
.btw-saldo strong { font-size: 22px; font-variant-numeric: tabular-nums; }
.btw-saldo.betalen { background: #FBEAEC; color: var(--danger); }
.btw-saldo.terug { background: #E9F4EE; color: var(--ok); }

@media (max-width: 900px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } .dash-twee { grid-template-columns: 1fr; } }
@media (max-width: 720px) {
  .form-grid { grid-template-columns: 1fr; }
  .sidebar { width: 160px; }
  .main { padding: 20px; }
}
