/* AdminZorg – huisstijl (kleuren uit het logo, lettertype Metropolis zoals adminzorg.be) */

@font-face { font-family: "Metropolis"; font-weight: 300; font-display: swap; src: url("/fonts/metropolis-300.woff2") format("woff2"); }
@font-face { font-family: "Metropolis"; font-weight: 400; font-display: swap; src: url("/fonts/metropolis-400.woff2") format("woff2"); }
@font-face { font-family: "Metropolis"; font-weight: 500; font-display: swap; src: url("/fonts/metropolis-500.woff2") format("woff2"); }
@font-face { font-family: "Metropolis"; font-weight: 600; font-display: swap; src: url("/fonts/metropolis-600.woff2") format("woff2"); }
@font-face { font-family: "Metropolis"; font-weight: 700; font-display: swap; src: url("/fonts/metropolis-700.woff2") format("woff2"); }

:root {
  --brand-dark: #025b59;
  --brand: #077474;
  --brand-light: #64a49f;
  --brand-soft: #eaf4f2;
  --brand-mist: #f3f8f7;
  --ink: #213a43;
  --text: #2c444c;
  --muted: #64868e;
  --line: #dfe9e7;
  --bg: #f5f8f7;
  --card: #ffffff;
  --good: #1d7a46;
  --good-soft: #e5f4ea;
  --warn: #a35a00;
  --warn-soft: #fdf1df;
  --bad: #b42318;
  --bad-soft: #fde8e6;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(2, 91, 89, 0.05), 0 2px 8px rgba(2, 91, 89, 0.05);
  --shadow-lg: 0 10px 30px rgba(2, 91, 89, 0.12);
}

* { box-sizing: border-box; }
html, body { margin: 0; }

body {
  font-family: "Metropolis", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
a { color: var(--brand); }

.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- bovenbalk ---------- */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar::after {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-dark), var(--brand) 50%, var(--brand-light));
}
.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 28px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand .mark { height: 42px; width: auto; }
.brand .word { height: 26px; width: auto; }
.brand .tagline {
  border-left: 1px solid var(--line);
  padding-left: 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}
.topbar .spacer { flex: 1; }

main {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 28px 56px;
  flex: 1;
}

h1 { font-size: 30px; margin: 0; color: var(--ink); font-weight: 600; letter-spacing: -0.01em; }
h2 { font-size: 18px; margin: 0; color: var(--ink); font-weight: 600; }
h3 { color: var(--ink); }
.muted { color: var(--muted); }

/* ---------- knoppen ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 9px 16px;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  text-decoration: none;
  color: var(--ink);
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.btn:hover { background: var(--brand-mist); border-color: #c5dad6; }
.btn:focus-visible, .icon-btn:focus-visible, .year-tab:focus-visible { outline: 3px solid rgba(7, 116, 116, 0.3); outline-offset: 2px; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-danger { color: var(--bad); }
.btn-danger:hover { background: var(--bad-soft); border-color: #f5b5ae; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--brand-mist); color: var(--ink); border-color: transparent; }
.btn-small { padding: 6px 11px; font-size: 14px; border-radius: 8px; }
.btn-small .icon { width: 16px; height: 16px; }
.icon-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  color: var(--muted);
  display: inline-grid;
  place-items: center;
}
.icon-btn .icon { width: 17px; height: 17px; }
.icon-btn:hover { background: var(--brand-soft); color: var(--brand-dark); }
.icon-btn.danger:hover { background: var(--bad-soft); color: var(--bad); }
.icon-btn:disabled { opacity: 0.35; cursor: default; background: transparent; }

/* ---------- formulieren ---------- */
.input, select.input {
  width: 100%;
  border: 1px solid #cddcd9;
  border-radius: 10px;
  padding: 9px 12px;
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(7, 116, 116, 0.15); }
.input.amount { text-align: right; font-variant-numeric: tabular-nums; }
label.field { display: block; margin-bottom: 14px; }
label.field span { display: block; font-weight: 600; margin-bottom: 6px; font-size: 14px; color: var(--ink); }
.input-icon { position: relative; }
.input-icon .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input-icon .input { padding-left: 36px; }

/* ---------- kaarten ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---------- voettekst ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 14px;
}
.site-footer .inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  align-items: center;
}
.site-footer .company { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; }
.site-footer .company strong { color: var(--ink); font-weight: 600; }
.site-footer a { color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.site-footer a:hover { color: var(--brand); }
.site-footer .icon { width: 15px; height: 15px; }
.site-footer .spacer { flex: 1; }
.made-by { font-size: 13px; letter-spacing: 0.02em; }
.made-by strong { color: var(--ink); font-weight: 600; }

/* ---------- inlogscherm ---------- */
.login-wrap {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background:
    radial-gradient(circle at 15% 20%, rgba(100, 164, 159, 0.18), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(7, 116, 116, 0.12), transparent 50%),
    var(--bg);
}
.login-card { width: 100%; max-width: 410px; padding: 36px 36px 32px; box-shadow: var(--shadow-lg); }
.login-card .login-logo { display: block; width: 190px; margin: 0 auto 18px; }
.login-card h1 { font-size: 22px; text-align: center; }
.login-card p { text-align: center; margin: 4px 0 26px; }
.login-card .btn { width: 100%; justify-content: center; padding: 12px; font-size: 16px; }
.error-text { color: var(--bad); font-size: 14px; margin: -4px 0 12px; }

/* ---------- paginakop ---------- */
.page-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.page-head .spacer { flex: 1; }
.page-head .actions-row { display: flex; gap: 8px; flex-wrap: wrap; }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand); margin-bottom: 4px; }
.updated { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); margin-top: 6px; }
.updated .icon { width: 15px; height: 15px; }

/* ---------- klantenoverzicht ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar .input-icon { width: 260px; }
.toolbar select.input { width: auto; }

.alerts { display: grid; gap: 10px; margin-bottom: 22px; }
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 12px;
  border: 1px solid;
}
.alert .icon { margin-top: 2px; }
.alert.bad { background: var(--bad-soft); border-color: #f6c4be; color: #7a1a12; }
.alert.warn { background: var(--warn-soft); border-color: #f3d4a6; color: #6b3d00; }
.alert.info { background: var(--brand-soft); border-color: #cfe3df; color: var(--brand-dark); }
.alert a { color: inherit; font-weight: 600; }

.client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 18px;
}
.client-card {
  padding: 20px 22px;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
}
.client-card:hover { transform: translateY(-2px); border-color: #b9d6d1; box-shadow: var(--shadow-lg); }
.client-card .top { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-dark);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 15px;
  flex: none;
}
.client-card h3 { margin: 0; font-size: 17px; font-weight: 600; }
.client-card .row { display: flex; justify-content: space-between; font-size: 14px; margin-top: 16px; }
.client-card .big { font-size: 20px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }

.empty { text-align: center; padding: 56px 24px; color: var(--muted); }
.empty h2 { margin-bottom: 6px; }

/* ---------- statuslabel ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 99px;
  white-space: nowrap;
}
.pill .icon { width: 13px; height: 13px; }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.none { background: #eef2f1; color: var(--muted); }

/* ---------- voortgangsbalk ---------- */
.bar { height: 8px; background: #e6eeec; border-radius: 99px; overflow: hidden; margin-top: 12px; }
.bar > div { height: 100%; border-radius: 99px; background: var(--brand); transition: width 0.4s; }
.bar.warn > div { background: #d98a1c; }
.bar.bad > div { background: var(--bad); }

/* ---------- klantpagina ---------- */
.back-link { color: var(--muted); text-decoration: none; font-size: 14px; display: inline-flex; align-items: center; gap: 4px; margin-bottom: 10px; font-weight: 500; }
.back-link .icon { width: 16px; height: 16px; }
.back-link:hover { color: var(--brand); }

.year-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  background: #fff;
  border: 1px solid var(--line);
  padding: 5px;
  border-radius: 12px;
  width: fit-content;
  box-shadow: var(--shadow);
}
.year-tab {
  border: none;
  background: transparent;
  padding: 8px 18px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-variant-numeric: tabular-nums;
}
.year-tab:hover { color: var(--ink); background: var(--brand-mist); }
.year-tab.active { color: #fff; background: var(--brand); }
.year-tab.add { color: var(--brand); }
.year-tab.add .icon { width: 16px; height: 16px; }

.summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}
.stat { padding: 20px 22px; position: relative; }
.stat .label { font-size: 14px; color: var(--muted); font-weight: 600; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat .value { font-size: 30px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; margin-top: 6px; letter-spacing: -0.01em; }
.stat.remaining { border-top: 4px solid var(--brand-light); }
.stat.remaining.good { border-top-color: var(--good); }
.stat.remaining.warn { border-top-color: #d98a1c; }
.stat.remaining.bad { border-top-color: var(--bad); }
.stat.remaining.bad .value { color: var(--bad); }
.stat .sub { font-size: 14px; color: var(--muted); margin-top: 6px; }
.budget-edit { display: flex; gap: 8px; margin-top: 6px; }
.budget-edit .input { font-size: 24px; font-weight: 700; padding: 5px 12px; color: var(--ink); }

/* grafiek */
.chart-card { padding: 20px 22px 14px; margin-bottom: 18px; }
.chart-card .card-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.chart-card .note { font-size: 14px; color: var(--muted); }
.chart-wrap { position: relative; }
.chart-wrap svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-wrap .axis text { font-size: 12px; fill: var(--muted); font-family: inherit; }
.chart-wrap .grid line { stroke: #e9f0ee; stroke-width: 1; }
.chart-tip {
  position: absolute;
  pointer-events: none;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  padding: 9px 12px;
  border-radius: 9px;
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
  transform: translate(-50%, calc(-100% - 12px));
  opacity: 0;
  transition: opacity 0.12s;
  z-index: 3;
}
.chart-tip.show { opacity: 1; }
.chart-tip b { display: block; margin-bottom: 3px; }
.chart-tip .r { display: flex; justify-content: space-between; gap: 16px; font-variant-numeric: tabular-nums; }
.forecast {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--brand-mist);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 14px;
  margin-top: 10px;
  font-size: 14px;
  color: var(--ink);
}
.forecast .icon { color: var(--brand); margin-top: 1px; }

.sheet {
  display: grid;
  grid-template-columns: 370px 1fr;
  gap: 18px;
  align-items: start;
}
.sheet .card { overflow: hidden; }
.card-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-head .spacer { flex: 1; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 16px; text-align: left; border-bottom: 1px solid #edf3f1; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); background: var(--brand-mist); font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tbody tr:last-child td { border-bottom: none; }
tfoot td { font-weight: 700; color: var(--ink); background: var(--brand-mist); border-top: 1px solid var(--line); border-bottom: none; }

.months tbody tr { cursor: pointer; }
.months tbody tr:hover td { background: var(--brand-mist); }
.months tbody tr.active td { background: var(--brand-soft); font-weight: 600; color: var(--ink); }
.months tbody tr.active td:first-child { box-shadow: inset 4px 0 0 var(--brand); }
.months td.zero { color: #a3b8b4; }
.neg { color: var(--bad) !important; }

.invoices td.actions { width: 1%; white-space: nowrap; text-align: right; }
.invoices tr.add-row td { background: #fafdfc; border-top: 1px dashed #c4dcd7; }
.invoices tr.add-row .input, .invoices tr.editing .input { padding: 7px 10px; }
.invoices .no-rows td { text-align: center; color: var(--muted); padding: 30px; }
.col-date { width: 165px; }
.col-amount { width: 150px; }

/* contactblok voor budgethouders */
.contact-card {
  margin-top: 18px;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  background: linear-gradient(120deg, var(--brand-dark), var(--brand));
  color: #fff;
  border: none;
}
.contact-card img { width: 52px; height: 52px; background: #fff; border-radius: 12px; padding: 6px; }
.contact-card h2 { color: #fff; font-size: 18px; }
.contact-card p { margin: 2px 0 0; opacity: 0.85; font-size: 14px; }
.contact-card .spacer { flex: 1; }
.contact-card .btn { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.35); color: #fff; }
.contact-card .btn:hover { background: rgba(255, 255, 255, 0.22); }

.danger-zone { margin-top: 40px; display: flex; gap: 10px; justify-content: flex-end; }

/* ---------- dialogen ---------- */
dialog {
  border: none;
  border-radius: 16px;
  padding: 0;
  width: min(470px, calc(100vw - 32px));
  box-shadow: 0 24px 60px rgba(2, 40, 40, 0.28);
  color: var(--text);
}
dialog::backdrop { background: rgba(16, 40, 44, 0.5); }
.dialog-body { padding: 26px; }
.dialog-body h2 { margin-bottom: 16px; font-size: 20px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.share-box { display: flex; gap: 8px; margin: 14px 0; }
.share-box .input { font-size: 14px; }
.hint { font-size: 14px; color: var(--muted); }

/* ---------- melding ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  box-shadow: var(--shadow-lg);
  z-index: 50;
  font-weight: 500;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--bad); }

.readonly-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  padding: 6px 12px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 600;
}
.readonly-badge .icon { width: 15px; height: 15px; }

/* ---------- jaaroverzicht (PDF) – enkel zichtbaar bij afdrukken ---------- */
.report { display: none; }

@media print {
  @page { size: A4; margin: 14mm 14mm 16mm; }
  body { background: #fff; display: block; font-size: 11pt; color: #1d2e33; }
  body.printing > *:not(.report) { display: none !important; }
  body.printing .report { display: block; }
  .report table { page-break-inside: auto; }
  .report tr { page-break-inside: avoid; }
}
.report .r-head { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 3px solid var(--brand); padding-bottom: 12px; margin-bottom: 18px; }
.report .r-head img { height: 64px; }
.report .r-title { text-align: right; }
.report .r-title h1 { font-size: 20pt; color: var(--brand-dark); }
.report .r-title div { color: var(--muted); font-size: 10pt; }
.report .r-client { margin-bottom: 14px; }
.report .r-client .lbl { font-size: 9pt; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.report .r-client .nm { font-size: 15pt; font-weight: 700; color: var(--ink); }
.report .r-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.report .r-sum div { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.report .r-sum span { display: block; font-size: 9pt; color: var(--muted); }
.report .r-sum b { font-size: 14pt; color: var(--ink); font-variant-numeric: tabular-nums; }
.report h2 { font-size: 12pt; margin: 16px 0 6px; color: var(--brand-dark); }
.report th, .report td { padding: 5px 8px; font-size: 10pt; border-bottom: 1px solid #e3ebe9; }
.report th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.report tr.grp td { background: var(--brand-mist); font-weight: 700; color: var(--brand-dark); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.report tr.sub td { font-style: italic; color: var(--muted); }
.report .r-foot { margin-top: 24px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 8.5pt; color: var(--muted); display: flex; justify-content: space-between; gap: 16px; }

/* ---------- kleinere schermen ---------- */
@media (max-width: 980px) {
  .sheet { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .topbar-inner { padding: 10px 16px; }
  .brand .mark { height: 34px; }
  .brand .word { height: 20px; }
  .brand .tagline { display: none; }
  main { padding: 20px 14px 40px; }
  h1 { font-size: 24px; }
  .summary { grid-template-columns: 1fr; gap: 12px; }
  .stat { padding: 16px 18px; }
  .stat .value { font-size: 26px; }
  .page-head .actions-row { width: 100%; }
  .page-head .actions-row .btn { flex: 1; justify-content: center; }
  .year-tabs { width: 100%; }
  th, td { padding: 9px 10px; }
  .col-date { width: 105px; }
  .col-amount { width: 110px; }
  .invoices td, .months td { font-size: 15px; }
  .chart-card { padding: 16px 14px 10px; }
  .contact-card { padding: 18px; }
  .contact-card .btn { flex: 1; justify-content: center; }
  .site-footer .inner { padding: 18px 16px; }
  .toolbar, .toolbar .input-icon { width: 100%; }
  .toolbar select.input { flex: 1; }
}
@media (max-width: 480px) {
  .readonly-badge span { display: none; }
}
