/* Sales-dashboard: rustig en licht. Veel wit, dunne lijnen, kleur alleen waar het iets betekent. */
:root {
  --groen: #003130;
  --accent: #20cd9c;
  --accent-zacht: #e6f8f2;
  --lila: #cebfff;
  --lila-zacht: #f3efff;
  --tekst: #1d1d1f;
  --stil: #6e6e73;
  --lijn: #e8e8ed;
  --vlak: #f5f5f7;
  --wit: #ffffff;
  --rood: #c9372c;
  --rood-zacht: #fdf0ef;
  --oranje: #b26a00;
  --oranje-zacht: #fff6e5;
  --radius: 12px;
  --schaduw: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  color: var(--tekst);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--vlak); }
body { display: flex; flex-direction: column; font-size: 14px; line-height: 1.45; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--groen); }
h1, h2, h3 { font-family: "Plus Jakarta Sans", -apple-system, sans-serif; letter-spacing: -.01em; margin: 0; }

/* ---------- bovenbalk ---------- */
.top { height: 60px; flex-shrink: 0; display: flex; align-items: center; gap: 28px; padding: 0 28px; background: rgba(255,255,255,.88); backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--lijn); position: sticky; top: 0; z-index: 5; }
.merk { font-family: "Plus Jakarta Sans", sans-serif; font-weight: 700; font-size: 17px; color: var(--groen); white-space: nowrap; }
.merk span { color: var(--accent); }
.tabs { display: flex; gap: 2px; background: var(--vlak); padding: 3px; border-radius: 10px; }
.tabs button { border: 0; background: none; padding: 6px 14px; border-radius: 8px; cursor: pointer; color: var(--stil); font-weight: 500; }
.tabs .teller { font-style: normal; font-size: 11px; background: var(--groen); color: #fff; border-radius: 999px; padding: 0 6px; margin-left: 4px; }
.tabel tr.groep td { background: var(--vlak); font-size: 12px; font-weight: 600; color: var(--stil); text-transform: uppercase; letter-spacing: .05em; padding: 9px 14px; cursor: default; }
.tabel tr.groep:hover td { background: var(--vlak); }
.deal { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.deal input { width: 130px; }
.tabs button.aan { background: var(--wit); color: var(--tekst); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.ruimte { flex: 1; }
.mrr { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; color: var(--stil); font-size: 12px; }
.mrr b { font-family: "Plus Jakarta Sans", sans-serif; font-size: 20px; color: var(--groen); letter-spacing: -.01em; }
.streep { width: 1px; height: 28px; background: var(--lijn); }
.ik { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--tekst); white-space: nowrap; }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--lila-zacht); color: var(--groen); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 12px; flex-shrink: 0; }
.ik .avatar { width: 32px; height: 32px; font-size: 13px; }

/* ---------- pagina ---------- */
.pagina { flex: 1; padding: 28px 28px 40px; display: flex; flex-direction: column; gap: 18px; max-width: 1680px; width: 100%; margin: 0 auto; }
.kop { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.kop h1 { font-size: 30px; font-weight: 700; color: var(--tekst); }
.kop-sub { color: var(--stil); margin-top: 2px; display: flex; gap: 12px; flex-wrap: wrap; }
.sync { font-size: 12px; color: var(--stil); cursor: pointer; white-space: nowrap; align-self: center; }
.sync:hover { color: var(--tekst); text-decoration: underline; }
.zoek { display: flex; align-items: center; gap: 8px; background: var(--wit); border: 1px solid var(--lijn); border-radius: 999px; padding: 9px 16px; width: min(360px, 100%); }
.zoek svg { width: 15px; height: 15px; fill: none; stroke: var(--stil); stroke-width: 2; flex-shrink: 0; }
.zoek input { border: 0; outline: 0; background: none; width: 100%; }
.pillen { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.pil { border: 0; background: none; padding: 6px 10px; border-radius: 999px; cursor: pointer; color: var(--stil); display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.pil i { font-style: normal; font-size: 12px; background: var(--wit); border: 1px solid var(--lijn); border-radius: 999px; padding: 0 7px; color: var(--tekst); }
.pil:hover { color: var(--tekst); }
.pil.aan { background: var(--wit); color: var(--tekst); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.pil.vandaag.aan i, .pil.vandaag i { background: var(--groen); border-color: var(--groen); color: #fff; }
.pil input { margin: 0; }

/* fasebalk: stappen van wachtlijst tot klant */
.fases { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); background: var(--wit); border: 1px solid var(--lijn); border-radius: 16px; overflow: hidden; }
.stap { border: 0; background: none; text-align: left; padding: 14px 16px 14px 18px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; position: relative; min-width: 0; }
.stap + .stap { border-left: 1px solid var(--lijn); }
.stap .r { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.stap b { font-weight: 600; line-height: 1.3; }
.stap .n { color: var(--stil); font-size: 13px; font-variant-numeric: tabular-nums; }
.stap .o { font-size: 12px; color: var(--stil); line-height: 1.35; }
.stap:hover { background: #fafafa; }
.stap.aan { background: var(--lila-zacht); }
.stap.aan b { color: var(--groen); }

/* inhoud: tabel met zijpaneel eronder de navigatie */
.inhoud { display: flex; gap: 18px; align-items: flex-start; }
.tabel-wrap { flex: 1; min-width: 0; background: var(--wit); border: 1px solid var(--lijn); border-radius: 16px; overflow: hidden; }
.tabel { width: 100%; border-collapse: collapse; }
.tabel th { text-align: left; font-weight: 500; font-size: 12px; color: var(--stil); padding: 12px 14px; border-bottom: 1px solid var(--lijn); background: var(--wit); }
.tabel td { padding: 13px 14px; border-bottom: 1px solid var(--lijn); vertical-align: middle; }
.tabel tbody tr:last-child td { border-bottom: 0; }
.tabel tbody tr { cursor: pointer; }
.tabel tbody tr:hover td { background: #fafafa; }
.tabel tbody tr.gekozen td { background: var(--lila-zacht); }
.naam { font-weight: 600; }
.sub { color: var(--stil); font-size: 12px; }
.pin-k { width: 28px; padding-right: 0 !important; }
.eig-k { width: 48px; }
.leeg { text-align: center; color: var(--stil); padding: 48px !important; cursor: default; }
.pin { color: var(--accent); font-size: 12px; }

.label { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 999px; background: var(--vlak); color: var(--tekst); white-space: nowrap; }
.label.l-wachtlijst { background: var(--lila-zacht); }
.label.l-scan, .label.l-opvolging { background: var(--accent-zacht); color: var(--groen); }
.label.l-afspraak, .label.l-geweest { background: var(--lila-zacht); color: var(--groen); font-weight: 500; }
.label.l-klant { background: #e9f1ff; color: #1d4ed8; }
.actie { display: flex; flex-direction: column; }
.actie .wanneer { font-size: 12px; color: var(--stil); }
.actie.telaat .wanneer { color: var(--rood); }
.actie.vandaag .wanneer { color: var(--groen); font-weight: 600; }
.sig { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.sig span { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--vlak); color: var(--stil); white-space: nowrap; }
.sig span.warm { background: var(--oranje-zacht); color: var(--oranje); }
.sig span.mail { background: var(--accent-zacht); color: var(--groen); }

/* ---------- zijpaneel ---------- */
.paneel { display: none; }
.paneel.open { display: block; width: min(520px, 40vw); flex-shrink: 0; background: var(--wit); border: 1px solid var(--lijn); border-radius: 16px; position: sticky; top: 78px; max-height: calc(100vh - 96px); overflow-y: auto; }
.p-in { padding: 22px 24px 48px; display: flex; flex-direction: column; gap: 22px; }
.p-kop { display: flex; gap: 12px; align-items: flex-start; }
.p-kop h2 { font-size: 20px; }
.p-kop .sluit { margin-left: auto; }
.p-feiten { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--stil); font-size: 13px; }
.p-feiten a { color: var(--stil); text-decoration: none; }
.p-feiten a:hover { color: var(--tekst); text-decoration: underline; }
.blok { display: flex; flex-direction: column; gap: 10px; }
.blok > h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--stil); font-family: inherit; font-weight: 600; }
.kaart { border: 1px solid var(--lijn); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.kaart.nu { border-color: var(--accent); background: linear-gradient(0deg, var(--wit), var(--accent-zacht)); }
.rij { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rij.eind { justify-content: flex-end; }
.groot { font-size: 16px; font-weight: 600; }

.kaart > .knop { align-self: flex-start; }
a.knop { text-decoration: none; display: inline-block; }
.knop { border: 1px solid var(--lijn); background: var(--wit); border-radius: 9px; padding: 7px 14px; cursor: pointer; font-weight: 500; white-space: nowrap; }
.knop:hover { background: var(--vlak); }
.knop.hoofd { background: var(--groen); color: #fff; border-color: var(--groen); }
.knop.hoofd:hover { background: #00211f; }
.knop.zacht { border-color: transparent; color: var(--stil); background: none; padding: 7px 8px; }
.knop.zacht:hover { color: var(--tekst); background: var(--vlak); }
.knop.gevaar { color: var(--rood); }
.knop[disabled] { opacity: .5; cursor: default; }
.knop.klein { padding: 4px 10px; font-size: 13px; }

select, input[type=text], input[type=date], input[type=time], input[type=datetime-local], input[type=email], textarea {
  border: 1px solid var(--lijn); border-radius: 9px; padding: 7px 10px; background: var(--wit); outline: 0; }
select:focus, input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-zacht); }
textarea { width: 100%; resize: vertical; min-height: 70px; line-height: 1.5; }
.mailtekst { min-height: 320px; font-size: 13.5px; }
input.vol { width: 100%; }

/* AI schrijft */
.ai { display: flex; gap: 10px; align-items: center; color: var(--groen); background: var(--lila-zacht); border-radius: var(--radius); padding: 12px 14px; font-size: 13px; }
.ai .punten { display: inline-flex; gap: 4px; }
.ai .punten i { width: 6px; height: 6px; border-radius: 50%; background: var(--groen); animation: puls 1.2s infinite ease-in-out; }
.ai .punten i:nth-child(2) { animation-delay: .15s; } .ai .punten i:nth-child(3) { animation-delay: .3s; }
@keyframes puls { 0%, 80%, 100% { opacity: .2; transform: scale(.8); } 40% { opacity: 1; transform: scale(1); } }
.ai-merk { font-size: 11px; color: var(--groen); background: var(--lila-zacht); padding: 2px 8px; border-radius: 999px; }
.waarschuwing { font-size: 12px; color: var(--oranje); background: var(--oranje-zacht); border-radius: 8px; padding: 6px 10px; }

.notitie { border-bottom: 1px solid var(--lijn); padding-bottom: 10px; }
.notitie:last-child { border-bottom: 0; }
.notitie .kop { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--stil); }
.notitie .tekst { white-space: pre-wrap; margin-top: 4px; }
.notitie.voor_gesprek { background: var(--lila-zacht); border-radius: 10px; padding: 10px 12px; border: 0; }
.tijdlijn { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.tijdlijn li { display: flex; gap: 10px; }
.tijdlijn .t { color: var(--stil); font-size: 12px; width: 92px; flex-shrink: 0; }
.mailkaart .meta { font-size: 12px; color: var(--stil); }
details summary { cursor: pointer; color: var(--stil); font-size: 13px; }

/* dialoog */
dialog { border: 0; border-radius: 16px; padding: 0; width: min(520px, calc(100vw - 32px)); box-shadow: var(--schaduw); }
dialog::backdrop { background: rgba(0,0,0,.25); backdrop-filter: blur(2px); }
.d-in { padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; }
.d-in h2 { font-size: 18px; }
.keuzes { display: flex; flex-direction: column; gap: 6px; }
.keuzes label { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border: 1px solid var(--lijn); border-radius: 10px; cursor: pointer; }
.keuzes label:has(input:checked) { border-color: var(--accent); background: var(--accent-zacht); }
.veld { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--stil); }

.melding { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--tekst); color: #fff; padding: 10px 18px; border-radius: 12px; font-size: 13px; opacity: 0; transition: .2s; pointer-events: none; z-index: 20; }
.melding.zie { opacity: 1; transform: translateX(-50%); }

@media (max-width: 1100px) {
  .fases { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stap:nth-child(5) { border-left: 0; }
  .stap:nth-child(n+5) { border-top: 1px solid var(--lijn); }
}
@media (max-width: 860px) {
  .top { gap: 12px; padding: 0 16px; }
  .mrr span, .streep, .ik span:not(.avatar), .tabs { display: none; }
  .pagina { padding: 18px 16px 32px; }
  .kop h1 { font-size: 24px; }
  .fases { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stap:nth-child(n) { border-left: 0; border-top: 1px solid var(--lijn); }
  .stap:nth-child(even) { border-left: 1px solid var(--lijn); }
  .stap:nth-child(-n+2) { border-top: 0; }
  .stap .o { display: none; }
  .paneel.open { position: fixed; inset: 60px 0 0 0; width: 100%; max-height: none; border-radius: 0; z-index: 4; }
  .tabel td:nth-child(5), .tabel th:nth-child(5), .eig-k, .tabel td:nth-child(6), .tabel td:nth-child(3), .tabel th:nth-child(3) { display: none; }
}
[hidden] { display: none !important; }

.login { max-width: 380px; margin: 12vh auto 0; background: #fff; border-radius: 18px; padding: 32px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.login h1 { margin: 0 0 6px; }
.login form { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.login input { padding: 11px 12px; border: 1px solid #d2d2d7; border-radius: 10px; font-size: 15px; }
#ik .knop { margin-left: 8px; }
.login .google { display: block; text-align: center; margin-top: 18px; text-decoration: none; }
.login .of { text-align: center; margin: 14px 0 0; }
.deal-t { margin-top: 3px; font-variant-numeric: tabular-nums; }

/* Voorbeeld van de mail zoals de makelaar hem krijgt */
.mailvoorbeeld { margin-top: 12px; border: 1px solid var(--lijn, #e3e8e8); border-radius: 12px; overflow: hidden; background: #fff; }
.mv-kop { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; background: #f6f8f8; border-bottom: 1px solid var(--lijn, #e3e8e8); }
.mv-frame { display: block; width: 100%; height: 520px; border: 0; background: #fff; }

/* Vergroot zijpaneel: bijna het hele scherm, als venster boven de lijst */
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
body.paneel-groot::before { content: ''; position: fixed; inset: 0; background: rgba(20, 30, 30, .28); z-index: 19; animation: vervaag .2s ease; }
.paneel.open.groot { position: fixed; inset: 24px 32px; width: auto; max-height: none; top: 24px; z-index: 20; box-shadow: 0 24px 64px rgba(0, 0, 0, .18); animation: groei .22s ease; }
.paneel.groot .p-in { max-width: 1280px; margin: 0 auto; }
.paneel.groot .mailkaart { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 20px; grid-auto-flow: row dense; }
.paneel.groot .mailkaart > * { grid-column: 1 / -1; }
.paneel.groot .mailkaart > .mailtekst { grid-column: 1; min-height: 560px; }
.paneel.groot .mailkaart > .mailtekst + .sub { grid-column: 1; }
.paneel.groot .mailkaart > .mailvoorbeeld { grid-column: 2; grid-row: span 2; margin-top: 0; align-self: start; }
@keyframes vervaag { from { opacity: 0; } }
@keyframes groei { from { opacity: 0; transform: scale(.98); } }
@media (prefers-reduced-motion: reduce) { body.paneel-groot::before, .paneel.open.groot { animation: none; } }
@media (max-width: 800px) { .paneel.open.groot { inset: 60px 0 0 0; } .paneel.groot .mailkaart { display: block; } }
.p-kop > .rij { margin-left: auto; flex-wrap: nowrap; }
