/* Human Impact CRM — opbouw van Boost CRM, kleuren en letters van humanimpact.nu */
:root {
  --ink: #2b2b2d;
  --ink-2: #353537;
  --ink-soft: #4a4a4c;
  --paper: #fbf8f1;
  --surface: #ffffff;
  --surface-2: #f7f3ea;
  --accent: #8a6a00;
  --accent-2: #6f5500;
  --accent-soft: #fef3c7;
  --brand: #fac921;
  --brand-2: #f0bb00;
  --muted: #6b6b6e;
  --border: #eae4d6;
  --field: #ddd5c3;
  --success: #22c55e;
  --warn: #f59e0b;
  --danger: #e5484d;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(43, 43, 45, .04), 0 8px 24px rgba(43, 43, 45, .05);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Source Sans 3", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: clamp(24px, 3vw, 32px); font-weight: 700; }
h2 { font-size: 17px; font-weight: 700; margin-bottom: 14px; }
h3 { font-size: 15px; font-weight: 600; margin: 8px 0 10px; }
small, .small { font-size: 13px; }
.muted { color: var(--muted); }
.late { color: var(--danger); font-weight: 500; }
.grow { flex: 1; }

/* ---------- Layout ---------- */
.has-nav .main { margin-left: 248px; padding: 32px 40px 64px; max-width: 1480px; }
.no-nav .main { padding: 0; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 248px; z-index: 20;
  display: flex; flex-direction: column; padding: 22px 16px;
  background: radial-gradient(120% 60% at 0% 0%, #4a4a4c 0%, var(--ink) 55%);
  color: #fff;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: #fff; padding: 4px 10px 22px; }
.brand:hover { color: #fff; }
.brand-dark { color: var(--ink); padding: 0 0 24px; }
.brand-logo { display: block; width: 116px; height: auto; }
.brand-tag { align-self: flex-end; margin-bottom: 1px; font-size: 11px; font-weight: 700; letter-spacing: .1em; color: rgba(255, 255, 255, .5); }
.brand-dark .brand-tag { color: var(--muted); }
.brand-mark {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-size: 16px;
  box-shadow: 0 6px 18px rgba(250, 201, 33, .45);
}
.sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
  color: rgba(255, 255, 255, .72); font-weight: 500;
}
.sidebar nav a svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidebar nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sidebar nav a.active { background: rgba(250, 201, 33, .28); color: #fff; box-shadow: inset 0 0 0 1px rgba(250, 201, 33, .45); }
.me { display: flex; align-items: center; gap: 10px; padding: 14px 10px 0; border-top: 1px solid rgba(255, 255, 255, .08); }
.me strong { display: block; font-size: 14px; }
.me a { color: rgba(255, 255, 255, .6); font-size: 13px; }
.me a:hover { color: #fff; }
.avatar {
  display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 700;
}
.avatar.sm { width: 24px; height: 24px; font-size: 11px; }
.nav-toggle { display: none; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.eyebrow { margin: 0 0 6px; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.eyebrow a { color: inherit; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- Componenten ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 24px; box-shadow: var(--shadow); margin-bottom: 20px;
}
.card.flush { padding: 0; overflow-x: auto; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; min-height: 36px; }
.card-head h2 { margin: 0; }
.empty { color: var(--muted); padding: 18px 24px; margin: 0; }
.card:not(.flush) > .empty { padding: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: 999px; border: 1px solid transparent;
  font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; transition: .15s;
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 8px 22px rgba(250, 201, 33, .32); }
.btn-primary:hover { background: var(--accent-2); color: #fff; transform: translateY(-1px); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--field); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-danger-link { background: none; border: 0; color: var(--danger); font: inherit; font-size: 13px; cursor: pointer; padding: 4px 0; }
.icon-btn { background: none; border: 0; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; padding: 4px 8px; border-radius: 8px; }
.icon-btn:hover { background: var(--surface-2); color: var(--danger); }

input, select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--field); border-radius: 12px; padding: 10px 14px; transition: .15s;
}
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); padding: 0; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.check-label { flex-direction: row; align-items: center; gap: 10px; font-weight: 500; color: var(--ink); font-size: 14px; }

.stack { display: flex; flex-direction: column; gap: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.form-grid h2 { margin: 0; }
.span-2 { grid-column: span 2; }
.two { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }
.inline-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.inline-form input:not([type=checkbox]), .inline-form select { width: auto; flex: 1 1 140px; }
.inline-form.tight { margin: 0; flex-wrap: nowrap; }
.inline-form.tight input { min-width: 140px; }
.card.inline-form { margin-top: 0; }

.toolbar { display: flex; gap: 10px; margin-bottom: 18px; max-width: 520px; }
.toolbar.compact { margin: 0; }
.toolbar.compact select { min-width: 180px; }

.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table tfoot td { padding: 8px 16px; border: 0; }
.table tfoot tr:first-child td { border-top: 1px solid var(--border); }
.card:not(.flush) .table { margin: 0 -8px; width: calc(100% + 16px); }
.card:not(.flush) .table th { background: none; }
.table .num { text-align: right; white-space: nowrap; }
.table tr.inactive td { opacity: .5; }
.table tr.row-expired td { background: #fff6f6; }
.table tr.row-expired:hover td { background: #fdecec; }
.fx-note { margin: -8px 0 18px; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.items td { padding: 6px 4px; }
.items input { padding: 8px 10px; }
.w-sm { max-width: 80px; }
.w-md { max-width: 120px; }

.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--accent-soft); color: var(--accent); vertical-align: middle; }

.flash { padding: 12px 18px; border-radius: 12px; margin-bottom: 20px; font-weight: 500; }
.flash-ok { background: #e9f9ef; color: #157a3b; }
.flash-error { background: #fdecec; color: #b42328; }
.flash-warn { background: #fff6e5; color: #8a5a00; }

/* Fasekleuren */
.stage-lead { --c: #8a90a3; }
.stage-contact { --c: #4f9bd5; }
.stage-offerte { --c: #8a6a00; }
.stage-onderhandeling { --c: #a259e6; }
.stage-gewonnen { --c: #22c55e; }
.stage-verloren { --c: #e5484d; }
.pill[class*=stage-] { background: color-mix(in srgb, var(--c) 14%, white); color: color-mix(in srgb, var(--c) 80%, black); }
.status-active { --c: #22c55e; }
.status-soon { --c: #f59e0b; }
.status-expired { --c: #e5484d; }
.status-upcoming { --c: #4f9bd5; }
.status-cancelled { --c: #8a90a3; }
.pill[class*=status-] { background: color-mix(in srgb, var(--c) 14%, white); color: color-mix(in srgb, var(--c) 75%, black); }
h1 .pill { font-size: 13px; vertical-align: middle; margin-left: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }

/* ---------- Dashboard ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px; }
.stat:first-child { background: radial-gradient(140% 120% at 0% 0%, #4a4a4c 0%, var(--ink) 60%); color: #fff; border-color: transparent; }
.stat:first-child span, .stat:first-child small { color: rgba(255, 255, 255, .65); }
.stat span { font-size: 13px; color: var(--muted); font-weight: 500; }
.stat strong { font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.stat small { color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; }
.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr auto; gap: 12px; align-items: center; font-size: 14px; }
.bar-track { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--c); border-radius: 999px; min-width: 2px; }
.bar-value { font-weight: 600; white-space: nowrap; }

/* Taken */
.task-list { list-style: none; margin: 0; padding: 0; }
.task-list li { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.task-list li:last-child { border-bottom: 0; }
.task-list li > div { display: flex; flex-direction: column; min-width: 0; }
.task-list li.done strong { text-decoration: line-through; color: var(--muted); }
.task-list.big li { padding: 14px 0; align-items: center; }
.check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--field); background: var(--surface); cursor: pointer; padding: 0; margin-top: 1px; transition: .15s; position: relative; }
.check:hover { border-color: var(--accent); }
.check.checked { background: var(--success); border-color: var(--success); }
.check.checked::after { content: ""; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }

.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; margin-bottom: 18px; }
.tabs a { padding: 8px 18px; border-radius: 999px; color: var(--ink-soft); font-weight: 600; font-size: 14px; }
.tabs a.active { background: var(--ink); color: #fff; }

/* ---------- Pipeline ---------- */
.board { display: grid; grid-template-columns: repeat(6, minmax(230px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.column { background: #e9ebf2; border-radius: var(--radius); padding: 12px; min-height: 300px; transition: background .15s; }
.column.drag-over { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent-2); }
.column header { display: flex; align-items: center; gap: 8px; padding: 4px 6px 12px; flex-wrap: wrap; }
.column header strong { font-size: 14px; }
.count { background: var(--surface); border-radius: 999px; padding: 0 8px; font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.col-total { width: 100%; color: var(--muted); font-weight: 600; padding-left: 18px; }
.cards { display: flex; flex-direction: column; gap: 10px; min-height: 60px; }
.deal-card {
  display: flex; flex-direction: column; gap: 4px; background: var(--surface); color: var(--ink);
  border-radius: 12px; padding: 14px; box-shadow: 0 1px 2px rgba(43, 43, 45, .06); border: 1px solid transparent;
  border-left: 3px solid var(--c, var(--accent)); cursor: grab; transition: .15s;
}
.column[data-stage] .deal-card { --c: inherit; }
.deal-card:hover { color: var(--ink); border-color: var(--field); transform: translateY(-1px); box-shadow: var(--shadow); }
.deal-card.dragging { opacity: .45; }
.deal-card .muted { font-size: 13px; }
.deal-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.deal-value { font-weight: 700; font-size: 14px; }

/* ---------- Detail ---------- */
.detail { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr); gap: 20px; align-items: start; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px 24px; margin: 0; }
.facts dt { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 2px; }
.facts dd { margin: 0; font-weight: 500; word-break: break-word; }
.facts dd.big { font-size: 22px; font-weight: 700; }
.notes { margin: 18px 0 0; padding: 14px 16px; background: var(--surface-2); border-radius: 12px; color: var(--ink-soft); }
.stage-track { display: flex; gap: 4px; margin-bottom: 22px; overflow-x: auto; }
.stage-track span { flex: 1; text-align: center; padding: 8px 10px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); border-radius: 8px; white-space: nowrap; }
.stage-track span.current { background: var(--c); color: #fff; }
.invoice-card { border-color: var(--accent-soft); background: linear-gradient(180deg, #fbfbff, #fff); }
.settings-section { margin-top: 18px; padding-top: 22px; border-top: 1px solid var(--border); }
.quote-form { padding-top: 16px; border-top: 1px solid var(--border); }
.quote-form strong { flex: 1 1 100%; font-size: 14px; }
.quote-form select { flex: 0 1 160px !important; }
.timeline { list-style: none; padding: 0; margin: 18px 0 0; }
.timeline li { position: relative; padding: 0 0 16px 20px; border-left: 2px solid var(--border); margin-left: 5px; font-size: 14px; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--surface); }
.tl-meta { font-size: 12px; color: var(--muted); margin-bottom: 2px; }

/* ---------- Inloggen ---------- */
.auth {
  min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(80% 60% at 70% 0%, #4a4a4c 0%, var(--ink) 60%);
}
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border-radius: 24px; padding: 36px 32px; box-shadow: 0 24px 60px rgba(0, 0, 0, .35); }
.auth-card h1 { font-size: 26px; }
.auth-card p { margin: 6px 0 22px; }

/* ---------- Mobiel ---------- */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .detail { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .has-nav .main { margin-left: 0; padding: 72px 16px 48px; }
  .sidebar { transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; }
  .sidebar.open + .nav-backdrop { display: block; }
  .nav-toggle {
    display: block; position: fixed; top: 14px; left: 16px; z-index: 30;
    width: 42px; height: 42px; border-radius: 12px; border: 0; background: var(--ink); color: #fff; font-size: 20px; cursor: pointer;
  }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .stats { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 100px 1fr; }
  .bar-value { grid-column: 2; }
  .card { padding: 18px 16px; }
  .items { display: block; overflow-x: auto; }
  .row-actions { flex-direction: column; }
}

/* ---------- Omzet & grafieken ---------- */
.stats.three { grid-template-columns: repeat(3, 1fr); }
.grid-2.even { grid-template-columns: 1fr 1fr; }
.delta { font-weight: 700; }
.delta.up { color: #157a3b; }
.delta.down { color: var(--danger); }
.big-number { margin: 0; font-size: 26px; font-weight: 700; }
.big-number small { font-size: 14px; font-weight: 500; }
.facts dd.big.late { color: var(--danger); }

.sync-bar { gap: 12px; }
.sync-bar.busy #sync-btn { opacity: .6; pointer-events: none; }
.filters { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.filters .tabs, .filters .toolbar { margin: 0; }
.inline-label { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
.inline-label input { width: 110px !important; flex: none !important; }

.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--ink-soft); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.sw.actual { background: var(--accent); }
.sw.renewal { background: #20a39e; }
.sw.forecast { background: repeating-linear-gradient(45deg, var(--accent-soft) 0 3px, var(--accent-2) 3px 4.5px); box-shadow: inset 0 0 0 1px var(--accent-2); }

.chart-wrap { width: 100%; overflow: hidden; }
.chart { width: 100%; height: auto; display: block; }
.chart-wrap.small .chart { max-height: 180px; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .baseline { stroke: var(--field); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; font-family: inherit; }
.chart .bar path { fill: var(--accent); transition: opacity .15s; }
.chart .bar .forecast { fill: url(#hatch); stroke: var(--accent-2); stroke-width: 1; }
.chart .bar .renewal { fill: #20a39e; stroke: none; }
.chart .bar rect.renewal, .chart .bar path.renewal { transition: opacity .15s; }
.chart:hover .bar rect:not(.hit) { opacity: .55; }
.chart .bar:hover rect:not(.hit) { opacity: 1; }
.chart .hatch-bg { fill: var(--accent-soft); }
.chart .hatch-line { stroke: var(--accent-2); stroke-width: 1.5; }
.chart .hit { fill: transparent; }
.chart:hover .bar path { opacity: .55; }
.chart .bar:hover path { opacity: 1; }

.bar-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.bl-head { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; margin-bottom: 4px; }
.bl-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bl-value { font-weight: 600; white-space: nowrap; }
.bl-track { display: block; height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bl-fill { display: block; height: 100%; background: var(--accent); border-radius: 999px; min-width: 2px; }

.tooltip {
  position: fixed; z-index: 50; pointer-events: none; max-width: 280px;
  background: var(--ink); color: #fff; font-size: 13px; font-weight: 500; padding: 7px 11px; border-radius: 8px;
  box-shadow: 0 8px 24px rgba(43, 43, 45, .25); transform: translate(-50%, calc(-100% - 10px));
}

@media (max-width: 1100px) {
  .grid-2.even { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .stats.three { grid-template-columns: 1fr; }
  .chart .axis { font-size: 14px; }
}

/* ---------- Uren ---------- */
.tabs.scroll { max-width: 100%; overflow-x: auto; }
.tabs.scroll a { white-space: nowrap; }
#client-tabs a { cursor: grab; }
#client-tabs a.dragging { opacity: .45; }
.hrow { display: grid; grid-template-columns: 150px 158px 158px 80px minmax(180px, 1fr) 34px; gap: 8px; align-items: center; margin-bottom: 8px; }
.hrow.with-rate { grid-template-columns: 150px 158px 158px 80px minmax(180px, 1fr) 90px 34px; }
.hrow.with-activity { grid-template-columns: 150px 158px 158px 80px 170px minmax(160px, 1fr) 34px; }
.hours-who { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 13px; font-weight: 600; }
.hours-who select { width: auto; }
.hrow.head { margin-bottom: 4px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.hrow.head span { padding-left: 4px; }
.hrow > * { min-width: 0; }
.hrow input { padding: 9px 12px; }
.time-cell { display: flex; gap: 4px; }
.time-cell input { min-width: 0; }
.nu { flex: none; border: 1px solid var(--field); background: var(--surface); color: var(--ink-soft); border-radius: 10px; padding: 0 9px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.nu:hover { border-color: var(--accent); color: var(--accent); }
.hrow-actions { margin-top: 6px; }
.hours-table td { padding: 8px 14px; }
.nowrap { white-space: nowrap; }
.pill-btn {
  display: inline-block; min-width: 52px; border: 0; border-radius: 999px; padding: 3px 14px; text-align: center;
  font: inherit; font-size: 12px; font-weight: 700; cursor: pointer;
}
span.pill-btn { cursor: default; }
.pill-btn.yes { background: #1b7f4b; color: #fff; }
.pill-btn.no { background: #fde2e2; color: #b42328; }
.row-actions form { margin: 0; }

.share { max-width: 1120px; margin: 0 auto; padding: 28px 16px 64px; }
.share-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 28px; }
.share-logo { height: 34px; width: auto; }
.share h1 { margin-bottom: 20px; }
@media (max-width: 800px) {
  .hrow, .hrow.with-rate, .hrow.with-activity { grid-template-columns: 1fr 1fr; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
  .hrow.head { display: none; }
  .hrow > [name$="[description]"] { grid-column: span 2; }
  .hrow [data-remove] { grid-column: span 2; justify-self: end; }
  .hours-table { display: block; overflow-x: auto; }
}

.w-auto { flex: 0 0 auto !important; width: auto !important; }

/* ---------- Takenbord (Trello-stijl) ---------- */
#board.board { display: flex; align-items: flex-start; gap: 14px; overflow-x: auto; padding: 4px 2px 24px; margin: 0 -2px; min-height: calc(100vh - 230px); }
.blist { flex: 0 0 290px; display: flex; flex-direction: column; max-height: calc(100vh - 210px); background: #ebedf3; border-radius: 14px; padding: 10px; }
.blist.is-done { background: #e6f4ec; }
.blist.dragging { opacity: .5; }
.blist-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 8px; cursor: grab; }
.blist-head h2 { margin: 0; font-size: 14px; font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.blist-count { font-size: 12px; color: var(--muted); background: rgba(43, 43, 45, .06); border-radius: 999px; padding: 1px 8px; }
.blist-menu { position: relative; }
.blist-menu summary { list-style: none; cursor: pointer; color: var(--muted); font-size: 18px; line-height: 1; padding: 2px 6px; border-radius: 8px; }
.blist-menu summary::-webkit-details-marker { display: none; }
.blist-menu summary:hover { background: rgba(43, 43, 45, .08); color: var(--ink); }
.blist-pop { position: absolute; right: 0; top: 28px; z-index: 5; width: 240px; background: var(--surface); border-radius: 12px; box-shadow: 0 12px 32px rgba(43, 43, 45, .18); padding: 12px; display: grid; gap: 8px; cursor: default; }
.blist-pop form { display: flex; gap: 6px; }
.blist-pop input { flex: 1; min-width: 0; }
.blist-cards { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; min-height: 14px; padding: 2px; margin: 0 -2px; }
.kcard { display: flex; gap: 10px; align-items: flex-start; background: var(--surface); border-radius: 10px; padding: 10px 12px; box-shadow: 0 1px 1px rgba(43, 43, 45, .1), 0 0 0 1px rgba(43, 43, 45, .03); cursor: pointer; }
.kcard:hover { box-shadow: 0 1px 1px rgba(43, 43, 45, .1), 0 0 0 2px var(--accent-2); }
.kcard.dragging { opacity: .4; transform: rotate(2deg); }
.kcard.done .kcard-title { text-decoration: line-through; color: var(--muted); }
.kcard .check { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.kcard-body { flex: 1; min-width: 0; }
.kcard-labels { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.kchip { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kchip.deal { background: #fff1e6; color: #b45309; }
.kchip.contract { background: #e6f4ec; color: #15803d; }
.kchip.contact { background: #f3e8ff; color: #7e22ce; }
.kcard-title { font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.kcard-meta { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.kdue { display: inline-flex; align-items: center; padding: 1px 7px; border-radius: 6px; background: rgba(43, 43, 45, .05); }
.kdue.late { background: var(--danger); color: #fff; }
.kdue.soon { background: #fef3c7; color: #92400e; }
.kdue.done { background: var(--success); color: #fff; }
.kavatar { margin-left: auto; flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; }
.add-card { margin-top: 8px; }
.add-card summary, .blist-new summary { list-style: none; cursor: pointer; padding: 8px; border-radius: 10px; color: var(--ink-soft); font-size: 14px; font-weight: 500; }
.add-card summary::-webkit-details-marker, .blist-new summary::-webkit-details-marker { display: none; }
.add-card summary:hover, .blist-new summary:hover { background: rgba(43, 43, 45, .07); }
.add-card[open] summary { display: none; }
.add-card form, .blist-new form { display: grid; gap: 8px; }
.add-card textarea { resize: vertical; border-radius: 10px; }
.add-card-row { display: flex; gap: 6px; }
.add-card-row > * { flex: 1; min-width: 0; }
.blist-new { background: rgba(43, 43, 45, .05); }
.blist-new details[open] summary { display: none; }
.kdialog { width: min(560px, calc(100vw - 32px)); border: 0; border-radius: 16px; padding: 22px; box-shadow: 0 24px 64px rgba(43, 43, 45, .3); color: var(--ink); }
.kdialog::backdrop { background: rgba(43, 43, 45, .45); }
.kdialog-head { display: flex; gap: 8px; align-items: center; }
.kdialog-head input { flex: 1; font-size: 18px; font-weight: 700; }
.kdialog-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kdialog-foot { display: flex; justify-content: space-between; gap: 8px; }
.btn.danger-text { color: var(--danger); }
@media (max-width: 640px) { .blist { flex-basis: 85vw; } .kdialog-grid { grid-template-columns: 1fr; } }

/* ---------- Afspraken ---------- */
.time-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.appt-day { margin: 18px 0 6px; font-size: 13px; font-weight: 700; color: var(--ink-soft); text-transform: none; }
.appt-day:first-child { margin-top: 0; }
.appt { display: flex; align-items: flex-start; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.appt:last-child { border-bottom: 0; }
.appt-time { flex: none; width: 52px; font-weight: 700; font-variant-numeric: tabular-nums; display: flex; flex-direction: column; }
.appt-time small { font-weight: 500; color: var(--muted); }
.appt .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.appt-title { font-weight: 600; color: var(--ink); }
.appt-title:hover { color: var(--accent); }
.appt-actions { display: flex; gap: 6px; flex: none; }
.appt-error { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; font-size: 13px; color: var(--danger); }
@media (max-width: 640px) { .appt { flex-wrap: wrap; } .appt-actions { width: 100%; padding-left: 68px; } }

/* Pill (bijv. 'ingesteld') naast de labeltekst in plaats van eronder */
label:has(> .pill) { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 8px; }
label:has(> .pill) > .pill { justify-self: start; }
label:has(> .pill) > :not(.pill) { grid-column: 1 / -1; }
.trend-line { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }

/* Formulier verwachte inkomsten */
.expected-form { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.3fr) minmax(0, 1fr) auto; gap: 10px; align-items: center; margin-top: 16px; padding: 12px; background: var(--surface-2); border: 1px dashed var(--field); border-radius: 14px; }
.money-input { display: flex; min-width: 0; }
.money-input input { flex: 1; min-width: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.money-input select { width: auto; flex: none; border-left: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; background-color: var(--surface-2); font-weight: 600; }
@media (max-width: 760px) { .expected-form { grid-template-columns: 1fr 1fr; } .expected-form > input[name=description] { grid-column: 1 / -1; } }

/* Verwachte inkomsten op mobiel: omschrijving + bedrag, daaronder datum + knoppen */
@media (max-width: 640px) {
  #expected .card-head { flex-wrap: wrap; gap: 2px 10px; }
  #expected .card-head h2 small { display: none; }
  #expected .table, #expected .table tbody { display: block; }
  #expected .table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
  #expected .table tr:last-child { border-bottom: 0; }
  #expected .table td { display: block; padding: 0; border: 0; }
  #expected .table td:nth-child(1) { grid-column: 1; grid-row: 1; }
  #expected .table td:nth-child(3) { grid-column: 2; grid-row: 1; }
  #expected .table td:nth-child(2) { grid-column: 1; grid-row: 2; }
  #expected .table td:nth-child(4) { grid-column: 2; grid-row: 2; }
}
.sort-link { color: inherit; }
.sort-link:hover, .sort-link.active { color: var(--accent); }

/* Hele tabelrij klikbaar via de hoofdlink (::after over de rij) */
.row-click { position: relative; cursor: pointer; }
.row-click:hover td { background: var(--surface-2); }
.row-main { font-weight: 700; color: var(--accent); }
.row-main::after { content: ''; position: absolute; inset: 0; }

/* Lange lijsten op het dashboard: vaste hoogte, scrollen binnen de kaart */
.card-scroll { max-height: 250px; overflow-y: auto; overscroll-behavior: contain; margin-right: -10px; padding-right: 10px; scrollbar-width: thin; }
.task-list.card-scroll { max-height: 205px; }
.card-scroll.has-more { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 56px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 56px), transparent); }

/* Achtergrond achter het mobiele menu: vangt tikken op en sluit het menu */
.nav-backdrop { display: none; position: fixed; inset: 0; z-index: 19; background: rgba(43, 43, 45, .45); }

/* Gridkolommen mogen krimpen (anders duwt lange inhoud de kaart breder dan het scherm) */
.grid-2 > *, .stats > * { min-width: 0; }
.bl-head { gap: 10px; }
.bl-label { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 800px) { .has-nav .main { overflow-x: clip; } }

/* Logo naast de menuknop op mobiel */
@media (max-width: 800px) { .sidebar .brand { padding-left: 62px; margin-top: -7px; } }

/* ---------- Mobiele nalooprondje ---------- */
label, .form-grid > *, .time-pair > * { min-width: 0; }
input, select, textarea { min-width: 0; max-width: 100%; }
.settings-section p, .form-grid p { overflow-wrap: anywhere; }
.more-right { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent); }
@media (max-width: 800px) {
  /* iOS-datum/tijd: niet breder dan de kaart, links uitgelijnd, lege velden even hoog */
  input[type=date], input[type=time] { -webkit-appearance: none; appearance: none; min-height: 46px; text-align: left; }
  input::-webkit-date-and-time-value { text-align: left; }
  .hrow input[type=date], .hrow input[type=time] { min-height: 40px; }
  /* Filters op één regel, zijwaarts scrollen */
  .tabs { display: flex; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { white-space: nowrap; flex: none; }
  /* Pipeline: ~1,5 kolom zichtbaar, snapt per kolom */
  .board:not(#board) { grid-template-columns: repeat(6, 62vw); scroll-snap-type: x mandatory; margin-right: -16px; padding-right: 16px; }
  .board:not(#board) .column { scroll-snap-align: start; min-height: 220px; }
  /* Brede tabellen: niet afbreken, zijwaarts scrollen */
  .card.flush .table th, .card.flush .table td { white-space: nowrap; }
  .card.flush .table td:first-child { white-space: normal; min-width: 170px; }
  /* Balk achter de menuknop, zodat die niet over de inhoud zweeft */
  body.has-nav::before { content: ''; position: fixed; inset: 0 0 auto 0; height: 70px; z-index: 18; background: rgba(243, 244, 248, .88); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: 0 1px 0 var(--border); }
}

/* Vernieuwknop rechtsboven (alleen mobiel; in de webapp is er geen browserknop) */
.app-refresh { display: none; }
@media (max-width: 800px) {
  .app-refresh { display: grid; place-items: center; position: fixed; top: 14px; right: 16px; z-index: 30; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--field); background: var(--surface); color: var(--ink); cursor: pointer; padding: 0; }
  .app-refresh svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .app-refresh.spin svg { animation: app-spin .8s linear infinite; }
}
@keyframes app-spin { to { transform: rotate(360deg); } }

/* Uren: berekend uit begin/eindtijd */
#hours-rows input[readonly] { background: #f5f6fa; cursor: default; }
#hours-rows input[readonly]::placeholder { color: #334155; opacity: 1; }
#hours-rows input[readonly] { color: #94a3b8; }
#hours-rows input[readonly]::-webkit-calendar-picker-indicator { opacity: .3; }
#hours-rows .nu:disabled { opacity: .4; cursor: default; }

/* Terugkerende afspraak */
.appt-repeat { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: #fef3c7; color: #8a6a00; font-size: 12px; font-weight: 600; vertical-align: 1px; white-space: nowrap; }

/* Offerte vanuit een deal: velden laten doorlopen, met korting */
.quote-form { display: flex; flex-wrap: wrap; }
.quote-form label { flex: 1 1 130px; }
.quote-form label:first-of-type { flex: 2 1 220px; }
.quote-form .btn { flex: 0 0 auto; }
.disc-pair { display: flex; gap: 6px; }
.disc-pair input { min-width: 0; }
.disc-pair select { width: auto; flex: none; }

/* Uitgaven */
.exp-upload { margin: 0; }
.exp-upload label { cursor: pointer; margin: 0; }
.card-head.pad { padding: 18px 24px 4px; }
.table-scroll { overflow-x: auto; }
.exp-desc { display: block; max-width: 520px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exp-in { color: #1b7f4b; }
a.exp-link { color: inherit; text-decoration: none; grid-template-columns: 190px 1fr auto; }
a.exp-link:hover > span:first-child { color: var(--accent); }
.exp-todo { border-color: #f59e0b; }
.exp-assign { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 12px 0; border-top: 1px solid var(--border); }
.exp-assign-info { display: flex; flex-direction: column; min-width: 0; }
.exp-form { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.exp-rules { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.exp-rules li { display: inline-flex; align-items: center; gap: 2px; background: var(--surface-2); border-radius: 999px; padding: 2px 4px 2px 10px; font-size: 13px; }
.exp-rules form { margin: 0; }
.link-btn { background: none; border: 0; cursor: pointer; color: var(--muted); font-size: 16px; padding: 0 6px; }
.exp-pos { width: 70px; }
@media (max-width: 800px) { .exp-assign { grid-template-columns: 1fr; } a.exp-link { grid-template-columns: 120px 1fr auto; } }
/* Uitgaven: scrollende leverancierslijst en transactie verplaatsen */
.exp-vendors { display: flex; flex-direction: column; }
.exp-scroll { flex: 1 1 auto; height: 0; min-height: 240px; overflow-y: auto; overscroll-behavior: contain; }
.exp-scroll::after { content: ''; position: sticky; bottom: 0; display: block; height: 56px; margin-top: -56px; background: linear-gradient(to bottom, color-mix(in srgb, var(--surface) 0%, transparent), var(--surface) 90%); pointer-events: none; transition: opacity .2s; }
.exp-scroll.at-end::after { opacity: 0; }
@media (max-width: 900px) { .exp-scroll { height: auto; max-height: 420px; } }
.exp-note { color: var(--accent); font-weight: 500; }
.exp-move { width: 1%; }
.exp-move details { position: relative; }
.exp-move summary { list-style: none; cursor: pointer; color: var(--muted); padding: 2px 6px; border-radius: 6px; }
.exp-move summary::-webkit-details-marker { display: none; }
.exp-move summary:hover, .exp-move details[open] summary { color: var(--accent); background: var(--surface-2); }
.exp-move form { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; width: 280px; display: flex; flex-direction: column; gap: 10px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 32px rgba(43, 43, 45, .16); text-align: left; }
/* Uitgaven: categorieën meetellen of niet */
.exp-cat-row { display: flex; align-items: center; gap: 10px; }
.exp-cat-row form { margin: 0; display: flex; }
.exp-cat-row a.exp-link { flex: 1; min-width: 0; }
.exp-cat-row.off a.exp-link { opacity: .4; }
.exp-cat-row.off .bar-value { text-decoration: line-through; }
.exp-toggle { position: relative; flex: none; width: 30px; height: 18px; padding: 0; border: 0; border-radius: 999px; background: var(--border); cursor: pointer; transition: background .15s; }
.exp-toggle::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s; }
.exp-toggle[aria-checked=true] { background: var(--accent); }
.exp-toggle[aria-checked=true]::after { transform: translateX(12px); }
tr.exp-off td { opacity: .45; }
.exp-scroll { flex: none; height: auto; min-height: 0; max-height: 180px; }

.exp-save-bar { display: flex; justify-content: flex-end; margin: -6px 0 24px; }

a.exp-link > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Boekhouding */
.exp-dot { display: inline-block; width: 9px; height: 9px; margin-right: 7px; border-radius: 50%; background: #d4d7e1; vertical-align: 1px; }
.exp-dot.ok { background: #22c55e; box-shadow: 0 0 0 3px color-mix(in srgb, #22c55e 22%, transparent); }
.exp-months { display: flex; gap: 6px; margin: 0 0 18px; padding-bottom: 4px; overflow-x: auto; }
.exp-months a { padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: inherit; font-size: 13px; text-decoration: none; white-space: nowrap; }
.exp-months a.active { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.exp-files { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.exp-file { display: inline-flex; align-items: center; gap: 2px; max-width: 280px; padding: 3px 4px 3px 10px; border-radius: 8px; background: var(--surface-2); font-size: 13px; }
.exp-file a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exp-share { flex-wrap: wrap; }
.exp-file form, .exp-share form, .page-head .actions form { margin: 0; }
label.exp-add { display: inline-flex; margin: 0; padding: 3px 9px; border: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent); border-radius: 8px; color: var(--accent); font-size: 13px; font-weight: 600; cursor: pointer; }
label.exp-add:hover { background: var(--accent-soft); }
tr.exp-missing td:first-child { box-shadow: inset 3px 0 0 #f59e0b; }
.exp-share input { flex: 1 1 320px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.exp-clip { margin-left: 4px; font-size: 12px; text-decoration: none; }
.exp-move form a.small { text-align: center; }
.exp-manual { margin-left: 6px; font-size: 11px; }
.exp-add-tx { padding: 14px 24px 18px; border-top: 1px solid var(--border); }
.exp-add-tx summary { color: var(--accent); font-size: 14px; font-weight: 600; cursor: pointer; }
.exp-tx-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: end; margin: 14px 0 6px; }
.exp-state { margin-left: 10px; color: var(--muted); font-size: 15px; font-weight: 500; vertical-align: middle; }
.share-head .btn { margin-left: auto; }
.exp-books { border-left: 4px solid #f59e0b; }
.exp-books.late { border-left-color: var(--danger); }
.exp-books p { margin: 0 0 10px; }
.exp-books-list { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 14px; }
.exp-books-list li { display: flex; justify-content: space-between; gap: 12px; }
@media (max-width: 800px) { .exp-tx-form { grid-template-columns: 1fr 1fr; } }
.exp-scroll::after { flex-shrink: 0; }

.exp-date form { margin: 0 0 2px; }
.exp-date input { width: 150px; padding: 5px 8px; font-size: 13px; }
.exp-hint { margin: -6px 24px 12px; }

.exp-inbox { border-left: 4px solid var(--accent); }
.exp-inbox-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); }
.exp-inbox-row form { margin: 0 0 0 auto; }
.exp-inbox-row select { max-width: 420px; }

/* Boekhouding: sleepvak, controleren, checklist */
.exp-drop { margin: 0 0 20px; }
.exp-drop label { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 20px; border: 2px dashed color-mix(in srgb, var(--accent) 35%, var(--border)); border-radius: var(--radius); background: var(--surface); text-align: center; cursor: pointer; transition: background .15s, border-color .15s; }
.exp-drop label strong { font-size: 16px; }
.exp-drop.over label, .exp-drop label:hover { border-color: var(--accent); background: var(--accent-soft); }
.exp-drop.busy label { opacity: .6; pointer-events: none; }
.exp-drop.busy label strong::after { content: ' … bezig met uploaden'; font-weight: 500; }
.exp-gmail { margin: 8px 2px 0; }
.exp-inline { font-size: inherit; color: var(--accent); padding: 0; }
.exp-review { border-left: 4px solid var(--accent); }
.exp-review .card-head { gap: 12px; }
.exp-review select { max-width: 460px; }
.exp-review input[type=date] { width: 150px; }
.exp-newtx { display: grid; grid-template-columns: 2fr 1fr 80px 1.4fr; gap: 6px; margin-top: 8px; max-width: 560px; }
.exp-del { display: inline-flex; align-items: center; gap: 4px; flex-direction: row; font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.exp-save-bar.pad { padding: 12px 24px 18px; margin: 0; }
.exp-state-cell { width: 28px; }
.exp-ok, .exp-no { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: 13px; font-weight: 700; }
.exp-ok { background: color-mix(in srgb, #22c55e 18%, white); color: #15803d; }
.exp-no { background: color-mix(in srgb, #f59e0b 20%, white); color: #b45309; }
.exp-expected td { background: color-mix(in srgb, #f59e0b 5%, transparent); }
.exp-monthly { display: flex; flex-direction: column; gap: 8px; padding: 16px 24px; border-top: 1px solid var(--border); }
.exp-monthly-add { margin: 0; }
.exp-monthly-add select { padding: 3px 8px; font-size: 13px; width: auto; }
.exp-gmail-settings { margin-top: 12px; }
.exp-gmail-settings summary { cursor: pointer; color: var(--muted); }
@media (max-width: 800px) { .exp-newtx { grid-template-columns: 1fr 1fr; } }
.exp-trash { padding: 16px 24px; }
.exp-trash summary { cursor: pointer; }
.exp-trash .exp-inbox-row form { margin: 0 0 0 auto; }

a.exp-ok { text-decoration: none; }

/* Af/bij */
.exp-in { color: #15803d; font-weight: 600; }
.exp-out { color: var(--ink, inherit); }
tr.exp-row-in td { background: color-mix(in srgb, #22c55e 6%, transparent); }
.exp-dir { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }

a.exp-no { text-decoration: none; }

a.exp-ok, .exp-check .exp-ok, .exp-crossed .exp-ok { background: #15803d; color: #fff; }
.exp-ok.exp-na { background: color-mix(in srgb, #22c55e 18%, white); color: #15803d; }

.exp-out { color: #b42328; }

/* Dropdowns: eigen pijltje met ruimte, in de stijl van de invoervelden */
select:not([multiple]) {
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a90a3' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  padding-right: 34px;
  cursor: pointer;
}
select:not([multiple]):hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--field)); }

/* Herhaal-label bij afspraken: zo smal als de tekst */
.appt-repeat { display: inline-flex !important; align-items: center; gap: 4px; width: fit-content !important; max-width: max-content; align-self: flex-start; padding: 1px 8px !important; font-size: 11px !important; line-height: 1.6; }

/* Afspraken: titel + herhaal-label op één regel, kolommen per week */
.appt-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.appt-head .appt-repeat { margin-left: 0; }
.appt-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.appt-col .appt { flex-wrap: wrap; gap: 6px 12px; }
.appt-col .appt .grow { flex: 1 1 0; }
.appt-col .appt-actions { width: 100%; padding-left: 64px; }
@media (max-width: 1100px) { .appt-cols { grid-template-columns: 1fr; } }

/* Afspraken-kolommen: niet hoger dan het scherm, scrollen met een zacht verloop */
.appt-scroll { max-height: max(320px, calc(100vh - 290px)); overflow-y: auto; overscroll-behavior: contain; margin-right: -8px; padding-right: 8px; }
.appt-scroll::after { content: ''; position: sticky; bottom: 0; display: block; height: 56px; margin-top: -56px; background: linear-gradient(to bottom, color-mix(in srgb, var(--surface) 0%, transparent), var(--surface) 90%); pointer-events: none; transition: opacity .2s; }
.appt-scroll.at-end::after { opacity: 0; }
@media (max-width: 1100px) { .appt-scroll { max-height: none; } }

/* Afspraken: Teams/Agenda als kleine tekstlinks */
.appt-actions { gap: 14px; align-items: center; }
.appt-actions .btn { padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; color: var(--accent); font-size: 13px; font-weight: 600; min-height: 0; }
.appt-actions .btn::after { content: ' ↗'; font-weight: 500; }
.appt-actions .btn:hover { background: none; text-decoration: underline; transform: none; }
.appt-col .appt-actions { padding-left: 64px; margin-top: 2px; }

/* Instellingen in tabbladen; naam in de zijbalk opent het profiel */
.settings-tabs { margin-bottom: 16px; }
.settings-form > .settings-section:not([hidden]) { margin-top: 0; }
.settings-form > [data-group]:not([hidden]) ~ .settings-section:not([hidden]) { margin-top: 18px; }
.me a.me-name { display: block; color: inherit; font-size: inherit; text-decoration: none; }
.me a.me-name:hover strong { text-decoration: underline; }

/* Verborgen tabbladen echt verbergen (labels hebben display:flex) */
.settings-form [hidden] { display: none !important; }

/* + Nieuw contact in deal- en afspraakformulier */
.qc { display: block; margin-top: 4px; font-weight: 400; }
.qc-open { padding: 0; color: var(--accent); font-size: 13px; font-weight: 600; }
.qc-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.qc-panel[hidden] { display: none; }
.qc-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; }
.qc-cancel { padding: 0; font-size: 13px; }

/* Afspraken die al geweest zijn (deze week) */
.appt-past { opacity: .45; }
.appt-past:hover { opacity: .8; }

/* Pipeline: alle kolommen even hoog (de hoogste bepaalt), en alle zes passen naast elkaar */
.board:not(#board) { align-items: stretch; grid-template-columns: repeat(6, minmax(190px, 1fr)); }
.board:not(#board) .column { display: flex; flex-direction: column; min-height: 300px; max-height: max(300px, calc(100vh - 230px)); }
.board:not(#board) .column .cards { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin: 0 -6px; padding: 0 6px 2px; }
@media (max-width: 800px) { .board:not(#board) { grid-template-columns: repeat(6, 62vw); } .board:not(#board) .column { min-height: 220px; } }

/* Takenbord: lijsten even hoog als de hoogste (maximaal het scherm), de hele lijst is sleepgebied */
#board.board { align-items: stretch; min-height: 0; }
#board .blist:not(.blist-new) .blist-cards { flex: 1; }
#board .blist-new { align-self: flex-start; }

/* Afspraken: week- en maandkalender */
.cal-bar { display: flex; align-items: center; gap: 16px; margin: 0 0 14px; flex-wrap: wrap; }
.cal-nav { display: flex; gap: 6px; }
.cal-title { margin: 0; font-size: 18px; }
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head span { padding: 10px 12px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--border); }
.cal-day { min-height: 112px; padding: 6px 8px 8px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day.other { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.cal-day.other .cal-num { color: var(--muted); }
.cal-num { align-self: flex-start; min-width: 24px; height: 24px; display: inline-grid; place-items: center; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--ink); text-decoration: none; }
.cal-num:hover { background: var(--surface-2); }
.cal-day.today .cal-num { background: var(--accent); color: #fff; }
.cal-ev { display: block; padding: 2px 6px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-size: 12px; line-height: 1.5; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-ev b { font-weight: 700; }
.cal-ev:hover { background: color-mix(in srgb, var(--accent) 18%, white); }
.cal-ev.past, .cal-blk.past { opacity: .45; }
.cal-more { font-size: 12px; color: var(--muted); text-decoration: none; padding-left: 6px; }
.cal-wk-head { display: grid; grid-template-columns: 56px repeat(7, minmax(0, 1fr)); background: var(--surface-2); border-bottom: 1px solid var(--border); }
.cal-wk-head span { padding: 10px 8px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.cal-wk-head span b { font-size: 16px; color: var(--ink); margin-left: 4px; }
.cal-wk-head span.today b { color: var(--accent); }
.cal-wk-body { position: relative; display: grid; grid-template-columns: 56px repeat(7, minmax(0, 1fr));
  background-image: repeating-linear-gradient(to bottom, var(--border) 0 1px, transparent 1px var(--hour)); }
.cal-hours { position: relative; }
.cal-hours span { position: absolute; right: 8px; transform: translateY(-50%); font-size: 11px; color: var(--muted); }
.cal-hours span:first-child { transform: none; }
.cal-col { position: relative; border-left: 1px solid var(--border); }
.cal-col.today { background: color-mix(in srgb, var(--accent) 4%, transparent); }
.cal-blk { position: absolute; left: 4px; right: 4px; overflow: hidden; padding: 4px 7px; border-radius: 8px; border-left: 3px solid var(--accent); background: var(--accent-soft); color: var(--ink); text-decoration: none; font-size: 12px; line-height: 1.35; display: flex; flex-direction: column; }
.cal-blk strong { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-blk small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-blk:hover { background: color-mix(in srgb, var(--accent) 18%, white); }
.cal-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 2; }
.cal-now::before { content: ''; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
@media (max-width: 800px) { .cal-day { min-height: 72px; padding: 4px; } .cal-ev b { display: none; } .cal-wk-head, .cal-wk-body { grid-template-columns: 40px repeat(7, minmax(0, 1fr)); } .cal-blk small { display: none; } }

/* Detailvenster van een afspraak */
.appt-dialog { width: min(520px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: var(--radius); box-shadow: 0 24px 64px rgba(43, 43, 45, .28); color: var(--ink); }
.appt-dialog::backdrop { background: rgba(43, 43, 45, .35); }
.appt-dlg { padding: 22px 24px; display: flex; flex-direction: column; gap: 10px; }
.appt-dlg header { display: flex; align-items: flex-start; gap: 12px; }
.appt-dlg header h2 { flex: 1; margin: 0; font-size: 18px; }
.appt-dlg-close { font-size: 22px; line-height: 1; }
.appt-dlg-when { margin: 0; color: var(--ink-soft); font-weight: 600; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.appt-dlg-when .appt-repeat { margin-left: 0; }
.appt-dlg-row { display: grid; grid-template-columns: 96px 1fr; gap: 10px; font-size: 14px; }
.appt-dlg-row > span { color: var(--muted); }
.appt-dlg-desc { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 14px; white-space: normal; }
.appt-dlg footer { display: flex; gap: 8px; margin-top: 6px; }
.appt-dlg-edit { margin-left: auto; }

/* Dashboard: uitgaven */
.exp-dash-nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.exp-dash-nums div { display: flex; flex-direction: column; gap: 2px; }
.exp-dash-nums strong { font-size: 18px; }
.exp-dash-sub { margin: 0 0 8px; }
@media (max-width: 800px) { .exp-dash-nums { grid-template-columns: 1fr 1fr; } }

/* Dashboard: omzet en uitgaven naast elkaar */
.dash-money { margin-bottom: 20px; }
.dash-money > .card { margin-bottom: 0; }
.dash-money > :only-child { grid-column: 1 / -1; }
.dash-money .exp-dash-nums { grid-template-columns: 1fr 1fr; }

/* Mobiel: balkjes met naam en bedrag op één regel, balk eronder over de volle breedte */
@media (max-width: 640px) {
  .bar-row, a.exp-link { grid-template-columns: minmax(0, 1fr) auto !important; grid-template-areas: "label value" "track track"; row-gap: 6px; }
  .bar-row > span:first-child { grid-area: label; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bar-row > .bar-track { grid-area: track; }
  .bar-row > .bar-value { grid-area: value; }
}

/* Mobiel: één kolom tegelijk in beeld, dus elke kolom zijn eigen hoogte (pipeline en takenbord) */
@media (max-width: 800px) {
  .board:not(#board), #board.board { align-items: flex-start; }
  .board:not(#board) .column { min-height: 140px; }
  #board .blist:not(.blist-new) .blist-cards { flex: none; }
}

/* Contracten: statusbolletje naast de naam op mobiel */
.ct-dot { display: none; }
@media (max-width: 800px) { .ct-dot { display: inline-block; width: 9px; height: 9px; margin-right: 7px; border-radius: 50%; background: var(--c); vertical-align: 1px; } }

/* Mobiel: alleen de pagina scrolt, kolommen zo lang als hun inhoud (geen scroll binnen een kolom) */
@media (max-width: 800px) {
  .board:not(#board) .column { max-height: none; }
  .board:not(#board) .column .cards { overflow: visible; }
  #board .blist { max-height: none; }
  #board .blist-cards { overflow: visible; }
}

/* Zijbalk: subtiele futuristische lijnen (raster in de blauwe gloed + langzaam glijdende lichtstrepen) */
.sidebar { isolation: isolate; clip-path: inset(0); }
.sidebar > * { position: relative; z-index: 1; }
.sidebar::before, .sidebar::after { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.sidebar::before {
  background:
    repeating-linear-gradient(115deg, rgba(129, 140, 248, .07) 0 1px, transparent 1px 26px),
    repeating-linear-gradient(25deg, rgba(129, 140, 248, .035) 0 1px, transparent 1px 52px);
  -webkit-mask-image: radial-gradient(130% 70% at 0% 0%, #000 0%, rgba(0, 0, 0, .35) 55%, transparent 85%);
  mask-image: radial-gradient(130% 70% at 0% 0%, #000 0%, rgba(0, 0, 0, .35) 55%, transparent 85%);
}
.sidebar::after {
  inset: -40% -60%;
  background:
    linear-gradient(115deg, transparent 46%, rgba(129, 140, 248, .16) 49.6%, rgba(165, 180, 252, .28) 50%, rgba(129, 140, 248, .16) 50.4%, transparent 54%),
    linear-gradient(115deg, transparent 62%, rgba(129, 140, 248, .10) 64.8%, rgba(165, 180, 252, .18) 65%, rgba(129, 140, 248, .10) 65.2%, transparent 68%);
  opacity: .55;
  animation: sidebar-sweep 22s linear infinite;
}
@keyframes sidebar-sweep {
  0% { transform: translate(-30%, -20%); }
  100% { transform: translate(30%, 20%); }
}
@media (prefers-reduced-motion: reduce) { .sidebar::after { animation: none; opacity: .3; } }

/* Zijbalk v2: lijnen in meerdere richtingen, elk met een eigen beweging */
.sidebar::before {
  background:
    repeating-linear-gradient(0deg, rgba(129, 140, 248, .045) 0 1px, transparent 1px 32px),
    repeating-linear-gradient(90deg, rgba(129, 140, 248, .045) 0 1px, transparent 1px 32px),
    repeating-linear-gradient(135deg, rgba(129, 140, 248, .05) 0 1px, transparent 1px 90px),
    repeating-linear-gradient(45deg, rgba(129, 140, 248, .035) 0 1px, transparent 1px 130px);
}
.sidebar::after {
  inset: 0;
  opacity: .6;
  background:
    linear-gradient(120deg, transparent 49.4%, rgba(165, 180, 252, .26) 50%, transparent 50.6%),
    linear-gradient(35deg, transparent 49.5%, rgba(165, 180, 252, .18) 50%, transparent 50.5%),
    linear-gradient(90deg, transparent 49.6%, rgba(165, 180, 252, .14) 50%, transparent 50.4%);
  background-size: 620px 980px, 760px 720px, 320px 100%;
  background-repeat: repeat;
  animation: sidebar-drift 30s linear infinite;
}
@keyframes sidebar-drift {
  0% { background-position: 0 0, 0 0, 0 0; }
  100% { background-position: 620px 980px, -760px 720px, 320px 0; }
}
@media (prefers-reduced-motion: reduce) { .sidebar::after { animation: none; opacity: .3; } }

/* Zijbalk v3: terug naar de eerste versie (één richting), met een naadloze loop:
   de strepen zijn een herhalend patroon dat per ronde precies één tegel opschuift. */
.sidebar::before {
  background:
    repeating-linear-gradient(115deg, rgba(129, 140, 248, .07) 0 1px, transparent 1px 26px),
    repeating-linear-gradient(25deg, rgba(129, 140, 248, .035) 0 1px, transparent 1px 52px);
}
.sidebar::after {
  inset: 0;
  opacity: .6;
  background:
    linear-gradient(to bottom right, transparent 49.3%, rgba(129, 140, 248, .16) 49.75%, rgba(165, 180, 252, .3) 50%, rgba(129, 140, 248, .16) 50.25%, transparent 50.7%),
    linear-gradient(to bottom right, transparent 49.5%, rgba(165, 180, 252, .16) 50%, transparent 50.5%);
  background-size: 470px 1000px, 705px 1500px;
  background-repeat: repeat;
  animation: sidebar-loop 24s linear infinite;
}
@keyframes sidebar-loop {
  0% { background-position: 0 0, 200px 300px; }
  100% { background-position: 470px 1000px, 905px 1800px; }
}
@media (prefers-reduced-motion: reduce) { .sidebar::after { animation: none; opacity: .3; } }

/* Zijbalk: strakkere strepen (dun, scherpe randen, zonder zachte gloed) */
.sidebar::after {
  opacity: .75;
  background:
    linear-gradient(to bottom right, transparent calc(50% - 1px), rgba(165, 180, 252, .34) calc(50% - 1px), rgba(165, 180, 252, .34) calc(50% + 0.5px), transparent calc(50% + 0.5px)),
    linear-gradient(to bottom right, transparent calc(50% - 0.5px), rgba(165, 180, 252, .2) calc(50% - 0.5px), rgba(165, 180, 252, .2) calc(50% + 0.5px), transparent calc(50% + 0.5px));
  background-size: 470px 1000px, 705px 1500px;
  background-repeat: repeat;
}

/* Zijbalk: strepen tussen zacht en strak (dunne kern met een smalle gloed) */
.sidebar::after {
  opacity: .7;
  background:
    linear-gradient(to bottom right, transparent calc(50% - 6px), rgba(129, 140, 248, .12) calc(50% - 1.5px), rgba(165, 180, 252, .32) calc(50% - 0.5px), rgba(165, 180, 252, .32) calc(50% + 0.5px), rgba(129, 140, 248, .12) calc(50% + 1.5px), transparent calc(50% + 6px)),
    linear-gradient(to bottom right, transparent calc(50% - 4px), rgba(129, 140, 248, .08) calc(50% - 1px), rgba(165, 180, 252, .2) 50%, rgba(129, 140, 248, .08) calc(50% + 1px), transparent calc(50% + 4px));
  background-size: 470px 1000px, 705px 1500px;
  background-repeat: repeat;
}

/* Checklist: factuurdatum/maand wijzigen */
.exp-paid { position: relative; }
.exp-month-pick { display: inline-block; margin-right: 6px; }
.exp-month-pick summary { list-style: none; cursor: pointer; color: var(--muted); padding: 0 4px; border-radius: 6px; }
.exp-month-pick summary::-webkit-details-marker { display: none; }
.exp-month-pick summary:hover, .exp-month-pick[open] summary { color: var(--accent); background: var(--surface-2); }
.exp-month-pick form { position: absolute; left: 0; top: calc(100% - 6px); z-index: 20; width: 260px; display: flex; flex-direction: column; gap: 8px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 32px rgba(43, 43, 45, .16); white-space: normal; }

/* Onderhoud per maand */
.mt-nav{display:flex;align-items:center;gap:10px}
.mt-nav strong{min-width:130px;text-align:center}
.mt-head-actions{display:flex;gap:8px;flex-wrap:wrap}
.mt-table td{vertical-align:middle}
.mt-table input[type=checkbox]{width:18px;height:18px;accent-color:#1f9d55;cursor:pointer}
.mt-table input[type=date]{min-width:140px}
.mt-table input[type=text]{width:100%;min-width:200px}
.mt-table tr.mt-ok td{background:rgba(31,157,85,.05)}
.mt-save{display:flex;justify-content:flex-end}
.mt-year-wrap{overflow-x:auto}
.mt-year th,.mt-year td{text-align:center;white-space:nowrap}
.mt-year th:first-child,.mt-year td:first-child{text-align:left}
.mt-year th a{color:inherit}
.mt-year .mt-cur{background:rgba(250, 201, 33,.06)}
.mt-year .exp-dot{display:inline-block;margin:0}
/* AI-assistent */
.ai-fab{position:fixed;right:20px;bottom:20px;z-index:40;width:52px;height:52px;border:0;border-radius:50%;display:grid;place-items:center;background:var(--accent);color:#fff;cursor:pointer;box-shadow:0 6px 20px rgba(43, 43, 45,.22)}
.ai-fab:hover{background:var(--accent-2)}
.ai-fab svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.ai-panel{position:fixed;right:20px;bottom:84px;z-index:41;width:min(440px,calc(100vw - 32px));height:min(620px,calc(100vh - 110px));display:flex;flex-direction:column;overflow:hidden;background:var(--surface);border:1px solid var(--field);border-radius:var(--radius);box-shadow:0 12px 40px rgba(43, 43, 45,.2)}
.ai-panel[hidden]{display:none}
.ai-panel header{display:flex;align-items:center;gap:12px;padding:12px 16px;border-bottom:1px solid var(--border)}
.ai-panel header strong{flex:1}
.ai-close{border:0;background:none;font-size:22px;line-height:1;color:var(--muted);cursor:pointer;padding:0 2px}
.ai-log{flex:1;overflow-y:auto;padding:16px;display:flex;flex-direction:column;gap:10px}
.ai-msg{max-width:92%;padding:9px 13px;border-radius:12px;font-size:14px;overflow-wrap:anywhere}
.ai-msg p{margin:0 0 6px}
.ai-msg p:last-child{margin-bottom:0}
.ai-msg ul{margin:0 0 6px;padding-left:18px}
.ai-user{align-self:flex-end;background:var(--accent);color:#fff;white-space:pre-wrap}
.ai-assistant{align-self:flex-start;background:var(--surface-2)}
.ai-wait{align-self:flex-start;color:var(--muted);font-style:italic}
.ai-error{align-self:flex-start;background:#fdecec;color:var(--danger)}
.ai-tbl{overflow-x:auto;margin:0 0 6px}
.ai-tbl table{border-collapse:collapse;font-size:13px}
.ai-tbl th,.ai-tbl td{padding:4px 10px 4px 0;border-bottom:1px solid var(--border);text-align:left;white-space:nowrap}
.ai-action{align-self:stretch;display:flex;flex-wrap:wrap;align-items:center;gap:10px;padding:10px 12px;border:1px solid var(--field);border-radius:12px;font-size:14px}
.ai-action p{flex:1 0 100%;margin:0}
.ai-form{display:flex;align-items:flex-end;gap:8px;padding:12px;border-top:1px solid var(--border)}
.ai-form textarea{flex:1;min-height:38px;max-height:120px;resize:none;margin:0}
@media (max-width:640px){.ai-fab{right:16px;bottom:16px}.ai-panel{right:16px;bottom:78px;height:calc(100dvh - 150px)}}
/* Uren: totaal naast de klant-tabs */
.tabs .tabs-total{margin-left:6px;padding:2px 16px;border-left:1px solid var(--field);font-size:13px;font-weight:400;color:var(--muted);white-space:nowrap;align-self:center;flex:none;order:1}

/* Zijbalk: navigatieknoppen als Liquid Glass (glas over de lijnen; padding 1px kleiner vanwege de rand) */
.sidebar nav a {
  position: relative; isolation: isolate; padding: 9px 11px;
  border: 1px solid transparent;
  transition: background .25s, border-color .25s, box-shadow .25s, color .2s, transform .15s;
}
.sidebar nav a:hover {
  color: #fff;
  background: linear-gradient(135deg, rgba(255, 255, 255, .13), rgba(255, 255, 255, .04));
  border-color: rgba(255, 255, 255, .14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 4px 14px rgba(0, 0, 0, .18);
  -webkit-backdrop-filter: blur(10px) saturate(160%); backdrop-filter: blur(10px) saturate(160%);
}
.sidebar nav a.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(199, 210, 254, .28) 0%, rgba(129, 140, 248, .18) 45%, rgba(250, 201, 33, .14) 100%);
  border-color: rgba(199, 210, 254, .34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .38), inset 0 -1px 0 rgba(255, 255, 255, .06), inset 0 0 18px rgba(165, 180, 252, .16), 0 6px 20px rgba(10, 12, 40, .45);
  -webkit-backdrop-filter: blur(14px) saturate(180%); backdrop-filter: blur(14px) saturate(180%);
}
.sidebar nav a.active::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; z-index: -1; pointer-events: none;
  background: radial-gradient(120% 100% at 15% 0%, rgba(255, 255, 255, .26), transparent 55%);
}
.sidebar nav a:active { transform: scale(.98); }
@media (prefers-reduced-motion: reduce) { .sidebar nav a { transition: none; } .sidebar nav a:active { transform: none; } }
/* Mobiel: snelmenu onderin (Liquid Glass). Het zijmenu blijft via ☰ bereikbaar. */
.tabbar { display: none; }
@media (max-width: 800px) {
  .tabbar {
    display: flex; gap: 2px; position: fixed; z-index: 18;
    left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    padding: 6px; border-radius: 26px;
    background: linear-gradient(135deg, rgba(255, 255, 255, .72), rgba(255, 255, 255, .5));
    border: 1px solid rgba(255, 255, 255, .8);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), 0 1px 2px rgba(43, 43, 45, .06), 0 12px 32px rgba(43, 43, 45, .16);
    -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
  }
  .tabbar a, .tabbar button {
    flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 7px 2px 6px; border: 1px solid transparent; border-radius: 20px; background: none; cursor: pointer;
    color: var(--ink-soft); font-family: inherit; font-size: 10.5px; font-weight: 500; line-height: 1.15; letter-spacing: -.01em;
    white-space: nowrap; -webkit-tap-highlight-color: transparent; transition: background .2s, color .2s, transform .15s;
  }
  .tabbar span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .tabbar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar a.active {
    color: var(--accent);
    background: linear-gradient(135deg, rgba(250, 201, 33, .16), rgba(250, 201, 33, .07));
    border-color: rgba(250, 201, 33, .16);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 2px 8px rgba(250, 201, 33, .12);
  }
  .tabbar a:active, .tabbar button:active { transform: scale(.94); }
  .has-nav .main { padding-bottom: calc(112px + env(safe-area-inset-bottom, 0px)); }
  /* De assistent opent via het snelmenu; de losse knop is dan niet nodig. */
  .tabbar ~ #ai-chat .ai-fab { display: none; }
  .tabbar ~ #ai-chat .ai-panel { bottom: calc(92px + env(safe-area-inset-bottom, 0px)); height: calc(100dvh - 176px); }
}
@media (max-width: 360px) { .tabbar { left: 8px; right: 8px; padding: 5px; } .tabbar a, .tabbar button { font-size: 10px; padding-left: 3px; padding-right: 3px; letter-spacing: -.02em; } }
@media (max-width: 800px) and (prefers-reduced-motion: reduce) { .tabbar a, .tabbar button { transition: none; } .tabbar a:active, .tabbar button:active { transform: none; } }
@media print { .tabbar { display: none !important; } }
/* Mobiel: invoervelden minimaal 16px, anders zoomt iOS in bij focus (pagina verschuift). Assistent over de volle breedte. */
@media (max-width: 800px) {
  input, select, textarea { font-size: 16px !important; }
  .kdialog-head input { font-size: 18px !important; }
  #ai-chat .ai-panel { left: 12px; right: 12px; width: auto; }
  .ai-log table { display: block; max-width: 100%; overflow-x: auto; }
}

/* ---------- Human Impact ---------- */
h1, h2, .stat strong, .brand { font-family: "Bitter", Georgia, serif; letter-spacing: 0; }
h1 { font-weight: 700; }
.eyebrow { color: #8a6a00; letter-spacing: .12em; }
.sidebar { background: radial-gradient(120% 60% at 0% 0%, #45443f 0%, var(--ink) 55%); }
.sidebar nav a.active { background: rgba(250, 201, 33, .16); color: #fff; box-shadow: inset 0 0 0 1px rgba(250, 201, 33, .45); }
.sidebar nav a.active svg { color: var(--brand); }
.brand-logo { width: 132px; }
.avatar { background: var(--brand); color: var(--ink); }
.btn-primary, .btn-primary:hover { background: var(--brand); color: var(--ink); box-shadow: 0 8px 22px rgba(250, 201, 33, .35); }
.btn-primary:hover { background: var(--brand-2); }
.tabbar a.active, .tabbar a[aria-current] { color: var(--accent); }
.ai-fab { background: var(--brand) !important; color: var(--ink) !important; }

/* Uren: één vak per tijdveld met "Nu" erin, kiezer voor de persoon in de kop */
#hours-rows .hrow.with-activity { grid-template-columns: 150px 150px 150px 84px 180px minmax(160px, 1fr) 30px; }
#hours-rows .time-cell { position: relative; align-items: center; gap: 0; border: 1px solid var(--field); border-radius: 12px; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
#hours-rows .time-cell:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--accent-soft); }
#hours-rows .time-cell input { flex: 1; border: 0; background: transparent; box-shadow: none; padding-right: 4px; }
#hours-rows .time-cell input:focus { box-shadow: none; }
#hours-rows .time-cell .nu { margin-right: 6px; padding: 4px 9px; border: 0; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 700; line-height: 1.4; }
#hours-rows .time-cell .nu:hover:not(:disabled) { background: var(--brand); color: var(--ink); }
#hours-rows input:focus, .hours-who select:focus { border-color: var(--brand); }
#hours-rows [data-remove] { color: var(--muted); }
#hours-rows .hrow-actions [data-total] { font-weight: 600; color: var(--ink-soft); }
.hours-head-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.hours-who { flex-direction: row; align-items: center; gap: 8px; margin: 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.hours-who select { width: auto; min-width: 170px; padding-top: 7px; padding-bottom: 7px; border-radius: 999px; font-weight: 600; color: var(--ink); }
@media (max-width: 800px) {
  #hours-rows .hrow.with-activity { grid-template-columns: 1fr 1fr; }
  .hours-head-right { width: 100%; justify-content: space-between; }
}

/* Gele tegel (bijv. Totaal over te maken bij een fonds) */
.stat.stat-yellow { background: var(--brand); border-color: var(--brand); color: var(--ink); }
.stat.stat-yellow span, .stat.stat-yellow small { color: rgba(43, 43, 45, .7); }
.stat.stat-yellow strong { color: var(--ink); }
