/* Praktijkboekhouding — huisstijl ontleend aan sharonhess.nl:
   Cormorant Garamond voor koppen, Jost voor tekst, crème ondergrond,
   salie en het groen van de bank als hoofdkleuren, terracotta voor wat aandacht vraagt. */
:root {
  --sage: #8c8a76; --sage-light: #ece8de; --sage-dark: #6f6b57;
  --sand: #f1ebe2; --sand-dark: #e0d5c6;
  --terracotta: #b87a5b; --terracotta-light: #f5e8df; --terracotta-dark: #9a5f42;
  --cream: #faf7f2; --white: #fff;
  --text-dark: #2f2a24; --text-mid: #5f574e; --text-light: #8f867c;
  --border: #dcd3c6; --green: #607464; --green-dark: #4c5d50;
  --cost: #cdbba6;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: Jost, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; min-width: 0; }
html, body { height: 100%; }
body { margin: 0; background: var(--cream); color: var(--text-dark); font: 400 15.5px/1.55 var(--sans); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--green); text-decoration-thickness: 1px; text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; color: var(--text-dark); margin: 0; letter-spacing: -.005em; }
h1 { font-size: clamp(34px, 3.6vw, 46px); line-height: 1.05; }
h2 { font-size: 27px; line-height: 1.15; }
h3 { font-size: 21px; line-height: 1.2; margin-bottom: 8px; }
.sub { color: var(--text-mid); margin: 6px 0 0; font-weight: 300; }
.klein { font-size: 13.5px; color: var(--text-light); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.neg { color: var(--terracotta-dark); }
.pos { color: var(--green); }

/* ---------- opbouw ---------- */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100%; }
.zij { background: var(--green); color: var(--cream); display: flex; flex-direction: column; padding: 26px 16px 18px; gap: 26px;
  position: sticky; top: 0; height: 100vh; }
.merk { padding: 0 10px; text-decoration: none; color: inherit; display: block; }
.merk b { display: block; font: 400 23px/1.1 var(--serif); }
.merk span { font-size: 11.5px; letter-spacing: .18em; text-transform: uppercase; opacity: .75; }
.zij nav { display: flex; flex-direction: column; gap: 2px; }
.zij nav a { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; padding: 10px 12px;
  border-radius: 4px; opacity: .85; font-weight: 400; white-space: nowrap; }
.zij nav a:hover { opacity: 1; background: rgba(255, 255, 255, .08); }
.zij nav a.aan { opacity: 1; background: rgba(250, 247, 242, .16); }
.zij nav svg { flex: none; opacity: .9; }
.teller { margin-left: auto; background: var(--terracotta); color: #fff; font-size: 12px; font-weight: 500; border-radius: 20px;
  padding: 1px 8px; }
.zij .voet { margin-top: auto; font-size: 13px; opacity: .85; padding: 0 12px; }
.zij .voet form { margin: 8px 0 0; }
.zij .voet button { background: none; border: 1px solid rgba(250, 247, 242, .4); color: inherit; border-radius: 3px;
  padding: 6px 10px; cursor: pointer; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
main { min-width: 0; }
.inhoud { max-width: 1240px; margin: 0 auto; padding: 34px clamp(16px, 3.4vw, 48px) 72px; }
.kop { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: flex-end; justify-content: space-between; margin-bottom: 26px; }
.ster { color: var(--terracotta); font-size: 14px; letter-spacing: .3em; }

/* ---------- knoppen en invoer ---------- */
.knop { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 18px;
  border-radius: 3px; border: 1px solid var(--border); background: var(--white); cursor: pointer; text-decoration: none;
  color: var(--text-dark); font: 500 12.5px/1 var(--sans); letter-spacing: .13em; text-transform: uppercase; white-space: nowrap; }
.knop:hover { border-color: var(--sage-dark); }
.knop.hoofd { background: var(--sage-dark); border-color: var(--sage-dark); color: var(--cream); }
.knop.hoofd:hover { background: #5f5b49; }
.knop.groen { background: var(--green); border-color: var(--green); color: var(--cream); }
.knop.aandacht { background: var(--terracotta); border-color: var(--terracotta); color: #fff; }
.knop.licht { background: transparent; border-color: transparent; }
.knop.klein { min-height: 32px; padding: 6px 11px; font-size: 11.5px; }
.knop.gevaar { color: var(--terracotta-dark); }
.knop[disabled], .knop.uit { opacity: .45; pointer-events: none; }
:focus-visible { outline: 2px solid var(--terracotta); outline-offset: 2px; }
input, select, textarea { border: 1px solid var(--border); background: var(--white); border-radius: 3px; padding: 8px 11px;
  min-height: 42px; font-size: 16px; font-weight: 400; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--sage-dark); box-shadow: 0 0 0 3px rgba(111, 107, 87, .14); }
label.veld { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--text-mid); letter-spacing: .04em; }
.acties { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.balk { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.zoek { position: relative; flex: 1 1 240px; max-width: 360px; display: block; }
.zoek input { width: 100%; padding-left: 38px; }
.zoek svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-light); }
.seg { display: inline-flex; background: var(--sand); border-radius: 4px; padding: 3px; gap: 2px; }
.seg a, .seg button { border: 0; background: transparent; padding: 8px 14px; border-radius: 3px; cursor: pointer; font-size: 14px;
  color: var(--text-mid); text-decoration: none; white-space: nowrap; }
.seg .aan { background: var(--white); color: var(--text-dark); box-shadow: 0 0 0 1px var(--border); }
.schakel { display: flex; flex-direction: column; gap: 5px; align-items: flex-end; }
.schakel small { color: var(--text-light); font-size: 12.5px; }

/* ---------- meldingen ---------- */
.melding { padding: 12px 16px; border-radius: 4px; margin-bottom: 20px; background: var(--sage-light); border-left: 3px solid var(--green); }
.melding.fout { background: var(--terracotta-light); border-left-color: var(--terracotta); color: var(--terracotta-dark); }
.notitie { background: var(--sand); border-radius: 4px; padding: 11px 14px; font-size: 14.5px; color: var(--text-mid); margin-bottom: 16px; }
.notitie.let { background: var(--terracotta-light); color: var(--terracotta-dark); }

/* ---------- kerncijfers ---------- */
.cijfers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--text-dark);
  border-bottom: 1px solid var(--border); margin-bottom: 30px; }
.cijfer { padding: 16px 18px 18px 0; }
.cijfer + .cijfer { padding-left: 20px; border-left: 1px solid var(--border); }
.cijfer span { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-light); }
.cijfer b { display: block; font: 400 clamp(30px, 3vw, 40px)/1.1 var(--serif); margin: 4px 0 2px; white-space: nowrap; font-variant-numeric: lining-nums tabular-nums; }
.cijfer small { color: var(--text-mid); font-size: 13.5px; font-weight: 300; }
.cijfer.let small { color: var(--terracotta-dark); font-weight: 400; }

/* ---------- panelen ---------- */
.twee { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 24px; margin-bottom: 24px; }
.twee.gelijk { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.paneel { background: var(--white); border: 1px solid var(--border); border-radius: 4px; padding: 20px 22px 18px; }
.paneel.zand { background: var(--sand); border-color: transparent; }
.paneel .phd { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.grafiekpaneel { display: flex; flex-direction: column; }
.grafiek { position: relative; min-height: 300px; flex: 1; }
.grafiek svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.grafiek text { font: 400 12.5px var(--sans); fill: var(--text-light); }
.legenda { display: flex; gap: 16px; font-size: 13px; color: var(--text-mid); flex-wrap: wrap; }
.legenda i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: -1px; border-radius: 1px; }
.taken a { display: flex; gap: 14px; align-items: flex-start; padding: 13px 0; border-top: 1px solid var(--border); text-decoration: none; color: inherit; }
.taken a:first-of-type { border-top: 0; padding-top: 2px; }
.taken .n { flex: none; min-width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--sage-light);
  font: 500 15px var(--sans); color: var(--sage-dark); padding: 0 6px; }
.taken .n.let { background: var(--terracotta-light); color: var(--terracotta-dark); }
.taken b { display: block; font-weight: 500; }
.taken small { color: var(--text-mid); font-weight: 300; }
.mini { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.mini td { padding: 9px 0; border-top: 1px solid var(--border); vertical-align: top; }
.mini tr:first-child td { border-top: 0; }
.mini small { display: block; color: var(--text-light); font-size: 13px; }
.mini a { color: inherit; text-decoration: none; }
.mini tr:hover a { text-decoration: underline; }

/* ---------- tabellen ---------- */
.scroll { overflow-x: auto; }
.tabel { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tabel th { text-align: left; font-weight: 500; color: var(--text-light); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase;
  padding: 9px 10px; border-bottom: 1px solid var(--text-dark); white-space: nowrap; }
.tabel td { padding: 11px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.tabel th.num, .tabel td.num { text-align: right; }
.tabel tr.rij { cursor: pointer; }
.tabel tr.rij:hover td { background: var(--white); }
.tabel tr.maand td { padding: 22px 10px 7px; border-bottom: 1px solid var(--border); font: 400 21px/1.2 var(--serif); }
.tabel tr.maand td span { float: right; font: 400 14px var(--sans); color: var(--text-mid); font-variant-numeric: tabular-nums; }
.tabel td small { display: block; color: var(--text-light); font-size: 13px; font-weight: 300; }
.tabel td a.stil { color: inherit; text-decoration: none; font-weight: 500; }
.oms { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12.5px; white-space: nowrap; background: var(--sand); color: var(--text-mid); }
.chip.groen { background: var(--sage-light); color: var(--green-dark); }
.chip.let { background: var(--terracotta-light); color: var(--terracotta-dark); }
.chip.rand { background: transparent; border: 1px solid var(--border); color: var(--text-dark); }
.periode { color: var(--text-light); white-space: nowrap; font-size: 13.5px; }
.leeg { text-align: center; padding: 56px 16px; color: var(--text-mid); }
.leeg b { display: block; font: 400 26px/1.2 var(--serif); color: var(--text-dark); margin-bottom: 6px; }

/* ---------- scannen ---------- */
.scanvak { border: 1.5px dashed var(--sage); border-radius: 4px; background: var(--sage-light); padding: 22px 24px;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 20px; align-items: center; margin-bottom: 26px; cursor: pointer;
  transition: background .15s; }
.scanvak:hover, .scanvak.over { background: #e3ddce; }
.scanvak b { display: block; font: 400 24px/1.2 var(--serif); }
.scanvak small { color: var(--text-mid); font-weight: 300; }
.scanvak input[type=file] { display: none; }
.concepten { margin-bottom: 28px; }
.concept { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 12px 16px;
  background: var(--white); border: 1px solid var(--border); border-radius: 4px; margin-bottom: 8px; }
.stip { width: 10px; height: 10px; border-radius: 50%; background: var(--sage); }
.stip.bezig { background: var(--terracotta); animation: puls 1.1s ease-in-out infinite; }
.stip.fout { background: var(--terracotta-dark); }
.stip.klaar { background: var(--green); }
@keyframes puls { 50% { opacity: .3; } }

/* ---------- factuur-editor ---------- */
.editor { display: grid; grid-template-columns: minmax(0, 1fr); gap: 26px; }
.editor.metdoc { grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); align-items: start; }
.voorbeeld { position: sticky; top: 20px; background: var(--sand); border-radius: 4px; padding: 14px; height: calc(100vh - 40px); }
.voorbeeld iframe, .voorbeeld img { width: 100%; height: 100%; border: 0; background: #fff; border-radius: 2px; object-fit: contain; }
.velden { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; margin-bottom: 20px; }
.velden .breed { grid-column: 1 / -1; }
.velden input[readonly] { background: var(--sand); font-weight: 500; text-align: right; }
.regels { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.regel { background: var(--white); border: 1px solid var(--border); border-radius: 4px; padding: 12px; }
.regelrij { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.35fr) 122px auto auto; gap: 8px; align-items: center; }
.regelrij input.bedrag { text-align: right; font-variant-numeric: tabular-nums; }
.pknop { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--cream); border-radius: 3px;
  min-height: 42px; padding: 6px 11px; cursor: pointer; font-size: 13.5px; white-space: nowrap; }
.pknop.gezet { background: var(--sage-light); border-color: var(--sage); color: var(--green-dark); }
.icoon { width: 40px; height: 40px; border: 0; background: transparent; border-radius: 3px; cursor: pointer; color: var(--text-light);
  display: grid; place-items: center; }
.icoon:hover { background: var(--sand); color: var(--text-dark); }
.verdeling { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }
.verdeling .rij { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; font-size: 14px; }
.verdeling select { min-height: 36px; padding: 4px 8px; }
.maanden { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 8px; }
.mnd { background: var(--cream); border-radius: 3px; padding: 7px 9px 9px; position: relative; overflow: hidden; }
.mnd i { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--green); }
.mnd span { font-size: 12.5px; color: var(--text-mid); display: flex; justify-content: space-between; align-items: center; }
.mnd input { width: 100%; min-height: 32px; padding: 3px 6px; text-align: right; font-size: 15px; border-color: transparent; }
.rest { margin-top: 8px; font-size: 13.5px; }
.rest.fout { color: var(--terracotta-dark); }
.rest.goed { color: var(--green); }
.totaal { display: flex; justify-content: flex-end; gap: 18px; align-items: baseline; padding: 6px 2px 18px; }
.totaal b { font: 400 30px var(--serif); font-variant-numeric: lining-nums tabular-nums; }
.voetbalk { position: sticky; bottom: 0; background: var(--cream); border-top: 1px solid var(--border); padding: 14px 0; margin-top: 20px;
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.voetbalk .ruimte { flex: 1; }

/* ---------- wizard ---------- */
.wizard { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 26px; }
.voortgang { height: 3px; background: var(--sand-dark); border-radius: 3px; overflow: hidden; margin: 10px 0 22px; }
.voortgang i { display: block; height: 100%; background: var(--green); transition: width .25s; }
.mutatiekaart { background: var(--green); color: var(--cream); border-radius: 4px; padding: 24px; min-height: 250px; display: flex; flex-direction: column; gap: 6px; }
.mutatiekaart small { opacity: .8; font-size: 13px; letter-spacing: .04em; }
.mutatiekaart .naam { font: 400 28px/1.15 var(--serif); }
.mutatiekaart .oms { opacity: .92; max-width: none; white-space: normal; overflow-wrap: anywhere; font-weight: 300; }
.mutatiekaart .bedrag { font: 400 clamp(38px, 4.4vw, 54px)/1 var(--serif); margin: 10px 0 4px; font-variant-numeric: lining-nums tabular-nums; }
.voorstel { display: flex; gap: 14px; align-items: flex-start; width: 100%; text-align: left; background: var(--white);
  border: 1px solid var(--border); border-radius: 4px; padding: 13px 15px; cursor: pointer; margin-bottom: 10px; }
.voorstel:hover { border-color: var(--sage); }
.voorstel.aan { border-color: var(--green); box-shadow: 0 0 0 3px rgba(96, 116, 100, .16); }
.ring { flex: none; width: 48px; height: 48px; position: relative; display: block; }
.ring svg { width: 48px; height: 48px; transform: rotate(-90deg); }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; font-weight: 500; }
.voorstel .hoofd { flex: 1; }
.voorstel .boven { display: flex; justify-content: space-between; gap: 10px; font-weight: 500; }
.redenen { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.toets { font-size: 11.5px; border: 1px solid var(--border); border-radius: 3px; padding: 0 5px; color: var(--text-light); }
.knop.hoofd .toets { border-color: rgba(250, 247, 242, .45); color: var(--cream); }
.alternatief { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.alternatief .rij { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.alternatief select { flex: 1 1 220px; }
.klaar { text-align: center; padding: 56px 20px; }

/* ---------- rapport ---------- */
.rapport th.num, .rapport td.num { min-width: 86px; }
.rapport tr.groep td { padding-top: 22px; font: 400 21px var(--serif); border-bottom: 1px solid var(--border); }
.rapport tr.som td { font-weight: 500; border-bottom: 1px solid var(--text-dark); }
.rapport tr.resultaat td { font-weight: 600; font-size: 15.5px; border-bottom: 3px double var(--text-dark); }
.rapport td.rek a { color: inherit; text-decoration: none; white-space: nowrap; }
.rapport td.rek a:hover { color: var(--green); text-decoration: underline; }
.rapport td.rek small { display: inline; margin-right: 8px; color: var(--text-light); font-variant-numeric: tabular-nums; }
.rapport .nul { color: var(--border); }
.balans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px; }
.balans h2 { border-bottom: 1px solid var(--text-dark); padding-bottom: 8px; }
.balans table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.balans td { padding: 10px 0; border-bottom: 1px solid var(--border); }
.balans td a { color: inherit; text-decoration: none; }
.balans td a:hover { text-decoration: underline; }
.balans td small { display: block; color: var(--text-light); font-size: 12.5px; }
.balans tr.tot td { font-weight: 600; border-top: 1px solid var(--text-dark); border-bottom: 3px double var(--text-dark); }
.balans tr.tussen td { font-weight: 500; }

/* ---------- inloggen ---------- */
.inlog { min-height: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.inlog .beeld { background: var(--green); color: var(--cream); padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.inlog .beeld h1 { color: var(--cream); font-size: clamp(40px, 4.6vw, 62px); }
.inlog .beeld em { color: #f0d2bd; }
.inlog .vak { display: grid; place-items: center; padding: 40px 24px; }
.inlog form { width: min(380px, 100%); display: flex; flex-direction: column; gap: 16px; }

/* ---------- dialoog ---------- */
dialog { border: 0; border-radius: 4px; padding: 0; width: min(440px, calc(100% - 24px)); background: var(--cream); color: var(--text-dark);
  box-shadow: 0 20px 60px rgba(47, 42, 36, .3); }
dialog::backdrop { background: rgba(47, 42, 36, .4); }
dialog .dl { padding: 24px; }
dialog .dl p { margin: 10px 0 20px; color: var(--text-mid); }
.bezigscherm { position: fixed; inset: 0; background: rgba(250, 247, 242, .86); display: none; place-items: center; z-index: 50;
  font: 400 26px var(--serif); }
.bezigscherm.aan { display: grid; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (max-width: 1100px) {
  .cijfers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cijfer:nth-child(3) { padding-left: 0; border-left: 0; }
  .cijfer:nth-child(n+3) { border-top: 1px solid var(--border); }
}
@media (max-width: 980px) {
  .twee, .twee.gelijk, .wizard, .balans, .editor.metdoc { grid-template-columns: minmax(0, 1fr); }
  .voorbeeld { position: static; height: 420px; }
}
@media (max-width: 860px) {
  .app { display: block; }
  .zij { position: sticky; top: 0; z-index: 10; height: auto; flex-direction: row; align-items: center; padding: 10px 12px; gap: 12px; }
  .merk span, .zij .voet { display: none; }
  .merk { padding: 0; }
  .merk b { font-size: 19px; white-space: nowrap; }
  .zij nav { flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .zij nav a { padding: 8px 10px; font-size: 14px; flex: none; }
  .zij nav svg { display: none; }
  .scanvak { grid-template-columns: minmax(0, 1fr); }
  .scanvak svg { display: none; }
  .inlog { grid-template-columns: minmax(0, 1fr); }
  .inlog .beeld { padding: 32px 24px; min-height: 220px; }
}
@media (max-width: 600px) {
  .inhoud { padding-top: 22px; }
  .velden { grid-template-columns: minmax(0, 1fr); }
  .regelrij { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .regelrij .roms { grid-column: 1 / -1; }
  .tabel { font-size: 13.5px; }
  .tabel th, .tabel td { padding: 8px 6px; }
  .verberg-mobiel { display: none; }
  .schakel { align-items: flex-start; }
  .concept { grid-template-columns: auto minmax(0, 1fr); }
}
