/* ═══════════════════════════════════════════════════════
   PLENIVO KLANTPORTAAL — portaal.css  (nieuwe huisstijl, oktober 2026)
   Zelfde tokens als app.plenivo.nl en admin.plenivo.nl. Papier (licht) is standaard, nacht (donker) is het tweede thema.
   --merk is de huiskleur van de aannemer (gezet na inloggen); zonder huiskleur het Plenivo-rood.
   Afronding: 3px (knop, label, veld), 6px (paneel), rond alleen voor avatars.
═══════════════════════════════════════════════════════ */
html, html[data-theme="light"] {
  --bg:#f4f3f0; --bg2:#ffffff; --bg3:#faf9f7; --bg4:#eeece8;
  --border:#d6d3cd; --line:#e6e3dd;
  --text:#16181a; --text2:#3d4246; --muted:#5f656b; --muted2:#8a9096;
  --merk:#c3302a; --merk-bg:rgba(195,48,42,.08);
  --ok:#2e7d4f; --ok-bg:#e3f1e8; --wacht:#a8690a; --wacht-bg:#fbf0dc; --info:#3d6db0; --info-bg:#e8eef7; --fout:#c3302a; --fout-bg:#fbeceb;
  --zij:#0e0f11; --zij2:#1a1c1f; --zij-tekst:#c4c8cc; --zij-muted:#7d8389;
  --shadow:0 8px 24px rgba(22,24,26,.12); --overlay:rgba(22,24,26,.4);
  color-scheme:light;
}
html[data-theme="dark"] {
  --bg:#0e0f11; --bg2:#16181b; --bg3:#1b1d20; --bg4:#24282c;
  --border:#2e3237; --line:#22262a;
  --text:#eceeef; --text2:#c4c8cc; --muted:#a3a8ad; --muted2:#7d8389;
  --merk-bg:rgba(224,82,70,.12);
  --ok:#5cb67f; --ok-bg:rgba(92,182,127,.14); --wacht:#d99a2b; --wacht-bg:rgba(217,154,43,.14); --info:#7fa6dd; --info-bg:rgba(90,138,208,.16); --fout:#f0705f; --fout-bg:rgba(224,82,70,.12);
  --zij:#0a0b0c; --zij2:#16181b;
  --shadow:0 8px 24px rgba(0,0,0,.45); --overlay:rgba(0,0,0,.6);
  color-scheme:dark;
}
* { box-sizing:border-box; margin:0; padding:0; }
body { font-family:'Archivo',system-ui,-apple-system,sans-serif; background:var(--bg); color:var(--text); min-height:100vh; line-height:1.5;
  -webkit-font-smoothing:antialiased; font-variant-numeric:tabular-nums; }
button, input, select, textarea { font:inherit; color:inherit; }
:focus-visible { outline:2px solid var(--merk); outline-offset:2px; }
.ic { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.75; stroke-linecap:round; stroke-linejoin:round; flex-shrink:0; }

/* ── Knoppen, velden, meldingen ── */
.knop { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:44px; padding:0 18px; border-radius:3px; border:1px solid transparent;
  font-weight:700; font-size:14px; cursor:pointer; text-decoration:none; white-space:nowrap; }
.knop-hoofd { background:var(--merk); color:#fff; }
.knop-hoofd:hover { filter:brightness(.92); }
.knop-alt { background:var(--bg2); color:var(--text); border-color:var(--border); }
.knop-alt:hover { border-color:var(--text); }
.knop-ok { background:var(--ok); color:#fff; }
.knop-blok { width:100%; }
.knop-klein { min-height:36px; padding:0 12px; font-size:13px; }
.veld-label { display:block; font-size:13px; font-weight:600; color:var(--text2); margin:16px 0 6px; }
.veld { width:100%; min-height:46px; background:var(--bg2); border:1px solid var(--border); border-radius:3px; padding:11px 13px; font-size:15px; outline:none; }
.veld:focus { border-color:var(--text); box-shadow:0 0 0 3px var(--merk-bg); }
.msg { display:none; margin-top:16px; padding:11px 13px; border-radius:3px; font-size:14px; }
.msg.err { display:block; background:var(--fout-bg); color:var(--fout); }
.msg.ok { display:block; background:var(--ok-bg); color:var(--ok); }

/* ── Inloggen: foto links, formulier rechts ── */
.login-wrap { min-height:100vh; display:flex; }
.login-beeld { flex:0 0 46%; max-width:640px; display:flex; flex-direction:column; justify-content:space-between; padding:36px 44px; color:#fff;
  background:#0e0f11 center/cover no-repeat;
  background-image:linear-gradient(180deg,rgba(10,11,12,.45) 0%,rgba(10,11,12,.6) 55%,rgba(10,11,12,.9) 100%), url(login-beeld.jpg); }
.lb-merk { display:flex; align-items:center; gap:10px; font-weight:700; font-size:17px; }
.lb-kop { font-weight:800; font-size:44px; line-height:1.05; font-stretch:112%; text-transform:uppercase; letter-spacing:-.01em; max-width:12ch; margin-bottom:14px; }
.lb-sub { font-size:15px; color:rgba(255,255,255,.78); max-width:40ch; }
.login-kaart { align-self:center; margin:0 auto; width:100%; max-width:400px; padding:40px 24px; }
.login-logo { display:flex; align-items:center; gap:10px; font-weight:700; font-size:18px; margin-bottom:28px; }
.login-kaart h1 { font-weight:800; font-size:26px; line-height:1.1; font-stretch:112%; text-transform:uppercase; margin-bottom:8px; }
.login-kaart .sub { color:var(--muted); font-size:15px; margin-bottom:8px; }
.login-kaart .knop-hoofd { margin-top:24px; width:100%; }
.keuze { display:flex; flex-direction:column; gap:8px; margin-top:18px; }
.keuze .knop { justify-content:space-between; width:100%; }
.login-voet { margin-top:28px; font-size:12px; color:var(--muted2); }

/* ── App: zijbalk + inhoud ── */
.layout { display:flex; min-height:100vh; }
.zijbalk { width:250px; background:var(--zij); color:var(--zij-tekst); display:flex; flex-direction:column; flex-shrink:0; position:sticky; top:0; height:100vh; overflow-y:auto; }
.zb-merk { padding:20px 18px 18px; border-bottom:1px solid rgba(255,255,255,.07); }
.zb-logo { background:#fff; border-radius:3px; padding:8px 10px; display:inline-flex; align-items:center; max-width:100%; min-height:48px; margin-bottom:12px; }
.zb-logo img { max-height:36px; max-width:190px; object-fit:contain; display:block; }
.zb-ini { width:44px; height:44px; border-radius:3px; background:var(--merk); color:#fff; display:flex; align-items:center; justify-content:center; font-weight:800; margin-bottom:12px; }
.zb-naam { color:#fff; font-weight:700; font-size:15px; line-height:1.25; }
.zb-sub { color:var(--zij-muted); font-size:12px; margin-top:2px; }
.zb-sectie { padding:18px 18px 6px; font-size:11px; font-weight:600; color:var(--zij-muted); }
.zb-select { margin:0 12px 4px; width:calc(100% - 24px); background:var(--zij2); border:1px solid rgba(255,255,255,.1); border-radius:3px; padding:9px 10px; color:#fff; font-size:13px; outline:none; }
.nav-item { display:flex; align-items:center; gap:10px; margin:2px 10px; padding:10px 12px; border-radius:3px; font-size:14px; font-weight:600; color:var(--zij-tekst); cursor:pointer; border:0; background:none; width:calc(100% - 20px); text-align:left; position:relative; }
.nav-item:hover { background:rgba(255,255,255,.05); color:#fff; }
.nav-item.active { background:rgba(255,255,255,.08); color:#fff; }
.nav-item.active::before { content:''; position:absolute; left:-10px; top:8px; bottom:8px; width:3px; background:var(--merk-licht, var(--merk)); border-radius:0 3px 3px 0; }
.nav-item .teller { margin-left:auto; background:var(--merk); color:#fff; font-size:11px; font-weight:700; border-radius:3px; padding:1px 7px; }
.zb-account { margin-top:auto; padding:14px 12px 8px; border-top:1px solid rgba(255,255,255,.07); }
.zb-wie { display:flex; align-items:center; gap:10px; padding:4px 6px 12px; }
.zb-avatar { width:34px; height:34px; border-radius:50%; background:var(--zij2); color:#fff; display:flex; align-items:center; justify-content:center; font-size:12px; font-weight:700; flex-shrink:0; }
.zb-wie .n { color:#fff; font-size:13px; font-weight:600; line-height:1.2; }
.zb-wie .r { color:var(--zij-muted); font-size:12px; }
.zb-knoppen { display:flex; gap:6px; }
.zb-knop { flex:1; display:flex; align-items:center; justify-content:center; gap:7px; min-height:38px; border-radius:3px; border:1px solid rgba(255,255,255,.1); background:transparent; color:var(--zij-tekst); font-size:12.5px; font-weight:600; cursor:pointer; }
.zb-knop:hover { color:#fff; border-color:rgba(255,255,255,.25); }
.zb-knop.vast { flex:0 0 38px; }
.zb-plenivo { padding:10px 18px 16px; font-size:11px; color:var(--zij-muted); }
.zb-scherm { display:none; }

.mob-balk { display:none; }
.main { flex:1; min-width:0; padding:36px 40px 60px; max-width:980px; }
.page-title { font-weight:800; font-size:30px; line-height:1.1; font-stretch:112%; text-transform:uppercase; letter-spacing:-.005em; }
.page-sub { color:var(--muted); font-size:15px; margin:6px 0 24px; }
.sectie { display:none; }
.sectie.active { display:block; }

/* ── Kaarten ── */
.rij { background:var(--bg2); border:1px solid var(--line); border-radius:6px; padding:18px 20px; margin-bottom:10px; display:block; width:100%; text-align:left; color:var(--text); }
button.rij { cursor:pointer; }
button.rij:hover { border-color:var(--border); box-shadow:var(--shadow); }
.rij-kop { display:flex; justify-content:space-between; align-items:flex-start; gap:14px; }
.rij .titel { font-weight:700; font-size:16px; line-height:1.3; }
.rij .meta { font-size:13.5px; color:var(--muted); margin-top:3px; }
.rij .bedrag { font-weight:800; font-size:16px; white-space:nowrap; }
.rij .actie { font-size:13.5px; font-weight:700; color:var(--merk-tekst, var(--merk)); margin-top:10px; display:inline-flex; align-items:center; gap:6px; }
.rij .klaar { font-size:13.5px; font-weight:600; color:var(--ok); margin-top:10px; display:inline-flex; align-items:center; gap:6px; }
.voortgang { margin-top:14px; }
.balk { height:6px; background:var(--bg4); border-radius:3px; overflow:hidden; }
.balk > div { height:100%; background:var(--merk); }
.voortgang .meta { display:flex; justify-content:space-between; margin-top:6px; }

/* Status: vorm + woord */
.status { display:inline-flex; align-items:center; gap:5px; font-size:12px; font-weight:700; padding:2px 8px 2px 6px; border-radius:3px; background:var(--bg4); color:var(--text2); vertical-align:2px; white-space:nowrap; }
.status svg { width:13px; height:13px; fill:none; stroke:currentColor; stroke-width:2.2; stroke-linecap:round; stroke-linejoin:round; }
.status.s-ok { background:var(--ok-bg); color:var(--ok); }
.status.s-wacht { background:var(--wacht-bg); color:var(--wacht); }
.status.s-info { background:var(--info-bg); color:var(--info); }
.status.s-fout { background:var(--fout-bg); color:var(--fout); }
.leeg { color:var(--muted); text-align:center; padding:56px 20px; font-size:15px; background:var(--bg2); border:1px dashed var(--border); border-radius:6px; }

/* ── Berichten ── */
.tabs { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:12px; }
.tab { border:1px solid var(--border); background:var(--bg2); color:var(--text2); border-radius:3px; padding:7px 13px; font-size:13px; font-weight:600; cursor:pointer; }
.tab.actief { background:var(--text); border-color:var(--text); color:var(--bg2); }
.chat { background:var(--bg2); border:1px solid var(--line); border-radius:6px; padding:18px; min-height:300px; max-height:54vh; overflow-y:auto; margin-bottom:12px; }
.bel { display:flex; margin-bottom:12px; }
.bel.van-klant { justify-content:flex-end; }
.bel > div { max-width:78%; background:var(--bg3); border:1px solid var(--line); border-radius:6px; padding:10px 14px; }
.bel.van-klant > div { background:var(--merk-bg); border-color:transparent; }
.bel .tekst { font-size:14.5px; white-space:pre-wrap; }
.bel .wie { font-size:11.5px; color:var(--muted); margin-top:4px; }
.chat .leeg { border:0; background:none; }
.schrijf { display:flex; gap:8px; flex-wrap:wrap; align-items:flex-end; }
.schrijf select { flex:0 0 auto; min-width:180px; width:auto; }
.schrijf textarea { flex:1; min-width:220px; resize:none; min-height:46px; }

/* ── Venster (offerte) ── */
.modal-bg { display:none; position:fixed; inset:0; background:var(--overlay); z-index:600; align-items:center; justify-content:center; padding:20px; }
.modal-card { background:var(--bg2); border-radius:6px; padding:30px; width:100%; max-width:640px; max-height:90vh; overflow-y:auto; position:relative; box-shadow:var(--shadow); }
.modal-close { position:absolute; top:14px; right:14px; width:36px; height:36px; display:flex; align-items:center; justify-content:center; background:none; border:1px solid transparent; border-radius:3px; color:var(--muted); cursor:pointer; }
.modal-close:hover { border-color:var(--border); color:var(--text); }
.modal-card h1 { font-weight:800; font-size:22px; line-height:1.2; padding-right:40px; }
.modal-card .meta { color:var(--muted); font-size:13.5px; margin-top:6px; }
.o-table { width:100%; border-collapse:collapse; font-size:14px; margin-top:18px; }
.o-table th { text-align:left; padding:0 8px 8px; font-size:12px; font-weight:600; color:var(--muted); border-bottom:1px solid var(--text); }
.o-table td { padding:10px 8px; border-bottom:1px solid var(--line); vertical-align:top; }
.o-table tr.kopregel td { font-weight:700; background:var(--bg3); }
.o-table .r { text-align:right; white-space:nowrap; }
.o-tot { margin-top:16px; margin-left:auto; max-width:300px; font-size:14px; }
.o-tot div { display:flex; justify-content:space-between; padding:4px 0; color:var(--text2); }
.o-tot .eind { border-top:1px solid var(--text); margin-top:6px; padding-top:10px; color:var(--text); font-weight:800; font-size:18px; }
.o-acties { display:flex; gap:8px; margin-top:22px; flex-wrap:wrap; }
.o-acties .knop { flex:1; }
.teken { margin-top:22px; padding-top:20px; border-top:1px solid var(--line); }
.teken canvas { width:100%; height:170px; background:#fff; border:1px solid var(--border); border-radius:3px; touch-action:none; cursor:crosshair; display:block; }

/* ── Telefoon ── */
@media (max-width:900px) {
  .login-beeld { display:none; }
  .layout { display:block; }
  .mob-balk { display:flex; position:sticky; top:0; z-index:500; height:58px; align-items:center; gap:12px; padding:0 14px; background:var(--zij); color:#fff; }
  .mob-balk button { width:40px; height:40px; display:flex; align-items:center; justify-content:center; border-radius:3px; border:1px solid rgba(255,255,255,.12); background:none; color:#fff; }
  .mob-balk .n { font-weight:700; font-size:15px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .zijbalk { position:fixed; left:0; top:0; bottom:0; z-index:700; transform:translateX(-105%); transition:transform .22s ease; box-shadow:var(--shadow); width:270px; }
  .zijbalk.open { transform:none; }
  .zb-scherm.open { display:block; position:fixed; inset:0; background:var(--overlay); z-index:650; }
  .main { padding:22px 16px 48px; }
  .page-title { font-size:24px; }
  .rij { padding:16px; }
  .modal-bg { padding:0; align-items:flex-end; }
  .modal-card { max-height:94vh; border-radius:6px 6px 0 0; padding:24px 18px; }
  .schrijf select { width:100%; }
}
@media (prefers-reduced-motion:reduce) { * { transition:none !important; scroll-behavior:auto !important; } }
