/* Huisstijl overgenomen van rummar.com: zwart, wit, karmijnrood en Plus Jakarta Sans. */
:root {
  color-scheme: dark;
  --bg: #000000;
  --surface: #111111;
  --surface-2: #1c1c1c;
  --line: #2a2a2a;
  --text: #ffffff;
  --muted: #a3a3a3;
  --accent: #c70039;
  --accent-text: #ffffff;
  --ok: #4cc38a;
  --warn: #f0a04b;
  --bad: #ff5c7a;
  --radius: 8px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 300 16px/1.5 "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
#app { height: 100%; display: flex; flex-direction: column; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 600; line-height: 1.2; }
strong { font-weight: 600; }
button, input, select, textarea { font: inherit; color: inherit; }

.btn {
  border: 0;
  background: #212121;
  border-radius: 50px;
  padding: 11px 22px;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: .03em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s;
}
.btn:hover { background: #333333; }
.btn.primary { background: var(--accent); color: var(--accent-text); }
.btn.primary:hover { background: #a8002f; }
.btn.danger { color: var(--bad); }
.btn.small { padding: 7px 14px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: default; }

label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 5px; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], select, textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
}
input:focus, select:focus, textarea:focus, .btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.field { margin-bottom: 14px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.error { color: var(--bad); font-size: 14px; min-height: 20px; margin: 4px 0 10px; }
.muted { color: var(--muted); }
.link { color: var(--text); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
input[type=file] { width: 100%; font-size: 14px; padding: 8px 0; }
input[type=file]::file-selector-button {
  border: 0; border-radius: 50px; padding: 9px 16px; margin-right: 10px; background: #2c2c2c; color: #fff;
  font: inherit; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; cursor: pointer;
}
.btn.upload { width: 100%; padding: 18px; background: var(--bg); border: 1px dashed #666; font-size: 14px; }
.btn.upload:hover { border-color: var(--text); background: var(--bg); }
.btn.upload + .thumbs { margin-top: 10px; }
.thumb { position: relative; }
.thumb-remove {
  position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border: 0; border-radius: 50%;
  background: rgba(0, 0, 0, .75); color: #fff; font-size: 16px; line-height: 1; cursor: pointer;
}
.logo { display: block; height: 34px; width: auto; }

/* Aanmelden */
.auth { flex: 1; display: grid; place-items: center; padding: 16px; }
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 32px 28px;
}
.auth-card .logo { height: 48px; margin-bottom: 20px; }
.auth-card h1 { font-size: 26px; }
.auth-card > p { color: var(--muted); margin: 6px 0 22px; }
.tabs { display: flex; gap: 4px; background: var(--bg); padding: 4px; border-radius: 50px; margin-bottom: 20px; }
.tabs button {
  flex: 1; border: 0; background: none; padding: 9px; border-radius: 50px; cursor: pointer;
  color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .03em;
}
.tabs button.active { background: #212121; color: var(--text); }
.auth-card input { background: var(--bg); }
.auth-card .btn.primary { width: 100%; padding: 14px; }
.text-link { display: block; margin: 14px auto 0; border: 0; background: none; color: var(--muted); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.text-link:hover { color: var(--text); }

/* Hoofdscherm */
.topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.topbar .brand { font-weight: 700; font-size: 20px; letter-spacing: .04em; }
.topbar .btn { flex-shrink: 0; }
.topbar .who { margin-left: auto; font-size: 13px; color: var(--muted); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { flex: 1; display: grid; grid-template-columns: 340px 1fr; min-height: 0; }
.sidebar { border-right: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; min-height: 0; }
.sidebar-head { padding: 14px; border-bottom: 1px solid var(--line); display: grid; gap: 12px; }
.chips { display: flex; gap: 6px; }
.chips button {
  border: 1px solid var(--line); background: none; border-radius: 50px;
  padding: 4px 13px; font-size: 13px; cursor: pointer; color: var(--muted);
}
.chips button.active { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 500; }
.list { overflow-y: auto; flex: 1; }
.item { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); border-left: 3px solid transparent; background: none; padding: 13px 14px 13px 11px; cursor: pointer; }
.item:hover { background: var(--surface-2); }
.item.active { background: var(--surface-2); border-left-color: var(--accent); }
.item-top { display: flex; align-items: center; gap: 8px; }
.item-title { font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-sub { font-size: 13px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unread { background: var(--accent); color: #fff; border-radius: 50px; font-size: 12px; font-weight: 600; padding: 1px 8px; }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); }

.badge { font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .03em; padding: 3px 9px; border-radius: 50px; border: 1px solid currentColor; white-space: nowrap; }
.badge.nieuw { color: var(--bad); }
.badge.offerte { color: var(--warn); }
.badge.bevestigd, .badge.afgerond { color: var(--ok); }
.badge.afgerond { background: var(--ok); border-color: var(--ok); color: #000; font-weight: 600; }
.badge.geannuleerd { color: var(--muted); }
.btn.done { margin-top: 12px; background: var(--ok); color: #000; font-weight: 600; }
.btn.done:hover { background: #3fae78; }

.content { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.back { display: none; }
.pane { flex: 1; overflow-y: auto; padding: 28px 20px; }
.pane-inner { max-width: 640px; margin: 0 auto; }
.pane h2 { font-size: 25px; margin-bottom: 18px; }
.pane form + h2 { margin-top: 32px; }

fieldset { border: 0; border-radius: var(--radius); padding: 16px; margin: 0 0 14px; background: var(--surface); }
fieldset input, fieldset select, fieldset textarea { background: var(--bg) !important; }
legend { float: left; width: 100%; font-weight: 600; font-size: 17px; padding: 0; margin-bottom: 12px; }
legend + * { clear: both; }
.check { display: flex; align-items: center; gap: 9px; font-weight: 300; font-size: 16px; color: var(--text); margin: 7px 0; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.sub { margin: 8px 0 6px 27px; }
.member { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; }
.member + .member { border-top: 1px solid var(--line); }
.member { flex-wrap: wrap; }
.member .actions { margin: 0; }
fieldset.attention { border: 1px solid var(--accent); margin-bottom: 28px; }
.member > div { min-width: 0; overflow-wrap: anywhere; }
.member select { width: auto; max-width: 100%; }
.section, .section + h2 { margin-top: 32px; }

/* Kalender */
.picker { width: 100%; }
.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-title { text-transform: capitalize; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-head { font-size: 11px; text-transform: uppercase; color: var(--muted); text-align: center; padding-bottom: 2px; }
.cal-day {
  aspect-ratio: 1; min-width: 0; padding: 0; border: 1px solid var(--line); border-radius: 6px;
  background: var(--bg); cursor: pointer; font-size: 14px; font-weight: 500;
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1;
}
.cal-day small { font-size: 10px; font-weight: 300; color: var(--muted); }
.cal-day:hover:not(:disabled) { border-color: var(--text); }
.cal-day:disabled, .cal-day.closed { opacity: .28; }
.cal-day:disabled { cursor: default; }
.cal-day.blocked { background: #2a2a2a; color: var(--muted); }
.cal-day.full { border-color: var(--warn); }
.cal-day.selected { background: var(--accent); border-color: var(--accent); color: #fff; opacity: 1; }
.cal-day.selected small { color: #fff; }
.slots { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 14px 0 6px; }
.chip { border: 1px solid var(--line); background: none; border-radius: 50px; padding: 6px 16px; font-size: 14px; cursor: pointer; }
.chip.active { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 500; }
.intro { margin: 0 0 16px; }
.pane .tabs { background: var(--surface); }
fieldset .item { padding-left: 0; padding-right: 0; border-left: 0; }
fieldset .item:last-child { border-bottom: 0; }

/* Detail en chat */
.detail-head { background: var(--surface); border-bottom: 1px solid var(--line); padding: 16px 20px; }
.detail-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.detail-title h2 { font-size: 22px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px 16px; margin: 12px 0 0; font-size: 14px; }
.facts dt { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.facts dd { margin: 0; font-weight: 500; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; align-items: flex-end; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; width: 100%; }
.inline-form .field { margin: 0; flex: 1; min-width: 130px; }
.inline-form .row { flex: 1; min-width: 260px; }
.inline-form input, .inline-form select { background: var(--bg); }

.work { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.work-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.thumbs img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; }
.messages { flex: 1; overflow-y: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 78%; padding: 10px 15px; border-radius: 18px 18px 18px 4px; background: #222222; align-self: flex-start; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.mine { align-self: flex-end; background: var(--accent); border-radius: 18px 18px 4px 18px; }
.msg .meta { display: block; font-size: 11px; opacity: .7; margin-top: 3px; }
.msg.systeem { align-self: center; background: none; color: var(--muted); font-size: 13px; text-align: center; padding: 2px; }
.msg.offerte { border: 1px solid var(--accent); background: var(--surface); border-radius: var(--radius); }
.msg.offerte strong { font-size: 24px; display: block; }
.msg.foto { padding: 5px; }
.msg.foto img { display: block; width: 260px; max-width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 14px; }
.msg.foto .meta { padding: 0 8px 3px; }
.composer { display: flex; gap: 8px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
.composer textarea { resize: none; height: 44px; background: var(--bg); border-radius: 22px; padding: 10px 18px; }
.composer .btn { height: 44px; }

@media (max-width: 760px) {
  .main { grid-template-columns: 1fr; }
  .content { display: none; }
  body.open .sidebar { display: none; }
  /* Op een smal scherm scrolt de hele aanvraag mee, zodat de chat niet weggedrukt wordt door de gegevens erboven. */
  body.open .content { display: flex; overflow-y: auto; }
  .detail-head { flex-shrink: 0; }
  .messages { flex: 1 0 auto; overflow: visible; min-height: 160px; }
  .composer { position: sticky; bottom: 0; }
  .back { display: inline-block; margin-bottom: 10px; }
  .row { grid-template-columns: 1fr; }
  .topbar { padding: 10px 14px; }
  .topbar .who { display: none; }
  .topbar .brand, .topbar .logo { margin-right: auto; }
  .msg { max-width: 90%; }
  .topbar { gap: 6px; overflow-x: auto; }
  .topbar .btn.small { padding: 6px 9px; font-size: 11px; }
  .logo { height: 24px; }
  .auth-card { padding: 26px 20px; }
  .auth-card h1 { font-size: 22px; }
  .composer { padding-left: 10px; padding-right: 10px; gap: 6px; }
  .composer .btn { padding: 0 13px; font-size: 12px; }
  .composer textarea { min-width: 0; padding: 10px 14px; }
}
