:root{
  --navy-950:#0A1830;
  --navy-900:#0F2244;
  --navy-700:#1D3A66;
  --emerald-600:#0E9F6E;
  --emerald-400:#34D399;
  --gold-500:#C9A24B;
  --gray-50:#F6F7F9;
  --ink-700:#33415C;
  --ink-500:#64748B;
  --line:#E8EBF0;
  --white:#FFFFFF;
  --danger:#C2483D;
  /* Plus Jakarta Sans voor koppen, Inter voor tekst en bedragen. Beide worden
   * zelf gehost in fonts.css; er gaat geen verzoek naar Google Fonts. */
  --display:'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --sans:'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --numeric:'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --radius:20px;
  --radius-sm:14px;
  --shadow-card:0 20px 44px -28px rgba(15,34,68,0.24);
  --shadow-pop:0 30px 70px -24px rgba(10,24,48,0.4);
  --safe-bottom:env(safe-area-inset-bottom, 0px);
}

*,*::before,*::after{ box-sizing:border-box; }
*{ margin:0; padding:0; }
html{ -webkit-text-size-adjust:100%; }
body{
  font-family:var(--sans);
  color:var(--ink-700);
  background:var(--gray-50);
  -webkit-font-smoothing:antialiased;
  min-height:100vh;
  /* Bookhoudcijfers staan in kolommen onder elkaar; gelijke cijferbreedtes
   * voorkomen dat bedragen verspringen. */
  font-variant-numeric:tabular-nums;
}
a{ color:inherit; text-decoration:none; }
button{ font-family:inherit; cursor:pointer; border:none; background:none; color:inherit; }
img,svg{ display:block; }
h1,h2,h3,h4{ line-height:1.2; letter-spacing:-0.02em; }
/* Koppen krijgen hetzelfde strakke, zware beeld als de merkkoppen. */
h1,h2,h3{ font-weight:700; }
[hidden]{ display:none !important; }
.sr-only{
  position:absolute; width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0;
}
:focus-visible{ outline:2px solid var(--emerald-400); outline-offset:3px; border-radius:6px; }
::selection{ background:rgba(52,211,153,0.28); }
@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{ animation-duration:.001ms !important; transition-duration:.001ms !important; scroll-behavior:auto !important; }
}

/* ---------- Buttons ---------- */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  min-height:44px; padding:11px 20px; border-radius:999px;
  font-weight:600; font-size:0.9rem; line-height:1.1;
  transition:transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
  white-space:nowrap;
}
.btn svg{ width:17px; height:17px; }
.btn-primary{
  background:linear-gradient(135deg, var(--emerald-400), var(--emerald-600));
  color:var(--navy-950);
  box-shadow:0 14px 26px -12px rgba(14,159,110,0.6);
}
.btn-primary:hover{ transform:translateY(-1px); box-shadow:0 18px 30px -10px rgba(14,159,110,0.62); }
.btn-primary:active{ transform:translateY(0); }
.btn-outline{ background:#fff; border:1px solid var(--line); color:var(--navy-900); }
.btn-outline:hover{ background:#F2F4F7; border-color:#D8DDE6; }
.btn-ghost{ color:var(--ink-500); }
.btn-ghost:hover{ color:var(--navy-900); background:#F2F4F7; }
.btn-danger{ background:rgba(194,72,61,0.08); color:var(--danger); }
.btn-danger:hover{ background:rgba(194,72,61,0.14); }
.btn-sm{ min-height:38px; padding:8px 14px; font-size:0.82rem; }
.btn-block{ width:100%; }
.btn:disabled,
.btn.is-busy{ opacity:.62; cursor:not-allowed; transform:none; box-shadow:none; }
.icon-button{
  display:inline-flex; align-items:center; justify-content:center;
  width:40px; height:40px; border-radius:50%; color:var(--ink-500);
  transition:background .18s ease, color .18s ease;
}
.icon-button:hover{ background:#F2F4F7; color:var(--navy-900); }

/* ---------- App shell ---------- */
.app-shell{ display:grid; grid-template-columns:264px minmax(0,1fr); min-height:100vh; }
.sidebar{
  background:linear-gradient(180deg, var(--navy-900), var(--navy-950));
  color:#fff; padding:28px 20px 22px;
  display:flex; flex-direction:column;
  position:sticky; top:0; height:100vh; overflow-y:auto;
}
.sidebar .logo{
  display:flex; align-items:center; gap:10px;
  font-family:var(--display); font-weight:600; font-size:1.2rem;
  margin-bottom:34px; padding:0 8px;
}
.logo-mark{
  width:28px; height:28px; border-radius:8px; flex-shrink:0;
  background:linear-gradient(135deg, var(--emerald-400), var(--emerald-600));
  position:relative; box-shadow:0 0 18px rgba(52,211,153,0.45);
}
.logo-mark::after{
  content:""; position:absolute; inset:7px; border-radius:2px; background:var(--navy-950);
  clip-path:polygon(0 100%,30% 55%,55% 75%,100% 0,100% 100%);
}
.side-company{ display:block; margin:0 8px 18px; }
.side-company select{
  width:100%; min-height:40px; padding:8px 12px; border-radius:12px;
  background:rgba(255,255,255,0.08); color:#fff; border:1px solid rgba(255,255,255,0.12);
  font-size:0.84rem;
}
.side-company select option{ color:var(--navy-900); }
.side-nav{ display:flex; flex-direction:column; gap:3px; }
.member-list{ list-style:none; display:flex; flex-direction:column; gap:10px; margin-top:8px; }
.member-row{
  display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap;
  padding:12px 14px; border:1px solid var(--line); border-radius:14px; background:#FAFBFC;
}
.member-row strong{ display:block; font-size:0.88rem; color:var(--navy-900); }
.member-row small{ color:var(--ink-500); }
.parse-note{
  margin:0 0 16px; padding:12px 14px; border-radius:14px;
  background:rgba(14,159,110,0.08); color:var(--navy-900); font-size:0.86rem; line-height:1.5;
}
.side-nav a{
  display:flex; align-items:center; gap:12px;
  padding:11px 12px; border-radius:12px;
  font-size:0.92rem; font-weight:500;
  color:rgba(255,255,255,0.62);
  transition:background .2s ease, color .2s ease;
}
.side-nav a svg{ width:18px; height:18px; flex-shrink:0; }
.side-nav a:hover{ background:rgba(255,255,255,0.06); color:#fff; }
.side-nav a.active{ background:rgba(52,211,153,0.14); color:var(--emerald-400); }
.sidebar-foot{ margin-top:auto; padding-top:18px; border-top:1px solid rgba(255,255,255,0.08); }
.side-user{ display:flex; align-items:center; gap:10px; padding:6px 8px 12px; min-width:0; }
.side-avatar{
  width:36px; height:36px; border-radius:50%; flex-shrink:0;
  display:inline-flex; align-items:center; justify-content:center;
  background:linear-gradient(135deg, var(--navy-700), var(--emerald-600));
  color:#fff; font-family:var(--numeric); font-size:0.78rem; font-weight:600;
  letter-spacing:0.02em;
}
.side-user-copy{ display:flex; flex-direction:column; min-width:0; gap:2px; }
.side-user-name{
  font-size:0.86rem; font-weight:600; color:#fff;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.side-user-role{
  font-size:0.74rem; color:rgba(255,255,255,0.48);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.side-logout{
  display:flex; align-items:center; gap:9px;
  width:100%; min-height:40px; padding:9px 12px; border-radius:10px;
  color:rgba(255,255,255,0.6); font-size:0.84rem; font-weight:500;
  transition:background .18s ease, color .18s ease;
}
.side-logout:hover{ background:rgba(255,255,255,0.06); color:#fff; }

.main{
  min-width:0; width:100%; max-width:1240px;
  padding:34px 40px 64px;
}

/* ---------- Top bar ---------- */
.topbar{
  display:flex; align-items:flex-start; justify-content:space-between;
  gap:20px; flex-wrap:wrap; margin-bottom:30px;
}
.topbar h1{
  font-family:var(--display); font-weight:700; font-size:1.75rem;
  color:var(--navy-900); letter-spacing:-0.03em;
}
.topbar-sub{ color:var(--ink-500); font-size:0.92rem; margin-top:5px; line-height:1.5; }
.topbar-actions{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }

/* ---------- Cards and panels ---------- */
.panel{
  background:#fff; border:1px solid var(--line); border-radius:var(--radius);
  box-shadow:var(--shadow-card); padding:26px; min-width:0;
}
.panel-head{
  display:flex; justify-content:space-between; align-items:center;
  gap:14px; margin-bottom:20px; flex-wrap:wrap;
}
.panel-head h2,.panel-head h3{
  font-family:var(--display); font-weight:700; font-size:1.12rem; color:var(--navy-900);
}
.panel-head a{ font-size:0.84rem; color:var(--emerald-600); font-weight:600; }
.panel-head a:hover{ text-decoration:underline; text-underline-offset:3px; }
.panel + .panel{ margin-top:24px; }
.panel-note{ color:var(--ink-500); font-size:0.9rem; line-height:1.6; }

.stat-grid{
  display:grid; grid-template-columns:repeat(4, minmax(0,1fr));
  gap:18px; margin-bottom:26px;
}
.stat-card{
  background:#fff; border-radius:var(--radius); padding:22px;
  border:1px solid var(--line); box-shadow:var(--shadow-card); min-width:0;
}
.stat-label{ font-size:0.8rem; color:var(--ink-500); margin-bottom:12px; line-height:1.4; }
.stat-value{
  font-family:var(--numeric); font-size:clamp(1.35rem, 2.1vw, 1.65rem);
  font-weight:650; color:var(--navy-900); letter-spacing:-0.02em;
  overflow-wrap:anywhere;
}
.stat-delta{ font-family:var(--sans); font-size:0.78rem; margin-top:7px; color:var(--ink-500); line-height:1.5; }
.stat-delta.up{ color:var(--emerald-600); }
.stat-delta.down{ color:var(--danger); }

.panel-grid{ display:grid; grid-template-columns:minmax(0,1.55fr) minmax(290px,1fr); gap:20px; margin-bottom:24px; }

/* ---------- Tables ---------- */
.table-wrap{ width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch; }
table{ width:100%; border-collapse:collapse; }
th{
  text-align:left; font-size:0.75rem; text-transform:uppercase; letter-spacing:0.05em;
  color:var(--ink-500); padding:0 14px 12px; font-weight:600; white-space:nowrap;
}
td{ padding:14px; font-size:0.9rem; border-top:1px solid #F1F2F5; vertical-align:middle; }
tr td:first-child, tr th:first-child{ padding-left:0; }
tr td:last-child, tr th:last-child{ padding-right:0; }
.row-name{ font-weight:600; color:var(--navy-900); }
.row-sub{ color:var(--ink-500); font-size:0.84rem; }
.amount{ font-family:var(--numeric); font-weight:600; color:var(--navy-900); white-space:nowrap; }
.cell-actions{ display:flex; gap:6px; justify-content:flex-end; flex-wrap:wrap; }
.table-link{ color:var(--emerald-600); font-weight:600; font-size:0.84rem; }
.table-link:hover{ text-decoration:underline; text-underline-offset:3px; }

/* ---------- Badges, notes, empty states ---------- */
.badge{
  display:inline-flex; align-items:center; gap:6px;
  padding:5px 11px; border-radius:999px; font-size:0.75rem; font-weight:600;
  white-space:nowrap;
}
.badge .dot{ width:6px; height:6px; border-radius:50%; background:currentColor; }
.badge.paid{ background:rgba(14,159,110,0.1); color:var(--emerald-600); }
.badge.pending{ background:rgba(201,162,75,0.16); color:#8A6A24; }
.badge.overdue{ background:rgba(194,72,61,0.1); color:var(--danger); }
.data-table tr.row-selected td{ background:rgba(14,159,110,0.06); }
.badge.credited{ background:rgba(100,116,139,0.12); color:var(--ink-500); }
.pill{
  display:inline-flex; align-items:center; gap:7px;
  padding:7px 13px; border-radius:999px;
  background:rgba(14,159,110,0.08); color:var(--emerald-600);
  font-size:0.79rem; font-weight:600;
}
.pill.muted{ background:#F2F4F7; color:var(--ink-500); }
.form-note{
  font-size:0.86rem; line-height:1.55; color:var(--ink-500);
  margin-top:14px; min-height:1.2em;
}
.form-note[data-tone="success"]{ color:var(--emerald-600); }
.form-note[data-tone="error"]{ color:var(--danger); }
.form-note[data-tone="warning"]{ color:#8A6A24; }
.empty-state{
  display:flex; flex-direction:column; align-items:center; text-align:center;
  gap:8px; padding:38px 16px;
}
.empty-icon{
  width:50px; height:50px; border-radius:16px; display:flex; align-items:center; justify-content:center;
  background:rgba(14,159,110,0.1); color:var(--emerald-600); margin-bottom:4px;
}
.empty-icon svg{ width:24px; height:24px; }
.empty-state h3{
  font-family:var(--display); font-weight:600; font-size:1.08rem; color:var(--navy-900);
}
.empty-state p{ font-size:0.88rem; color:var(--ink-500); max-width:360px; line-height:1.6; }
.empty-state .btn{ margin-top:10px; }
.alert{
  display:flex; gap:12px; align-items:flex-start;
  padding:16px 18px; border-radius:16px; font-size:0.89rem; line-height:1.55;
  background:#F2F7F5; border:1px solid rgba(14,159,110,0.16); color:var(--ink-700);
}
.alert strong{ color:var(--navy-900); }
.alert.warning{ background:#FBF6EA; border-color:rgba(201,162,75,0.26); }
.alert.danger{ background:#FBF1F0; border-color:rgba(194,72,61,0.18); }
.alert + .panel{ margin-top:24px; }

/* ---------- Forms ---------- */
.field{ margin-bottom:18px; }
.field label,.field-label{
  display:block; font-size:0.82rem; font-weight:600;
  color:var(--navy-900); margin-bottom:8px;
}
.field-group{ display:flex; flex-direction:column; gap:0; min-width:0; }
.field-control,input[type="text"],input[type="email"],input[type="password"],
input[type="tel"],input[type="date"],input[type="number"],input[type="search"],
select,textarea{
  width:100%; min-height:46px; padding:11px 14px;
  border-radius:12px; border:1px solid #E1E5EC;
  background:#fff; color:var(--ink-700);
  font-family:inherit; font-size:0.94rem; line-height:1.4;
  transition:border-color .18s ease, box-shadow .18s ease;
}
textarea{ min-height:104px; resize:vertical; }
.field-control:focus,input:focus,select:focus,textarea:focus{
  outline:none; border-color:var(--emerald-400);
  box-shadow:0 0 0 3px rgba(52,211,153,0.15);
}
.field-control:disabled,input:disabled,select:disabled{
  background:#F5F6F8; color:var(--ink-500); cursor:not-allowed;
}
.field-hint{ font-size:0.78rem; color:var(--ink-500); margin-top:6px; line-height:1.5; }
.form-grid{
  display:grid; gap:22px;
  grid-template-columns:minmax(0,0.85fr) minmax(0,1.15fr);
  align-items:start;
}
.form-card{
  background:#fff; border:1px solid var(--line); border-radius:18px;
  padding:22px; min-width:0;
}
.form-card h2,.form-card h3{
  font-family:var(--display); font-weight:600; font-size:1.05rem;
  color:var(--navy-900); margin-bottom:18px;
}
.subpanel-title{
  font-family:var(--display); font-weight:600; font-size:1.05rem;
  color:var(--navy-900); margin-bottom:16px;
}
.field-row{ display:grid; gap:18px; grid-template-columns:repeat(2, minmax(0,1fr)); }
.field-row + .field-row{ margin-top:18px; }
.form-actions{ display:flex; gap:10px; flex-wrap:wrap; align-items:center; margin-top:22px; }
.form-actions .btn{ flex:0 0 auto; }
.form-actions.end{ justify-content:flex-end; }
.summary-card{ display:grid; gap:12px; margin-top:24px; padding-top:20px; border-top:1px solid var(--line); }
.summary-row{ display:flex; justify-content:space-between; align-items:center; gap:16px; font-size:0.94rem; color:var(--ink-500); }
.summary-row strong{ color:var(--navy-900); font-family:var(--numeric); font-size:0.98rem; }
.summary-row.total{ font-size:1.06rem; font-weight:700; color:var(--navy-900); }
.summary-row.total strong{ font-size:1.16rem; }

/* ---------- Filters and search ---------- */
.list-toolbar{
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  margin-bottom:20px;
}
.filter-pills{ display:flex; gap:8px; flex-wrap:wrap; }
.filter-pill{
  min-height:40px; padding:9px 16px; border-radius:999px;
  font-size:0.84rem; font-weight:600; background:#fff;
  border:1px solid var(--line); color:var(--ink-500);
  transition:all .18s ease; white-space:nowrap;
}
.filter-pill:hover{ border-color:#D5DAE3; color:var(--navy-900); }
.filter-pill.active{ background:var(--navy-900); color:#fff; border-color:var(--navy-900); }
.search-box{ position:relative; margin-left:auto; min-width:230px; }
.search-box input{ padding:10px 16px 10px 38px; border-radius:999px; font-size:0.86rem; min-height:42px; }
.search-box svg{ position:absolute; left:14px; top:50%; transform:translateY(-50%); color:var(--ink-500); }

/* ---------- Dashboard chart and lists ---------- */
.chart-wrap{ height:230px; position:relative; }
.chart-wrap svg{ width:100%; height:100%; overflow:visible; }
.mini-list{ display:flex; flex-direction:column; }
.mini-item{
  display:flex; align-items:center; gap:12px;
  padding:13px 0; border-top:1px solid #F1F2F5;
}
.mini-item:first-child{ border-top:0; padding-top:0; }
.mini-item:last-child{ padding-bottom:0; }
.mini-icon{
  width:38px; height:38px; border-radius:12px; flex-shrink:0;
  background:var(--gray-50); display:flex; align-items:center; justify-content:center;
  color:var(--emerald-600);
}
.mini-info{ flex:1; min-width:0; }
.mini-info .name{ display:block; font-size:0.88rem; font-weight:600; color:var(--navy-900); }
.mini-info .meta{ display:block; font-size:0.78rem; color:var(--ink-500); margin-top:2px; }
.mini-side{ text-align:right; display:flex; flex-direction:column; align-items:flex-end; gap:3px; }
.mini-amount{ font-family:var(--numeric); font-weight:600; font-size:0.88rem; color:var(--navy-900); }
.mini-side small{ font-size:0.72rem; color:var(--ink-500); }
.quick-actions{ display:flex; gap:10px; flex-wrap:wrap; }

/* ---------- Invoice lines ---------- */
.line-table{ width:100%; border-collapse:collapse; }
.line-table th{ padding:0 10px 12px; }
.line-table td{
  padding:10px 10px; border-top:0; border-bottom:1px solid #EEF0F4;
  vertical-align:top; font-size:0.9rem;
}
.line-table th:first-child,.line-table td:first-child{ padding-left:0; }
.line-table th:last-child,.line-table td:last-child{ padding-right:0; }
.line-table .field-control{ min-height:42px; padding:9px 11px; font-size:0.88rem; }
.line-table .line-total{
  font-family:var(--numeric); font-weight:600; color:var(--navy-900);
  white-space:nowrap; padding-top:20px;
}
.line-remove{
  width:38px; height:38px; border-radius:10px; color:var(--ink-500);
  display:inline-flex; align-items:center; justify-content:center;
}
.line-remove:hover{ background:rgba(194,72,61,0.08); color:var(--danger); }
.line-index{ display:none; }

/* ---------- Invoice detail modal ---------- */
dialog.modal{
  border:0; padding:0; width:min(560px, calc(100vw - 32px));
  max-height:calc(100vh - 40px); border-radius:22px; overflow:auto;
  box-shadow:var(--shadow-pop); color:var(--ink-700); background:#fff;
  margin:auto; inset:0;
}
dialog.modal::backdrop{ background:rgba(10,24,48,0.55); backdrop-filter:blur(3px); }
.modal-head{
  display:flex; align-items:flex-start; justify-content:space-between; gap:16px;
  padding:24px 24px 0;
}
.modal-head h2{
  font-family:var(--display); font-weight:700; font-size:1.3rem; color:var(--navy-900); letter-spacing:-0.025em;
}
.modal-sub{ font-size:0.85rem; color:var(--ink-500); margin-top:4px; }
.modal-body{ padding:20px 24px 26px; }
.modal-body + .modal-foot{ padding-top:0; }
.modal-foot{
  display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-end;
  padding:0 24px 24px;
}
.detail-grid{ display:grid; gap:14px; grid-template-columns:repeat(2, minmax(0,1fr)); margin-bottom:20px; }
.detail-label{ font-size:0.74rem; text-transform:uppercase; letter-spacing:0.05em; color:var(--ink-500); margin-bottom:4px; }
.detail-value{ font-size:0.92rem; color:var(--navy-900); font-weight:500; }
.detail-value.mono{ font-family:var(--numeric); font-weight:600; }
.detail-lines{ width:100%; }
.detail-lines th{ font-size:0.72rem; }
.detail-lines td{ font-size:0.86rem; padding:11px 8px; }
.detail-lines th:first-child{ padding-left:0; }
.detail-lines td:first-child{ padding-left:0; }
.detail-lines .num{ text-align:right; white-space:nowrap; }

/* ---------- Receipts ---------- */
.receipt-grid{
  display:grid; gap:18px;
  grid-template-columns:repeat(auto-fill, minmax(240px, 1fr));
}
.receipt-card{
  display:flex; flex-direction:column; background:#fff;
  border:1px solid var(--line); border-radius:18px;
  box-shadow:var(--shadow-card); overflow:hidden; min-width:0;
}
.receipt-thumb{
  aspect-ratio:16/10; width:100%; background:linear-gradient(135deg,#0F2244,#0A1830);
  display:flex; align-items:center; justify-content:center; overflow:hidden; position:relative;
}
.receipt-thumb img{ width:100%; height:100%; object-fit:cover; }
.receipt-thumb svg{ width:34px; height:34px; color:rgba(255,255,255,0.55); }
.receipt-body{ padding:16px 18px 18px; display:flex; flex-direction:column; gap:6px; flex:1; }
.receipt-vendor{ font-family:var(--display); font-size:1.02rem; font-weight:600; color:var(--navy-900); }
.receipt-meta{ font-size:0.8rem; color:var(--ink-500); }
.receipt-amount{ font-family:var(--numeric); font-weight:600; font-size:1.02rem; color:var(--navy-900); margin-top:2px; }
.receipt-foot{ display:flex; align-items:center; justify-content:space-between; gap:8px; margin-top:auto; padding-top:12px; }
.receipt-tag{
  display:inline-flex; padding:5px 10px; border-radius:999px;
  background:rgba(14,159,110,0.08); color:var(--emerald-600);
  font-size:0.72rem; font-weight:600;
}
.upload-panel{ display:grid; gap:22px; grid-template-columns:minmax(0,1.1fr) minmax(0,1fr); }
.upload-dropzone{
  border:2px dashed rgba(14,159,110,0.36);
  background:rgba(14,159,110,0.04);
  border-radius:20px; padding:30px 22px; text-align:center;
  color:var(--ink-500); transition:background .18s ease, border-color .18s ease;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px;
  min-height:190px; cursor:pointer;
}
.upload-dropzone:hover,.upload-dropzone:focus-visible,.upload-dropzone.dragging{
  background:rgba(14,159,110,0.09); border-color:var(--emerald-400);
}
.upload-dropzone strong{ color:var(--navy-900); font-size:0.96rem; }
.upload-dropzone span{ font-size:0.84rem; line-height:1.55; max-width:300px; }
.upload-dropzone .upload-icon{
  width:46px; height:46px; border-radius:14px; background:#fff;
  display:flex; align-items:center; justify-content:center; color:var(--emerald-600);
  box-shadow:0 10px 22px -14px rgba(15,34,68,0.4); margin-bottom:2px;
}
.file-chip{
  display:none; align-items:center; gap:8px; max-width:100%;
  padding:8px 12px; border-radius:999px; background:#fff; border:1px solid var(--line);
  font-size:0.8rem; color:var(--navy-900);
}
.file-chip.visible{ display:inline-flex; }
.file-chip span{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:220px; }

/* ---------- VAT ---------- */
.metric-grid{ display:grid; gap:18px; grid-template-columns:repeat(3, minmax(0,1fr)); margin-bottom:24px; }
.metric-card{
  background:#fff; border:1px solid var(--line); border-radius:var(--radius);
  padding:22px; box-shadow:var(--shadow-card); min-width:0;
}
.metric-card.accent{ background:linear-gradient(135deg, rgba(14,159,110,0.12), #fff); }
.metric-card .metric-label{ font-size:0.8rem; color:var(--ink-500); margin-bottom:10px; }
.metric-card .metric-value{
  font-family:var(--numeric); font-size:clamp(1.4rem,2.2vw,1.8rem);
  font-weight:700; color:var(--navy-900); overflow-wrap:anywhere;
}
.metric-card .metric-meta{ font-size:0.8rem; color:var(--ink-500); margin-top:8px; line-height:1.5; }
.rate-list{ display:flex; flex-direction:column; gap:10px; }
.rate-row{
  display:flex; justify-content:space-between; gap:14px;
  font-size:0.88rem; padding:10px 0; border-top:1px solid #F1F2F5;
}
.rate-row:first-child{ border-top:0; padding-top:0; }
.rate-row .rate-name{ color:var(--ink-500); }
.rate-row .rate-value{ font-family:var(--numeric); font-weight:600; color:var(--navy-900); }
.vat-disclaimer{ font-size:0.82rem; color:var(--ink-500); line-height:1.65; margin-top:16px; }
.status-ok{ color:var(--emerald-600); font-weight:600; }
.status-concept{ color:#8A6A24; font-weight:600; }

/* ---------- Settings ---------- */
.settings-grid{ display:grid; gap:22px; grid-template-columns:repeat(2, minmax(0,1fr)); align-items:start; }
.settings-card{
  background:#fff; border:1px solid var(--line); border-radius:22px;
  padding:26px; box-shadow:var(--shadow-card); min-width:0;
}
.settings-card.wide{ grid-column:1 / -1; }
.settings-card h2{
  font-family:var(--display); font-weight:600; font-size:1.12rem;
  color:var(--navy-900); margin-bottom:6px;
}
.settings-card > p{ color:var(--ink-500); font-size:0.88rem; line-height:1.6; margin-bottom:20px; }
.settings-head{ display:flex; align-items:center; gap:16px; margin-bottom:22px; }
.settings-head h2{ margin-bottom:3px; }
.settings-avatar{
  width:56px; height:56px; border-radius:16px; flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
  background:linear-gradient(135deg,var(--emerald-400),var(--emerald-600));
  color:#fff; font-family:var(--numeric); font-weight:700; font-size:1rem;
}
.toggle-list{ display:flex; flex-direction:column; gap:10px; }
.toggle-item{
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  padding:14px 16px; border:1px solid var(--line); border-radius:16px; background:#FAFBFC;
}
.toggle-item strong{ display:block; font-size:0.88rem; color:var(--navy-900); font-weight:600; }
.toggle-item small{ display:block; font-size:0.78rem; color:var(--ink-500); margin-top:2px; line-height:1.45; }
.switch{ position:relative; flex-shrink:0; width:48px; height:28px; display:inline-block; }
.switch input{ position:absolute; opacity:0; width:100%; height:100%; margin:0; cursor:pointer; z-index:2; }
.switch-track{
  position:absolute; inset:0; border-radius:999px; background:#DDE2E9;
  transition:background .2s ease;
}
.switch-track::after{
  content:""; position:absolute; width:20px; height:20px; left:4px; top:4px;
  border-radius:50%; background:#fff; transition:transform .2s ease;
  box-shadow:0 2px 5px rgba(10,24,48,0.2);
}
.switch input:checked + .switch-track{ background:linear-gradient(135deg,var(--emerald-400),var(--emerald-600)); }
.switch input:checked + .switch-track::after{ transform:translateX(20px); }
.switch input:focus-visible + .switch-track{ outline:2px solid var(--emerald-400); outline-offset:3px; }
.account-row{ display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; }
.account-row .row-sub{ margin-top:3px; }

/* ---------- Auth ---------- */
body:has(.auth-shell){
  background:#fff;
  min-height:100vh;
  min-height:100dvh;
}
.auth-shell{
  min-height:100vh; min-height:100dvh;
  height:100vh; height:100dvh;
  display:grid;
  grid-template-columns:minmax(0,1.05fr) minmax(min(100%, 400px), 0.95fr);
  grid-template-rows:minmax(0,1fr);
  overflow:hidden;
}
.auth-visual{
  background:radial-gradient(120% 100% at 15% 0%, #123058 0%, var(--navy-950) 55%, #060F20 100%);
  padding:48px 56px 40px; display:flex; flex-direction:column; justify-content:space-between;
  color:#fff; position:relative; overflow:hidden; min-height:0;
}
.auth-visual::before{
  content:""; position:absolute; inset:0;
  background-image:
    radial-gradient(640px 320px at 88% 8%, rgba(52,211,153,0.18), transparent 58%),
    radial-gradient(480px 280px at 0% 100%, rgba(201,162,75,0.08), transparent 55%);
  pointer-events:none;
}
.auth-visual::after{
  content:""; position:absolute; top:-80px; right:-60px; width:280px; height:280px;
  border:1px solid rgba(255,255,255,0.06); border-radius:48px; transform:rotate(18deg);
  pointer-events:none;
}
.auth-visual .logo{
  position:relative; z-index:1;
  font-family:var(--display); font-size:1.15rem; font-weight:600;
  display:inline-flex; align-items:center; gap:10px; color:#fff; width:fit-content;
}
.auth-visual-body{ position:relative; z-index:1; max-width:440px; flex:1 1 auto; min-height:0; }
.auth-kicker{
  display:inline-flex; align-items:center; gap:8px;
  font-size:0.72rem; font-weight:600; letter-spacing:0.14em; text-transform:uppercase;
  color:var(--emerald-400); margin-bottom:22px;
}
.auth-kicker::before{
  content:""; width:18px; height:1.5px; background:var(--emerald-400); border-radius:999px;
}
.auth-quote{
  margin:0;
  font-family:var(--display); font-style:normal; font-weight:600;
  font-size:clamp(1.55rem, 2.3vw, 2.05rem); line-height:1.28; letter-spacing:-0.035em;
  color:#fff; position:relative;
}
.auth-quote p{ margin:0; }
.auth-quote-author{
  margin-top:22px; font-family:var(--sans); font-style:normal; font-weight:500;
  font-size:0.88rem; color:rgba(255,255,255,0.55); letter-spacing:0;
}
.auth-points{
  list-style:none; margin:32px 0 0; padding:0;
  display:flex; flex-direction:column; gap:12px;
}
.auth-points li{
  display:flex; align-items:flex-start; gap:10px;
  font-size:0.9rem; line-height:1.45; color:rgba(255,255,255,0.72);
}
.auth-points li svg{
  flex-shrink:0; width:18px; height:18px; margin-top:2px; color:var(--emerald-400);
}
.auth-visual-foot{
  position:relative; z-index:1;
  display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap;
  font-family:var(--numeric); font-size:0.75rem; color:rgba(255,255,255,0.5);
  padding-top:22px; border-top:1px solid rgba(255,255,255,0.08);
}
.auth-form-wrap{
  display:flex; justify-content:center;
  padding:48px 40px; min-height:0; overflow-y:auto;
  background:#FAFBFC;
}
.auth-form{ width:100%; max-width:400px; margin-block:auto; }
.auth-brand{ display:none; align-items:center; gap:10px; font-family:var(--display); font-weight:600; font-size:1.15rem; margin-bottom:30px; color:var(--navy-900); }
.auth-form h1,.auth-form h2{
  font-family:var(--display); font-weight:700; font-size:1.85rem;
  letter-spacing:-0.03em;
  color:var(--navy-900); margin-bottom:8px;
}
.auth-form p.sub{ color:var(--ink-500); font-size:0.92rem; line-height:1.6; margin-bottom:28px; }
.auth-form .field-control{ background:#fff; }
.auth-submit{
  width:100%; min-height:48px; padding:13px; border-radius:999px;
  background:linear-gradient(135deg, var(--emerald-400), var(--emerald-600));
  color:var(--navy-950); font-weight:700; font-size:0.95rem; margin-top:8px;
  box-shadow:0 14px 30px -12px rgba(14,159,110,0.55);
  transition:transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}
.auth-submit:hover{ transform:translateY(-1px); }
.auth-submit:disabled{ opacity:.65; transform:none; cursor:not-allowed; }
.auth-alt{ text-align:center; margin-top:22px; font-size:0.88rem; color:var(--ink-500); line-height:1.6; }
.auth-alt a{ color:var(--emerald-600); font-weight:600; }
.auth-note{ text-align:center; margin-top:14px; font-size:0.82rem; color:var(--ink-500); line-height:1.55; }
.auth-note[data-tone="error"]{ color:var(--danger); }
.progress-row{ display:flex; gap:8px; flex-wrap:wrap; margin-bottom:26px; }
.progress-pill{
  display:inline-flex; align-items:center; padding:8px 14px; border-radius:999px;
  background:#F2F4F7; color:var(--ink-500); font-size:0.8rem; font-weight:600;
}
.progress-pill.active{
  background:linear-gradient(135deg, rgba(52,211,153,0.16), rgba(14,159,110,0.08));
  color:var(--emerald-600);
}
.step-pane{ display:none; }
.step-pane.active{ display:block; }
.auth-step-actions{ display:flex; gap:10px; margin-top:24px; }
.auth-step-actions .btn{ flex:1; }
.auth-foot{ margin-top:34px; font-size:0.78rem; line-height:1.55; color:var(--ink-500); text-align:center; }

/* ---------- Mobile shell ---------- */
.mobile-bar,.mobile-tabs,.more-sheet,.sheet-backdrop{ display:none; }
.mobile-bar{
  display:none;
  position:fixed; top:0; left:0; right:0; height:62px; z-index:60;
  align-items:center; justify-content:space-between; gap:12px;
  padding:0 18px;
  background:rgba(10,24,48,0.98);
  color:#fff;
  border-bottom:1px solid rgba(255,255,255,0.07);
}
.mobile-brand{
  display:flex; align-items:center; gap:9px;
  font-family:var(--display); font-size:1.08rem; font-weight:600;
}
.mobile-avatar{
  width:38px; height:38px; border-radius:50%;
  display:inline-flex; align-items:center; justify-content:center;
  background:linear-gradient(135deg, var(--navy-700), var(--emerald-600));
  color:#fff; font-family:var(--numeric); font-size:0.76rem; font-weight:600;
}
.mobile-tabs{
  display:none;
  position:fixed; bottom:0; left:0; right:0; z-index:60;
  height:calc(66px + var(--safe-bottom));
  padding:6px 8px calc(6px + var(--safe-bottom));
  background:rgba(255,255,255,0.97);
  backdrop-filter:blur(16px);
  border-top:1px solid var(--line);
  grid-template-columns:repeat(5, minmax(0,1fr));
  box-shadow:0 -12px 30px -24px rgba(10,24,48,0.5);
}
.mobile-tab{
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px;
  color:var(--ink-500); font-size:0.66rem; font-weight:600;
  border-radius:12px; padding:4px; min-width:0;
  transition:color .18s ease, background .18s ease;
}
.mobile-tab svg{ width:21px; height:21px; }
.mobile-tab span{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:100%; }
.mobile-tab.active{ color:var(--emerald-600); }
.mobile-tab.active svg{ filter:drop-shadow(0 3px 7px rgba(14,159,110,0.28)); }
.sheet-backdrop{
  position:fixed; inset:0; z-index:70;
  background:rgba(10,24,48,0.45); opacity:0; transition:opacity .18s ease;
}
.sheet-backdrop.open{ display:block; opacity:1; }
.more-sheet{
  display:none;
  position:fixed; left:10px; right:10px; z-index:71;
  bottom:calc(74px + var(--safe-bottom));
  background:#fff; border-radius:22px;
  box-shadow:var(--shadow-pop);
  padding:8px 12px 14px;
  max-height:min(72vh, 560px); overflow-y:auto;
  transform:translateY(18px) scale(.985); opacity:0;
  transition:transform .2s ease, opacity .2s ease;
}
.more-sheet.open{ display:block; transform:translateY(0) scale(1); opacity:1; }
.sheet-grabber{ width:38px; height:4px; border-radius:999px; background:#E1E5EC; margin:6px auto 10px; }
.sheet-head{ display:flex; align-items:center; justify-content:space-between; padding:0 6px 8px; }
.sheet-head strong{ font-family:var(--display); color:var(--navy-900); font-size:1rem; }
.sheet-links{ display:flex; flex-direction:column; gap:2px; }
.sheet-link{
  display:flex; align-items:center; gap:12px;
  min-height:46px; padding:10px 12px; border-radius:12px;
  font-size:0.92rem; font-weight:500; color:var(--ink-700);
}
.sheet-link svg{ width:19px; height:19px; color:var(--ink-500); }
.sheet-link.active{ background:rgba(14,159,110,0.08); color:var(--emerald-600); }
.sheet-link.active svg{ color:var(--emerald-600); }
.sheet-account{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  margin-top:10px; padding:14px 8px 4px; border-top:1px solid var(--line);
}
.sheet-user{ display:flex; align-items:center; gap:10px; min-width:0; }
.sheet-user > span:last-child{ display:flex; flex-direction:column; min-width:0; }
.sheet-user-name{ font-size:0.86rem; font-weight:600; color:var(--navy-900); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sheet-user-mail{ font-size:0.76rem; color:var(--ink-500); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sheet-logout{ color:var(--danger); font-size:0.84rem; font-weight:600; padding:10px; }
body.sheet-open{ overflow:hidden; }

/* ---------- Responsive ---------- */
@media (max-height: 760px){
  .auth-visual{ padding:36px 40px 28px; }
  .auth-kicker{ margin-bottom:14px; }
  .auth-quote{ font-size:1.4rem; }
  .auth-points{ margin-top:18px; gap:8px; }
  .auth-form-wrap{ padding-top:32px; padding-bottom:32px; }
}

@media (max-width: 1180px){
  .main{ padding:30px 28px 56px; }
  .stat-grid{ grid-template-columns:repeat(2, minmax(0,1fr)); }
  .panel-grid{ grid-template-columns:1fr; }
}

@media (max-width: 980px){
  .app-shell{ display:block; }
  .sidebar{ display:none; }
  .mobile-bar{ display:flex; }
  .mobile-tabs{ display:grid; }
  .main{
    max-width:none;
    padding:calc(62px + 24px) 22px calc(88px + var(--safe-bottom));
  }
  .topbar{ margin-bottom:24px; }
  .topbar h1{ font-size:1.5rem; }
  .topbar-actions{ width:100%; }
  .topbar-actions .btn{ flex:0 1 auto; }
  .form-grid,.upload-panel,.settings-grid{ grid-template-columns:1fr; }
  .settings-card.wide{ grid-column:auto; }
  .metric-grid{ grid-template-columns:repeat(2, minmax(0,1fr)); }
  .auth-shell{ grid-template-columns:minmax(0,1fr) minmax(min(100%, 360px), 0.9fr); }
  .auth-visual{ padding:36px 32px 28px; }
  .auth-form-wrap{ padding:36px 28px; }
}

@media (max-width: 760px){
  .main{ padding-left:18px; padding-right:18px; }
  .panel{ padding:20px; border-radius:18px; }
  .stat-grid{ gap:12px; }
  .stat-card{ padding:18px; border-radius:18px; }
  .filter-pill{ min-height:38px; padding:8px 13px; font-size:0.8rem; }
  .search-box{ margin-left:0; width:100%; min-width:0; }
  .list-toolbar{ gap:10px; }
  .filter-pills{ width:100%; flex-wrap:wrap; }
  .metric-grid{ grid-template-columns:1fr; }
  .field-row{ grid-template-columns:1fr; }
  .field-row + .field-row{ margin-top:18px; }
  .detail-grid{ grid-template-columns:1fr; gap:12px; }
  .topbar h1{ font-size:1.4rem; }
  .panel-head h2,.panel-head h3{ font-size:1.04rem; }
  .chart-wrap{ height:200px; }

  /* Tables become readable cards on small screens. */
  .data-table{ min-width:0; }
  .data-table thead{ display:none; }
  .data-table tbody{ display:flex; flex-direction:column; }
  .data-table tr{
    display:grid; grid-template-columns:minmax(0,1fr);
    gap:8px; padding:16px 0; border-top:1px solid #F1F2F5;
  }
  .data-table tr:first-child{ border-top:0; padding-top:0; }
  .data-table td{
    display:flex; align-items:baseline; justify-content:space-between; gap:16px;
    padding:0; border:0; font-size:0.88rem; text-align:right; min-width:0;
  }
  .data-table td::before{
    content:attr(data-label); flex:0 0 auto;
    color:var(--ink-500); font-size:0.72rem; font-weight:600;
    text-transform:uppercase; letter-spacing:0.04em; text-align:left;
  }
  .data-table td:first-child{
    justify-content:flex-start; font-size:1rem; font-weight:600;
    color:var(--navy-900); padding-bottom:2px;
  }
  .data-table td:first-child::before{ display:none; }
  .data-table td.cell-actions{ grid-column:1 / -1; justify-content:flex-start; padding-top:6px; }
  .data-table td.cell-actions::before{ display:none; }
  .data-table tr.empty-row{ display:block; padding:0; border:0; }
  .data-table tr.empty-row td{ display:block; padding:0; text-align:center; }
  .data-table tr.empty-row td::before{ display:none; }
  .data-table .amount{ font-size:0.92rem; }

  /* Invoice line editor becomes a stack of cards. */
  .line-table thead{ display:none; }
  .line-table,.line-table tbody{ display:block; width:100%; }
  .line-table tr{
    display:grid; grid-template-columns:repeat(2, minmax(0,1fr));
    gap:12px; padding:16px; margin-bottom:12px;
    border:1px solid var(--line); border-radius:16px; background:#FAFBFC;
  }
  .line-table td{ display:flex; flex-direction:column; gap:6px; padding:0; border:0; }
  .line-table td::before{
    content:attr(data-label); font-size:0.72rem; font-weight:600;
    text-transform:uppercase; letter-spacing:0.04em; color:var(--ink-500);
  }
  .line-table td:first-child,.line-table td:last-child{ grid-column:1 / -1; }
  .line-table td.line-total{ padding-top:0; font-size:1rem; flex-direction:row; justify-content:space-between; align-items:center; }
  .line-table td.line-action{ align-items:flex-end; }
  .line-table .line-total::before{ margin-bottom:0; }
  .line-table tr .line-action::before{ display:none; }

  .receipt-grid{ grid-template-columns:repeat(auto-fill, minmax(200px, 1fr)); }
  .modal{ width:calc(100vw - 20px); }
  .modal-head,.modal-body{ padding-left:20px; padding-right:20px; }
  .modal-foot{ padding-left:20px; padding-right:20px; padding-bottom:20px; }

  .auth-shell{
    grid-template-columns:1fr;
    height:auto; overflow:visible;
    grid-template-rows:auto;
  }
  .auth-visual{ display:none; }
  .auth-brand{ display:flex; margin-bottom:24px; }
  .auth-form-wrap{
    padding:36px 24px; min-height:100vh; min-height:100dvh;
    background:var(--gray-50);
  }
  .auth-form{ max-width:420px; margin:0 auto; }
}

@media (max-width: 600px){
  .mobile-bar{ padding:0 16px; }
  .main{ padding:calc(62px + 20px) 16px calc(86px + var(--safe-bottom)); }
  .topbar{ gap:14px; }
  .topbar h1{ font-size:1.32rem; }
  .topbar-sub{ font-size:0.86rem; }
  .topbar-actions{ gap:8px; }
  .topbar-actions .btn{ flex:1 1 auto; }
  .stat-grid{ grid-template-columns:1fr; }
  .stat-value{ font-size:1.55rem; }
  .panel{ padding:18px; }
  .form-card{ padding:18px; }
  .settings-card{ padding:20px; }
  .settings-head{ align-items:flex-start; }
  .summary-row{ font-size:0.9rem; }
  .summary-row.total{ font-size:1rem; }
  .form-actions{ flex-direction:column-reverse; align-items:stretch; }
  .form-actions .btn{ width:100%; }
  .form-actions.end{ flex-direction:column-reverse; }
  .modal-foot{ flex-direction:column-reverse; }
  .modal-foot .btn{ width:100%; }
  .detail-lines th:nth-child(2),.detail-lines td:nth-child(2),
  .detail-lines th:nth-child(3),.detail-lines td:nth-child(3){ display:none; }
  .receipt-grid{ grid-template-columns:1fr; }
  .receipt-thumb{ aspect-ratio:2.1/1; }
  .field-control,input,select,textarea{ font-size:16px; }
  dialog.modal{
    position:fixed; left:0; right:0; bottom:0; top:auto;
    width:100%; max-width:none; max-height:88vh;
    margin:0; border-radius:24px 24px 0 0;
  }
  .modal-head{ padding-top:20px; }
  .modal-foot{ padding-bottom:calc(20px + var(--safe-bottom)); }
  .auth-form-wrap{ padding:32px 20px; }
  .auth-form h1,.auth-form h2{ font-size:1.6rem; }
  .progress-pill{ font-size:0.76rem; padding:7px 11px; }
  .account-row{ align-items:flex-start; }
  .alert{ padding:14px; }
}

@media (max-width: 380px){
  .mobile-tab span{ font-size:0.62rem; }
  .side-user-name{ font-size:0.82rem; }
  .topbar-actions .btn{ padding:10px 14px; font-size:0.84rem; }
  .line-table tr{ grid-template-columns:1fr; }
  .line-table td:first-child,.line-table td:last-child{ grid-column:auto; }
}

@media print{
  .sidebar,.mobile-bar,.mobile-tabs,.more-sheet,.sheet-backdrop,.topbar-actions{ display:none !important; }
  .app-shell{ display:block; }
  .main{ padding:0; max-width:none; }
  .panel,.stat-card{ box-shadow:none; border-color:#DDD; }
}

/* ---------- Productie-uitbreidingen ---------- */
.modal-foot{ flex-wrap:wrap; gap:10px; }
.modal-foot .btn{ flex:0 0 auto; }

.auth-shell.single{
  grid-template-columns:1fr;
  height:auto; overflow:visible;
  grid-template-rows:auto;
}
.auth-shell.single .auth-form-wrap{ min-height:100vh; min-height:100dvh; }
.field-hint a{ color:var(--emerald-600); font-weight:600; }
.field-control:disabled{ background:#F2F4F7; color:var(--ink-500); cursor:not-allowed; }
textarea.field-control{ min-height:88px; resize:vertical; line-height:1.55; }

.consent-row{
  display:flex; gap:12px; align-items:flex-start; margin-top:20px;
  font-size:0.84rem; line-height:1.6; color:var(--ink-500);
}
.consent-row input{ width:20px; height:20px; margin-top:2px; accent-color:var(--emerald-600); flex:0 0 auto; }
.consent-row a{ color:var(--emerald-600); font-weight:600; }

.verify-state{
  display:flex; align-items:center; gap:12px; margin:22px 0;
  padding:16px 18px; border-radius:var(--radius-sm);
  background:var(--gray-50); border:1px solid var(--line);
  font-size:0.9rem; color:var(--ink-700); line-height:1.6;
}
.verify-state.success{ background:#EFFAF4; border-color:rgba(14,159,110,0.24); }
.verify-state.warning{ background:#FBF6EA; border-color:rgba(201,162,75,0.26); }
.verify-state.error{ background:#FBF1F0; border-color:rgba(194,72,61,0.2); }
.spinner{
  width:18px; height:18px; flex:0 0 auto; border-radius:50%;
  border:2px solid var(--line); border-top-color:var(--emerald-600);
  animation:spin 0.9s linear infinite;
}
@keyframes spin{ to{ transform:rotate(360deg); } }

.section-title{ font-size:0.95rem; color:var(--navy-900); margin:26px 0 12px; }
.settings-card.danger{ border-color:rgba(194,72,61,0.28); background:#FFFDFC; }
.settings-card.danger h2{ color:var(--danger); }

.activity-list{ list-style:none; display:grid; gap:2px; }
.activity-list li{
  display:flex; justify-content:space-between; gap:14px; align-items:baseline;
  padding:11px 2px; border-bottom:1px solid var(--line); font-size:0.86rem; color:var(--ink-700);
}
.activity-list li:last-child{ border-bottom:none; }
.activity-list time{ color:var(--ink-500); font-size:0.78rem; white-space:nowrap; }
.activity-list .muted{ color:var(--ink-500); font-size:0.84rem; }

.legal-links{ display:flex; flex-wrap:wrap; gap:6px 18px; margin-top:24px; font-size:0.83rem; }
.legal-links a{ color:var(--emerald-600); font-weight:600; }

.side-legal{ display:flex; flex-wrap:wrap; gap:4px 12px; margin-top:18px; font-size:0.72rem; }
.side-legal a{ color:rgba(255,255,255,0.42); }
.side-legal a:hover{ color:rgba(255,255,255,0.78); }
.side-install,.sheet-install{
  display:block; width:100%; margin-top:12px; padding:11px 14px;
  border-radius:var(--radius-sm); border:1px dashed rgba(255,255,255,0.28);
  color:rgba(255,255,255,0.82); font-size:0.8rem; font-weight:600; text-align:center;
}
.side-install:hover,.sheet-install:hover{ border-color:var(--emerald-400); color:var(--white); }
.sheet-install{ border-color:var(--line); color:var(--navy-900); }
.sheet-install:hover{ border-color:var(--emerald-600); color:var(--navy-950); }

/* ---------- Juridische pagina's ---------- */
.legal-shell{ max-width:820px; margin:0 auto; padding:32px 24px 64px; }
.legal-top{ display:flex; flex-wrap:wrap; gap:16px; align-items:center; justify-content:space-between; margin-bottom:28px; }
.legal-top .logo{ color:var(--navy-900); display:inline-flex; align-items:center; gap:10px; font-family:var(--display); font-size:1.25rem; font-weight:600; }
.legal-top .logo-mark{ background:var(--navy-900); }
/* Op de lichte juridische pagina's is navy-op-navy onzichtbaar; het beeldmerk
 * krijgt daar een wit pijltje, net als in de donkere zijbalk. */
.legal-top .logo-mark::after{ background:var(--white); }
.legal-nav{ display:flex; flex-wrap:wrap; gap:8px 18px; align-items:center; font-size:0.86rem; }
.legal-nav a{ color:var(--ink-500); font-weight:600; }
.legal-nav a[aria-current="page"]{ color:var(--navy-900); }
.legal-body{
  background:var(--white); border:1px solid var(--line); border-radius:var(--radius);
  padding:38px 34px; box-shadow:var(--shadow-card);
}
.legal-body h1{ font-family:var(--display); font-size:1.9rem; font-weight:700; color:var(--navy-900); margin-bottom:14px; letter-spacing:-0.03em; }
.legal-body h2{ font-family:var(--display); font-size:1.18rem; font-weight:700; color:var(--navy-900); margin:32px 0 12px; letter-spacing:-0.015em; }
.legal-body p,.legal-body li{ font-size:0.94rem; line-height:1.75; color:var(--ink-700); }
.legal-body p + p{ margin-top:12px; }
.legal-body ul{ margin:12px 0 0 20px; display:grid; gap:8px; }
.legal-body a{ color:var(--emerald-600); font-weight:600; text-decoration:underline; }
.legal-lead{ font-size:1rem; color:var(--ink-500); }
.legal-concept{
  margin-bottom:24px; padding:14px 16px; border-radius:var(--radius-sm);
  background:#FBF6EA; border:1px solid rgba(201,162,75,0.26);
  font-size:0.84rem; line-height:1.6; color:var(--ink-700);
}
.legal-foot{
  display:flex; flex-wrap:wrap; gap:10px; justify-content:space-between;
  margin-top:28px; font-size:0.8rem; color:var(--ink-500);
}
.legal-foot a{ color:var(--ink-500); font-weight:600; }

@media (max-width: 620px){
  .legal-shell{ padding:22px 16px 48px; }
  .legal-body{ padding:26px 20px; border-radius:var(--radius-sm); }
  .legal-body h1{ font-size:1.5rem; }
  .legal-nav{ font-size:0.8rem; gap:6px 14px; }
  .modal-foot{ flex-direction:column-reverse; }
  .modal-foot .btn{ width:100%; }
}

@media print{
  .legal-top,.legal-foot,.legal-nav{ display:none !important; }
  .legal-body{ border:none; box-shadow:none; padding:0; }
}

/* Mobiel: invoervelden op 16px voorkomt dat iOS Safari inzoomt bij focus.
   De losse attribuutselectors zijn nodig omdat de basisregel bovenaan het
   bestand een hogere specificiteit heeft (input[type="text"]). */
@media (max-width: 600px){
  .field-control,
  .line-table .field-control,
  input,
  select,
  textarea,
  input[type="text"], input[type="email"], input[type="password"], input[type="tel"],
  input[type="date"], input[type="number"], input[type="search"]{
    font-size:16px;
  }
  /* Groter tikdoel (44px) voor de schakelaars zonder het uiterlijk te wijzigen. */
  .switch input{ height:44px; top:50%; transform:translateY(-50%); }
}
