:root {
  --bg: #F5F7FB;
  --surface: #FFFFFF;
  --ink: #10151F;
  --muted: #5B6472;
  --line: #E3E6ED;

  --brand: #1868C7;
  --brand-dark: #0F4F9C;
  --brand-soft: #EAF2FC;

  --status-not_due: #16915F;
  --status-due_soon: #D69E14;
  --status-overdue: #D8432B;

  /* aliassen: bestaande kleurnamen gekoppeld aan de nieuwe status-kleuren,
     zodat oudere regels verderop zonder wijziging blijven kloppen */
  --tier-early: var(--status-due_soon);
  --tier-mid: var(--status-overdue);
  --tier-late: #A6301C;
  --confirm: var(--status-not_due);

  --radius: 12px;
  --radius-sm: 8px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(16, 21, 31, .05);
  --shadow-md: 0 10px 28px rgba(16, 21, 31, .10);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

.mono {
  font-family: "IBM Plex Mono", monospace;
  font-variant-numeric: tabular-nums;
}

a { transition: color .15s ease, border-color .15s ease; }
button, input, select { transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .1s ease; }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.page { animation: fadeSlideUp .5s cubic-bezier(.16, 1, .3, 1) both; }
@media (prefers-reduced-motion: reduce) {
  .page { animation: none; }
}

/* Topbar */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 32px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  position: relative;
  z-index: 1;
}
.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, var(--brand), var(--brand-soft) 60%, transparent);
  opacity: .8;
}
.topbar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.015em;
}
.topbar__logo {
  height: 32px;
  width: auto;
  display: block;
}
.topbar__user {
  display: flex;
  gap: 20px;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
}
.topbar__user a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  font-weight: 500;
}
.topbar__user a:hover { color: var(--brand); border-color: var(--brand); }

.icon-link, .logout-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--muted);
  border: none !important;
}
.icon-link:hover {
  color: var(--brand);
  background: var(--brand-soft);
}
.logout-icon {
  color: var(--muted);
}
.logout-icon:hover {
  color: var(--tier-mid);
  background: rgba(216, 67, 43, 0.1);
}

.page {
  max-width: 1040px;
  margin: 0 auto;
  padding: 32px;
}

/* Flash messages */
.flash-stack { margin-bottom: 20px; display: flex; flex-direction: column; gap: 8px; }
.flash {
  padding: 12px 16px;
  border-left: 3px solid var(--muted);
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  font-size: 14px;
}
.flash--error { border-color: var(--tier-mid); color: var(--tier-mid); }
.flash--success { border-color: var(--confirm); color: var(--confirm); }

/* Login */
.login-screen {
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(600px 300px at 15% 10%, var(--brand-soft), transparent 60%),
    radial-gradient(500px 260px at 85% 90%, var(--brand-soft), transparent 60%);
}
.login-card {
  width: 380px;
  padding: 44px 36px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.login-card__logo {
  height: 76px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
  margin: 0 auto 20px;
}
.login-card h1 {
  margin: 0 0 4px;
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
}
.login-card__sub {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}
.login-card label {
  font-size: 13px;
  color: var(--muted);
  margin-top: 12px;
}
.login-card input {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-family: inherit;
  font-size: 14px;
  margin-top: 4px;
}
.login-card input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
  outline: none;
}
.login-card button {
  margin-top: 22px;
  padding: 11px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
}
.login-card button:hover { background: var(--brand-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); }

/* Summary strip + filter */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  padding-bottom: 24px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.summary {
  display: flex;
  gap: 40px;
}
.summary__stat { display: flex; flex-direction: column; }
.summary__number {
  font-family: "IBM Plex Mono", monospace;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.summary__label {
  color: var(--muted);
  font-size: 13px;
}

.salesperson-filter {
  display: flex;
  align-items: center;
  gap: 8px;
}
.salesperson-filter label {
  font-size: 13px;
  color: var(--muted);
}
.salesperson-filter select {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
}
.salesperson-filter select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
  outline: none;
}

/* Toolbar: zoekveld + printknop */
.dashboard-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--muted);
  flex: 1;
  max-width: 320px;
}
.search-field:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.search-field input {
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  background: transparent;
  width: 100%;
}
.overdue-filter {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
}
.overdue-filter:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
  outline: none;
}
.print-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.print-button:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.bulk-send-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--brand);
  border: 1px solid var(--brand);
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.bulk-send-button:hover:not(:disabled) {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.bulk-send-button:disabled {
  background: var(--surface);
  border-color: var(--line);
  color: var(--line);
  cursor: not-allowed;
}

.bulk-checkbox {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--brand);
  cursor: pointer;
  flex-shrink: 0;
}

/* Zijbalk (hoofdmenu links, inklapbaar tot enkel icoontjes) */
.app-shell {
  display: flex;
  min-height: 100vh;
  align-items: stretch;
}
.app-main {
  flex: 1;
  min-width: 0;
}
.sidebar {
  --sidebar-width: 252px;
  width: var(--sidebar-width);
  flex: 0 0 var(--sidebar-width);
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  z-index: 5;
  transition: width .2s ease, flex-basis .2s ease;
  overflow: hidden;
}
.sidebar__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 16px 12px 12px 16px;
  border-bottom: 1px solid var(--line);
  min-height: 65px;
}
.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.015em;
  line-height: 1.2;
}
.sidebar__logo { height: 30px; width: auto; flex-shrink: 0; display: block; }
.sidebar__toggle {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.sidebar__toggle:hover { background: var(--brand-soft); color: var(--brand); }
.sidebar__toggle svg { transition: transform .2s ease; }
.sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar__foot {
  padding: 10px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar__link {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 40px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  border: none;
}
.sidebar__link:hover { background: var(--brand-soft); color: var(--brand); }
.sidebar__link.is-active {
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--brand);
}
.sidebar__link--logout:hover { background: rgba(216, 67, 43, 0.1); color: var(--tier-mid); }
.sidebar__icon { flex: 0 0 20px; display: inline-flex; align-items: center; justify-content: center; }
.sidebar__label { overflow: hidden; text-overflow: ellipsis; }

.sidebar-collapsed .sidebar { --sidebar-width: 68px; }
.sidebar-collapsed .sidebar__label { display: none; }
.sidebar-collapsed .sidebar__head { flex-direction: column; justify-content: center; padding: 12px 0; gap: 8px; }
.sidebar-collapsed .sidebar__brand { justify-content: center; }
.sidebar-collapsed .sidebar__logo { height: 26px; }
.sidebar-collapsed .sidebar__toggle svg { transform: rotate(180deg); }
.sidebar-collapsed .sidebar__link { justify-content: center; padding: 0; }
@media (prefers-reduced-motion: reduce) {
  .sidebar, .sidebar__toggle svg { transition: none; }
}
@media print {
  .sidebar { display: none !important; }
}

@media print {
  .topbar, .dashboard-toolbar, .status-legend, .test-mode-banner,
  .customer-card__footer, .no-print { display: none !important; }
  body { background: #fff; }
  .page { max-width: 100%; padding: 0; animation: none; }
  .customer-card {
    box-shadow: none;
    border: 1px solid #ccc;
    break-inside: avoid;
    margin-bottom: 8px;
  }
  .customer-card:hover { transform: none; box-shadow: none; }
}

/* Customer cards */
.customer-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.customer-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow .2s ease, transform .2s ease;
}
.customer-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.customer-card { border-left: 3px solid transparent; }
.customer-card.status-not_due { border-left-color: var(--status-not_due); }
.customer-card.status-due_soon { border-left-color: var(--status-due_soon); }
.customer-card.status-overdue { border-left-color: var(--status-overdue); }

/* Status legend */
.status-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--muted);
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.status-dot-not_due { background: var(--status-not_due); }
.status-dot-due_soon { background: var(--status-due_soon); }
.status-dot-overdue { background: var(--status-overdue); }

.status-text-overdue { color: var(--status-overdue); }

/* "Aandacht vereist"-icoontje: vervallen facturen waarvoor de laatste
   herinnering al 15+ (waarschuwing) of 30+ dagen (kritiek) geleden is. */
.attention-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  vertical-align: middle;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.6;
  cursor: help;
}
.attention-badge svg { flex-shrink: 0; }
.attention-badge--warning {
  color: var(--status-due_soon);
  background: rgba(214, 158, 20, 0.12);
  border: 1px solid rgba(214, 158, 20, 0.35);
}
.attention-badge--critical {
  color: #FFFFFF;
  background: var(--status-overdue);
  border: 1px solid var(--status-overdue);
  animation: attention-pulse 1.8s ease-in-out infinite;
}
.attention-badge__label {
  white-space: nowrap;
}
@keyframes attention-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(216, 67, 43, 0.45); }
  50% { box-shadow: 0 0 0 4px rgba(216, 67, 43, 0); }
}
/* Legende-versie: kleiner, zonder tekstlabel en zonder animatie */
.status-legend .attention-badge {
  margin-left: 0;
  padding: 3px;
  animation: none;
}
@media print {
  .attention-badge { animation: none; }
}

/* Status badge per factuur */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px 3px 8px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.status-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}
.status-badge-not_due {
  color: var(--status-not_due);
  background: rgba(22, 145, 95, 0.12);
}
.status-badge-due_soon {
  color: var(--status-due_soon);
  background: rgba(214, 158, 20, 0.14);
}
.status-badge-overdue {
  color: var(--status-overdue);
  background: rgba(216, 67, 43, 0.12);
}

.customer-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}
.customer-card__header-left {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.customer-card__name {
  font-weight: 600;
  font-size: 15px;
}

.unreconciled-block {
  padding: 10px 20px 4px;
  background: rgba(22, 145, 95, 0.06);
  border-bottom: 1px solid var(--line);
}
.unreconciled-block__title {
  font-size: 12px;
  font-weight: 600;
  color: var(--status-not_due);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
}
.unreconciled-block__title .cell-sub {
  font-weight: 400;
}
.payments-subtable th,
.payments-subtable td { padding-left: 0; padding-right: 16px; }
.payments-subtable tfoot td {
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-weight: 600;
  font-size: 13px;
}
.amount-positive { color: var(--status-not_due); }
.amount-negative { color: var(--status-overdue); }

.customer-card__totals {
  text-align: right;
}

.invoice-subtable {
  width: 100%;
  border-collapse: collapse;
}
.invoice-subtable th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  padding: 10px 16px 6px;
  white-space: nowrap;
}
.invoice-subtable td {
  padding: 7px 16px;
  font-size: 13px;
  vertical-align: middle;
}
.invoice-subtable tbody tr:last-child td { padding-bottom: 14px; }

.customer-card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.customer-card__footer-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.customer-card__footer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.customer-card__footer-actions .button-secondary {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
}
.customer-card__footer-actions .button-secondary:hover:not(:disabled) {
  background: var(--bg);
  border-color: var(--brand-soft);
  color: var(--brand);
}
.history-link {
  font-size: 12px;
  color: var(--brand);
  text-decoration: none;
  width: fit-content;
  font-weight: 500;
}
.history-link:hover { color: var(--brand-dark); text-decoration: underline; }

/* Customer history page */
.back-link {
  display: inline-block;
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
}
.back-link:hover { color: var(--brand); }

.history-title {
  font-size: 21px;
  font-weight: 700;
  margin: 0 0 24px;
  letter-spacing: -0.015em;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.history-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
  transition: box-shadow .2s ease, transform .2s ease;
}
.history-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.history-item__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.history-item__date {
  font-weight: 600;
  font-size: 14px;
}
.history-item__invoices {
  margin-top: 8px;
}
.history-item__attachments {
  margin-top: 4px;
}
.test-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  color: var(--status-due_soon);
  background: rgba(214, 158, 20, 0.14);
}

.history-item__email {
  margin-top: 12px;
}
.history-item__email summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--brand);
  font-weight: 500;
}
.history-item__email summary:hover { color: var(--brand-dark); }
.email-copy {
  margin-top: 12px;
  padding: 14px 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--brand-soft);
}
.email-copy__subject {
  font-size: 13px;
  margin-bottom: 10px;
}
.email-copy__body {
  font-family: "Inter", sans-serif;
  font-size: 13px;
  white-space: pre-wrap;
  word-wrap: break-word;
  margin: 0;
  color: var(--ink);
}

.cell-title { font-weight: 500; }
.cell-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.amount { font-weight: 500; }

.invoice-link {
  color: var(--brand);
  text-decoration: none;
  border-bottom: 1px dashed var(--brand-soft);
}
.invoice-link:hover {
  color: var(--brand-dark);
  border-bottom-color: var(--brand-dark);
}

.badge {
  display: inline-block;
  font-size: 11px;
  color: var(--muted);
}

.customer-card__footer button {
  padding: 9px 16px;
  background: var(--brand);
  border: 1px solid var(--brand);
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.customer-card__footer button:hover:not(:disabled) {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.customer-card__footer button:disabled {
  background: var(--surface);
  border-color: var(--line);
  color: var(--line);
  cursor: not-allowed;
}

.empty-state {
  padding: 60px 0;
  text-align: center;
  color: var(--muted);
}

.test-mode-banner {
  padding: 12px 16px;
  margin-bottom: 20px;
  background: #FBF0E9;
  border-left: 3px solid var(--tier-mid);
  border-radius: var(--radius-sm);
  color: var(--tier-mid);
  font-size: 14px;
}
.test-mode-banner a {
  color: var(--tier-mid);
  text-decoration: underline;
  margin-left: 8px;
}

/* Settings page */
.settings-card {
  max-width: 480px;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.settings-card h1 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.settings-card__sub {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}
.settings-card label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-top: 16px;
}
.settings-card input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-family: inherit;
  font-size: 14px;
  margin-top: 4px;
}
.settings-card input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
  outline: none;
}
.settings-card__hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}
.settings-card__actions {
  margin-top: 24px;
}
.settings-card button {
  padding: 10px 20px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}
.settings-card button:hover { background: var(--brand-dark); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.settings-card button.secondary {
  background: var(--surface);
  color: var(--brand);
  border: 1px solid var(--brand);
  font-weight: 500;
}
.settings-card button.secondary:hover {
  background: var(--brand-soft);
  transform: translateY(-1px);
  box-shadow: none;
}
.settings-card select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-family: inherit;
  font-size: 14px;
  margin-top: 4px;
  color: var(--ink);
}
.settings-card select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
  outline: none;
}

.provider-info {
  margin-top: 14px;
  padding: 14px 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--confirm);
  font-size: 13px;
  line-height: 1.6;
}
.provider-info p { margin: 0 0 8px; }
.provider-info ol { margin: 0; padding-left: 20px; }
.provider-info li { margin-bottom: 6px; }
.provider-info code {
  font-family: "IBM Plex Mono", monospace;
  background: var(--line);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 12px;
}
.provider-info a { color: var(--confirm); }

.settings-card__test {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.settings-card__test label {
  margin-top: 0;
}

/* Settings tabs */
.settings-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.settings-tabs a {
  padding: 10px 4px;
  margin-right: 24px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
}
.settings-tabs a:hover { color: var(--brand); }
.settings-tabs a.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

.settings-card--wide {
  max-width: 640px;
  margin-bottom: 20px;
}

.settings-card--test-mode {
  max-width: 480px;
  border-color: var(--tier-early);
}
.settings-card--test-mode.is-active {
  border-left: 3px solid var(--tier-mid);
  background: #FBF0E9;
}
.settings-card--test-mode h1 {
  color: var(--tier-mid);
}

/* User management */
.user-form__row {
  display: flex;
  gap: 20px;
}
.user-form__row > div { flex: 1; }
.user-form input[disabled] {
  color: var(--muted);
  background: var(--line);
}
.checkbox-label {
  display: flex !important;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 14px;
  color: var(--ink);
}
.checkbox-label input { width: auto; margin: 0; }

.radio-label {
  display: flex !important;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 14px;
  color: var(--ink);
}
.radio-label input { width: auto; margin: 0; }

.user-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.user-row {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}
.user-row .user-form { flex: 1; }
.user-row__actions {
  margin-top: 16px;
}
.user-row__delete {
  padding-bottom: 2px;
}
button.danger {
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--tier-mid);
  border-radius: var(--radius-sm);
  color: var(--tier-mid);
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
}
button.danger:hover:not(:disabled) {
  background: var(--tier-mid);
  color: #fff;
  transform: translateY(-1px);
}
button.danger:disabled {
  border-color: var(--line);
  color: var(--line);
  cursor: not-allowed;
}

/* Financieel overzicht */
.page-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 0 24px;
}

.financial-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.financial-summary__card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.financial-summary__label {
  font-size: 12px;
  color: var(--muted);
}
.financial-summary__amount {
  font-family: "IBM Plex Mono", monospace;
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
}
.financial-summary__amount-sub {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  font-weight: 500;
  color: var(--status-overdue);
}
.financial-summary__amount-sub--neutral {
  color: var(--muted);
}
.financial-summary__breakdown {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.financial-summary__breakdown-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  color: var(--muted);
}
.financial-summary__breakdown-row .mono {
  color: var(--ink);
}

.financial-section {
  margin-bottom: 40px;
}
.financial-section__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.financial-section__title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
}
.financial-subtitle {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .03em;
  margin: 0 0 10px;
}
.financial-section__header .financial-section__title { margin-bottom: 0; }

.view-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.view-toggle a {
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  background: var(--surface);
}
.view-toggle a.active {
  background: var(--brand);
  color: #fff;
}
.view-toggle a:not(.active):hover { color: var(--brand); }

.chart-container {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  margin-bottom: 12px;
}

.financial-table-details summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--brand);
  font-weight: 500;
}
.financial-table-details summary:hover { color: var(--brand-dark); }
.financial-table-details[open] summary { margin-bottom: 12px; }

.table-scroll {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.financial-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.financial-table th {
  text-align: right;
  white-space: nowrap;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  text-transform: uppercase;
  letter-spacing: .03em;
}
.financial-table td {
  text-align: right;
  white-space: nowrap;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
}
.financial-table tbody tr:last-child td { border-bottom: none; }
.financial-table th.txt, .financial-table td.txt { text-align: left; }
.financial-table .negative { color: var(--status-overdue); }

.income-statement__account-col,
.income-statement td:first-child {
  text-align: left;
  white-space: normal;
  min-width: 220px;
}
.income-statement__group-row td {
  background: var(--bg);
  font-weight: 600;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.income-statement__subgroup-row { cursor: pointer; }
.income-statement__subgroup-row td {
  font-weight: 600;
  background: rgba(24, 104, 199, 0.04);
}
.income-statement__subgroup-row:hover td { background: rgba(24, 104, 199, 0.09); }
.income-statement__subgroup-row:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.income-statement__subgroup-row .group-toggle {
  display: inline-block;
  width: 12px;
  transition: transform .15s ease;
}
.income-statement__subgroup-row.is-open .group-toggle { transform: rotate(90deg); }
.income-statement__group-child td:first-child { padding-left: 32px; }
.income-statement__class-row td {
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 600;
}
.income-statement__subtotal-row td {
  font-weight: 600;
  border-top: 1px solid var(--line);
  border-bottom: 2px solid var(--line);
}
.income-statement__result-row td {
  font-weight: 700;
  font-size: 14px;
  background: var(--brand-soft);
  color: var(--brand-dark);
}

/* Dashboard (startpagina) */
.page-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}
.page-header-row .page-title { margin-bottom: 0; }

.google-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  margin-bottom: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
  color: var(--muted);
}
.google-search-bar input {
  flex: 1;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  background: transparent;
}
.google-search-bar button {
  padding: 8px 18px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.google-search-bar button:hover { background: var(--brand-dark); }

.quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.quick-link-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  transition: box-shadow .2s ease, transform .2s ease;
}
.quick-link-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.quick-link-card__title {
  font-weight: 700;
  color: var(--ink);
  font-size: 15px;
}
.quick-link-card__sub {
  font-size: 13px;
  color: var(--muted);
}

.home-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.home-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px 22px;
}
.home-panel__title {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 14px;
  letter-spacing: -0.01em;
}
.home-panel__placeholder {
  padding: 24px 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
}
.home-panel__placeholder p { margin: 0; }

.news-add-details { margin-bottom: 16px; }
.news-add-details summary {
  cursor: pointer;
  list-style: none;
  display: inline-flex;
}
.news-add-details summary::-webkit-details-marker { display: none; }
.news-add-form {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.news-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.news-list__item {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.news-list__item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.news-list__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.news-list__title {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
}
.news-list__content {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--ink);
  line-height: 1.5;
  white-space: pre-line;
}
.news-list__delete {
  margin-top: 8px;
}

/* Personeel */
/* Alle kolommen volledig zichtbaar, zonder horizontale schuifbalk: de tekst
   mag op meerdere regels, en de tabel past zich aan de breedte aan. */
.table-scroll--fit { overflow-x: visible; }
.staff-table { table-layout: auto; }
.staff-table th, .staff-table td {
  white-space: normal;
  padding-left: 10px;
  padding-right: 10px;
  overflow-wrap: anywhere;
}
.staff-table th { vertical-align: bottom; }
.staff-table td { vertical-align: middle; }
.staff-table td button { white-space: nowrap; }
.staff-table .status-badge { white-space: nowrap; }
.staff-table td:first-child, .staff-table th:first-child { min-width: 0; }

/* To-do's */
.todo-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0 16px;
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.task-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border-left: 3px solid var(--line);
}
.task-card--overdue { border-left-color: var(--status-overdue); }
.task-card--done { border-left-color: var(--status-not_due); opacity: 0.7; }
.task-card--done .task-card__title { text-decoration: line-through; }

.task-card__summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  cursor: pointer;
  list-style: none;
}
.task-card__summary::-webkit-details-marker { display: none; }
.task-card__main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.task-card__title {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
}
.task-card__meta {
  flex-shrink: 0;
}

.task-card__body {
  padding: 0 20px 20px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.task-card__actions {
  display: flex;
  gap: 10px;
  margin: 12px 0 4px;
}
.task-card__edit-form {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
}

.home-todo-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.home-todo-list__item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.home-todo-list__item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.home-todo-list__title {
  font-weight: 500;
  font-size: 13px;
  color: var(--ink);
}
.home-todo-list__deadline {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

/* Prijscalculator */
.calc-layout {
  display: grid;
  grid-template-columns: minmax(420px, 3fr) minmax(280px, 2fr);
  gap: 20px;
  align-items: start;
}
@media (max-width: 900px) {
  .calc-layout {
    grid-template-columns: 1fr;
  }
}
.calc-form label:not(.checkbox-label):not(.radio-label) {
  margin-top: 16px;
}
.calc-form > label:first-of-type {
  margin-top: 0;
}
.calc-radio-group {
  display: flex;
  gap: 18px;
  margin: 6px 0 4px;
}
.calc-divider {
  border: none;
  border-top: 1px solid var(--line);
  margin: 18px 0;
}
.calc-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 4px;
}
.calc-slider-row input[type="range"] {
  flex: 1;
  accent-color: var(--brand);
}
.calc-slider-row input[type="number"] {
  width: 72px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
}
#calc_vat_details, #calc_company_section {
  padding-left: 2px;
}

.calc-results {
  position: sticky;
  top: 20px;
}
.calc-totals {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.calc-totals__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--ink);
}
.calc-totals__row--main {
  font-size: 19px;
  font-weight: 700;
  color: var(--brand-dark);
  background: var(--brand-soft);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
}
.calc-totals__note {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
}
.calc-totals__vat-note {
  margin: 4px 0 0;
}

/* Voorbeeld van een herinneringsmail (preview vóór het versturen) */
.preview-meta {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px 20px;
  margin-bottom: 16px;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.preview-attachments {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px 20px;
  margin-bottom: 20px;
  font-size: 14px;
}
.preview-attachments__list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.preview-frame-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.preview-frame {
  width: 100%;
  height: 900px;
  border: none;
  display: block;
  background: #fff;
}

/* Dossiers & fiscale afsluiting */
.settings-card textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
}
.settings-card textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.button-secondary-link {
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}
.button-secondary-link:hover { color: var(--brand); }
.dossier-table .dossier-notes {
  max-width: 280px;
  color: var(--muted);
  font-size: 12px;
  text-align: left;
}
.dossier-table .dossier-notes > div {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.dossier-table td { text-align: left; }
.dossier-table th { text-align: left; }
/* Aangifte vennootschapsbelasting */
.page--wide { max-width: 1320px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: 14px; color: var(--ink); }
.checkbox-row input { width: auto; margin: 0; }
.calc-total td { font-weight: 600; border-top: 1px solid var(--line); }
.is-hidden { display: none !important; }

/* samenvatting bovenaan (blijft in beeld) */
.aangifte-bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px;
  padding: 10px 16px; margin: 0 0 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-md);
}
.aangifte-bar__items { display: flex; flex-wrap: wrap; gap: 6px 28px; }
.aangifte-bar__item { display: flex; flex-direction: column; min-width: 96px; }
.aangifte-bar__label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.aangifte-bar__value { font-family: "IBM Plex Mono", monospace; font-variant-numeric: tabular-nums; font-size: 16px; font-weight: 600; }
.aangifte-bar__sub { font-size: 11px; color: var(--muted); }
.aangifte-bar__item[data-summary="_saldo"].is-neg .aangifte-bar__value { color: var(--status-not_due); }
.aangifte-bar__actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.aangifte-bar__state { font-size: 12px; color: var(--muted); min-width: 150px; text-align: right; }
.aangifte-bar__status { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.aangifte-bar__status select {
  padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg); font: inherit; font-size: 13px; color: var(--ink);
}
.aangifte-save {
  padding: 9px 18px; background: var(--brand); color: #fff; border: none; border-radius: var(--radius-sm);
  font-weight: 600; font-family: inherit; cursor: pointer;
}
.aangifte-save:hover { background: var(--brand-dark); }

.aangifte-warnings {
  margin: 0 0 12px; padding: 12px 16px; background: #FFF8E6; border: 1px solid #F0D58C;
  border-radius: var(--radius-sm); font-size: 13px;
}
.aangifte-warnings ul { margin: 6px 0 0 18px; padding: 0; }
.aangifte-warnings li { margin: 2px 0; }

.aangifte-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin: 0 0 12px; }
.aangifte-toolbar input[type="search"] {
  flex: 1 1 320px; max-width: 520px; padding: 9px 12px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--surface); font: inherit; font-size: 14px;
}
.aangifte-toolbar input[type="search"]:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); outline: none; }
.aangifte-toolbar .checkbox-row { margin: 0; }
.aangifte-toolbar .button-secondary-link { background: none; border: none; cursor: pointer; font-family: inherit; }
.aangifte-empty { padding: 24px; text-align: center; color: var(--muted); }

/* onderdelen */
.aangifte-section {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  margin-bottom: 12px; box-shadow: var(--shadow-sm);
}
.aangifte-section > summary {
  display: flex; align-items: center; gap: 8px; padding: 14px 18px; cursor: pointer;
  font-weight: 600; font-size: 15px; list-style: none; user-select: none;
}
.aangifte-section > summary::-webkit-details-marker { display: none; }
.aangifte-section > summary::before {
  content: "\25B8"; display: inline-block; width: 14px; color: var(--muted); transition: transform .15s ease;
}
.aangifte-section[open] > summary::before { transform: rotate(90deg); }
.aangifte-section > summary:hover { color: var(--brand-dark); }
.aangifte-section__title { flex: 1; }
.aangifte-section__count { font-size: 12px; font-weight: 500; color: var(--muted); }
.aangifte-section__body { padding: 0 18px 18px; }
.aangifte-block { margin-bottom: 18px; }
.aangifte-tabletitle { margin: 18px 0 8px; font-size: 14px; }

/* rubrieken */
.aangifte-rows td.code, .aangifte-rows th.code-col {
  width: 66px; text-align: left; font-family: "IBM Plex Mono", monospace; font-size: 12px; color: var(--muted);
}
.aangifte-rows th.label-col { text-align: left; }
.aangifte-rows td.label { text-align: left; white-space: normal; min-width: 260px; line-height: 1.4; }
.aangifte-rows td.rate { color: var(--muted); font-size: 12px; }
.arow--head td {
  background: var(--bg); font-weight: 600; font-size: 12px; color: var(--muted); text-align: left;
  white-space: normal; text-transform: uppercase; letter-spacing: .03em;
}
.arow--bold td.label { font-weight: 600; }
.arow--bold .cell-calc, .arow--bold .cell-input { font-weight: 600; }
.arow--ref td.label, .arow--ref .cell-calc { color: var(--muted); }
.arow--ref .cell-calc:not(:empty)::before { content: "("; }
.arow--ref .cell-calc:not(:empty)::after { content: ")"; }
.arow--attention td.code { color: var(--status-due_soon); }
.arow__note { font-size: 12px; color: var(--muted); margin-top: 2px; font-weight: 400; }
.arow__attention { font-size: 12px; color: #9A6B00; margin-top: 2px; font-weight: 400; }
.arow .sign { color: var(--muted); font-size: 12px; margin-right: 4px; }

td.v { width: 150px; min-width: 120px; vertical-align: middle; }
td.v.v--absent { background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(16, 21, 31, .03) 6px 12px); }
td.v .cell-input, td.v .cell-text {
  width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg); font: inherit; font-size: 13px;
}
td.v .cell-input { text-align: right; font-family: "IBM Plex Mono", monospace; font-variant-numeric: tabular-nums; }
td.v .cell-input::placeholder { color: var(--brand); opacity: .75; }
td.v .cell-input:focus, td.v .cell-text:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); outline: none; background: var(--surface); }
td.v .cell-check { width: 18px; height: 18px; margin: 4px; accent-color: var(--brand); }
td.v .cell-calc { display: block; padding: 6px 8px; font-family: "IBM Plex Mono", monospace; font-variant-numeric: tabular-nums; min-height: 31px; }
td.v[data-mode="input"] .cell-calc, td.v[data-mode="auto"] .cell-calc, td.v[data-mode="manual"] .cell-calc { display: none; }
td.v[data-mode="calc"] .cell-input, td.v[data-mode="detail"] .cell-input, td.v[data-mode="list"] .cell-input { display: none; }
td.v[data-mode="detail"] .cell-calc { text-decoration: underline dotted var(--muted); text-underline-offset: 3px; cursor: help; }
td.v[data-mode="auto"] .cell-input:placeholder-shown { background: var(--brand-soft); }
td.v[data-mode="manual"] .cell-input { border-color: var(--status-due_soon); }
td.v.is-neg .cell-calc, td.v.is-neg .cell-input:not(:placeholder-shown) { color: var(--status-overdue); }
td.v[data-cell$="_tax"] .cell-calc, td.v[data-cell="_t_gewoon"] .cell-calc { color: var(--muted); }

/* identificatie en vinkjes */
.aangifte-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px 20px; margin-bottom: 8px; }
.aangifte-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 2px 20px; }
.aangifte-field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.aangifte-field input {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg); font: inherit; font-size: 14px;
}
.aangifte-field input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); outline: none; background: var(--surface); }
.aangifte-field--wide { grid-column: 1 / -1; margin-top: 10px; }

/* detaillijsten en vrije regels */
.aangifte-list { margin-top: 22px; }
.aangifte-listtable input {
  width: 100%; min-width: 90px; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg); font: inherit; font-size: 13px;
}
.aangifte-listtable input.num { text-align: right; font-family: "IBM Plex Mono", monospace; }
.aangifte-listtable td { text-align: left; }
.aangifte-list .table-scroll { overflow-x: auto; }
.aangifte-listtable td:first-child input, .aangifte-listtable th:first-child { min-width: 240px; }
.aangifte-listtable td.num, .aangifte-listtable th.num { text-align: right; }
.aangifte-listtable td.x { width: 36px; text-align: center; }
.row-remove {
  width: 28px; height: 28px; padding: 0; border: none; background: none; color: var(--muted);
  font-size: 20px; line-height: 1; cursor: pointer; border-radius: 6px;
}
.row-remove:hover { color: var(--status-overdue); background: rgba(216, 67, 43, .08); }
.aangifte-list .button-secondary-link, .freelist .button-secondary-link {
  margin-top: 8px; background: none; border: none; cursor: pointer; font-family: inherit; padding-left: 0;
}
.freelist { padding: 4px 0 10px; }
.free-line {
  display: grid; grid-template-columns: minmax(180px, 1fr) repeat(var(--free-cols, 2), 140px) 32px;
  gap: 8px; align-items: center; margin-bottom: 6px;
}
.free-line input {
  width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg); font: inherit; font-size: 13px;
}
.free-line input.num { text-align: right; font-family: "IBM Plex Mono", monospace; }
.free-line--head { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.free-line--head .num { text-align: right; }

/* afdrukbaar overzicht */
.print-section { font-size: 16px; margin: 28px 0 8px; padding-bottom: 4px; border-bottom: 2px solid var(--line); }
.print-summary { max-width: 460px; }
.print-summary td:first-child { text-align: left; }
.print-table { margin-bottom: 14px; table-layout: fixed; width: 100%; }
.print-table th.code-col { width: 84px; white-space: nowrap; }
.print-table th.num { width: 140px; }
.print-table td, .print-table th { overflow-wrap: anywhere; }
.print-table th:not(.code-col) { white-space: normal; vertical-align: bottom; }
.print-text { display: inline-block; max-width: 100%; white-space: normal; text-align: right; }
.print-card td { text-align: left; }
.print-card td.num { text-align: right; }
.print-sub td { font-size: 12px; color: var(--muted); }
.print-card { margin-bottom: 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); table-layout: auto; }
.print-card__key { width: 42%; color: var(--muted); }
.print-total { table-layout: auto; }

@media (max-width: 760px) {
  .aangifte-bar { position: static; }
  td.v { width: auto; min-width: 100px; }
  .aangifte-section__body { padding: 0 10px 14px; }
}
@media print {
  .aangifte-bar, .aangifte-toolbar, .no-print { display: none !important; }
  .print-section { break-after: avoid; }
  .print-table { break-inside: auto; }
  .print-table tr { break-inside: avoid; }
}

/* Boekhouding (Octopus) */
.boekhouding-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.boekhouding-toolbar input[type="date"] { width: auto; }
.balans-check { padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 12px; font-weight: 500; }
.balans-check--ok { background: rgba(46, 160, 67, 0.12); color: var(--status-not_due); }
.balans-check--fout { background: rgba(220, 53, 69, 0.12); color: var(--status-overdue); }

/* ===== Neerleggingskosten / Betalingsherinneringen: compacte afdruk van de klantenlijst =====
   Op het scherm blijven de klantkaarten; "Lijst afdrukken" drukt in plaats daarvan de compacte
   tabel (#afdruk-lijst) af. Staat bewust onderaan: deze regels moeten de oudere @media print-regels
   hierboven overrulen. */
/* melding "gefilterd: 6 van 16 klanten" onder het aantal klanten (enkel zichtbaar bij een actieve filter) */
.summary__note { margin-top: 2px; font-size: 12px; color: var(--muted); }
.summary__note[hidden] { display: none; }
/* neerleggingskosten: de tegels mogen naar een volgende regel op smalle schermen */
.summary--filing { flex-wrap: wrap; row-gap: 12px; }
.afdruk-only { display: none; }

@page { margin: 10mm; }
@media print {
  body { font-size: 9pt; }
  .afdruk-only { display: block; }
  .page-intro, .salesperson-filter, #customer-list, #search-empty-state { display: none !important; }

  .page-title { font-size: 14pt; margin: 0 0 1.5mm; }
  .dashboard-header { gap: 6mm; padding-bottom: 2mm; margin-bottom: 2mm; }
  .summary { gap: 8mm; }
  .summary__number { font-size: 12pt; line-height: 1.25; }
  .summary__label { font-size: 8pt; line-height: 1.25; white-space: nowrap; }
  .summary__note { font-size: 8pt; white-space: nowrap; }
  .afdruk-meta { font-size: 8pt; color: #444; margin-bottom: 2mm; }

  .afdruk-tabel {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 8.5pt;
    line-height: 1.3;
  }
  .afdruk-tabel th {
    text-align: left;
    vertical-align: bottom;
    padding: 0.8mm 1.5mm;
    font-size: 7.5pt;
    font-weight: 600;
    color: #444;
    border-bottom: 0.7pt solid #000;
  }
  .afdruk-tabel td { padding: 0.45mm 1.5mm; vertical-align: top; overflow-wrap: anywhere; }
  .afdruk-tabel tr { break-inside: avoid; page-break-inside: avoid; }
  .afdruk-tabel .afdruk-datum { width: 23mm; }
  .afdruk-tabel .afdruk-status { width: 33mm; }
  .afdruk-tabel .afdruk-bedrag {
    width: 24mm;
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
  }
  .afdruk-tabel .afdruk-herinnerd { width: 34mm; }

  /* een klant = een groep: nooit over twee pagina's gesplitst (tenzij hij langer is dan een pagina) */
  .afdruk-groep { break-inside: avoid; page-break-inside: avoid; }
  .afdruk-klant td { padding-top: 1.6mm; border-top: 0.5pt solid #888; font-weight: 600; }
  .afdruk-klant { break-after: avoid; page-break-after: avoid; }
  .afdruk-regel td:first-child, .afdruk-betaling td:first-child { padding-left: 5mm; }
  .afdruk-betaling td { font-size: 8pt; font-style: italic; color: #333; }
  .afdruk-sub { margin-left: 2mm; font-size: 7.5pt; font-weight: 400; color: #555; }
  td.afdruk-sub { margin-left: 0; }
  .afdruk-aandacht { font-weight: 600; }
  .afdruk-aandacht--critical { color: #b3261e; }
  .afdruk-aandacht--warning { color: #8a6100; }
  .afdruk-status--overdue, .afdruk-neg { color: #b3261e; }

  .afdruk-totaal { break-inside: avoid; page-break-inside: avoid; }
  .afdruk-totaal td { padding-top: 1.6mm; border-top: 1pt solid #000; font-size: 9pt; font-weight: 700; }
}

/* Tabbladen die nog in ontwikkeling zijn */
.coming-soon { text-align: center; padding: 48px 24px; }
.coming-soon__badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--brand-soft, rgba(37, 99, 235, .12));
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* Brede kaarten (datamappen): tabellen moeten binnen de kaart passen */
.settings-card--full { max-width: none; padding: 24px 28px; }
.settings-card--full .table-scroll { overflow-x: auto; }
.settings-card--full table form { margin: 0; }
.settings-card--full table button.secondary { padding: 6px 12px; }
.map-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* Dossiers per afsluitdatum */
.dossier-group { margin-bottom: 28px; }
.dossier-group__title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 10px;
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
}
.dossier-group__count { font-size: 13px; font-weight: 400; color: var(--muted); }

/* Dossieroverzicht */
.settings-card--full { margin-bottom: 20px; }
.dossier-overview-notes { margin: 0 0 20px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); font-size: 14px; white-space: pre-wrap; }
.dossier-year { border-top: 1px solid var(--line); padding: 10px 0; }
.dossier-year:first-of-type { border-top: 0; padding-top: 0; }
.dossier-year summary { display: flex; align-items: center; gap: 14px; cursor: pointer; padding: 4px 0 8px; }

/* Dossieroverzicht: vaste kolombreedtes (in elke groep gelijk), titels en tekst op dezelfde lijn */
.dossier-table { table-layout: fixed; width: 100%; }
.dossier-table th, .dossier-table td {
  text-align: left;
  vertical-align: top;
  padding: 12px 14px;
  overflow-wrap: break-word;
  word-break: normal;
}
.dossier-table th { white-space: nowrap; vertical-align: bottom; overflow: hidden; text-overflow: ellipsis; }
.dossier-table td { line-height: 1.45; }
.dossier-table .col-klant { width: 19%; }
.dossier-table .col-adres { width: 21%; }
.dossier-table .col-afsluiting { width: 12%; white-space: nowrap; }
.dossier-table .col-persoon { width: 16%; }
.dossier-table .col-notities { width: 16%; }
.dossier-table--archief .col-klant { width: 17%; }
.dossier-table--archief .col-adres { width: 19%; }
.dossier-table--archief .col-afsluiting { width: 11%; }
.dossier-table--archief .col-persoon { width: 15%; }
.dossier-table--archief .col-notities { width: 13%; }
.dossier-table .col-datum { width: 10%; white-space: nowrap; }
.dossier-table th { font-size: 10.5px; letter-spacing: .02em; }
.dossier-table td.col-klant { font-weight: 500; }
.dossier-table td.col-klant .cell-sub { font-weight: 400; margin-top: 2px; }
.dossier-table td.mono { font-family: inherit; font-variant-numeric: tabular-nums; }
@media (max-width: 1250px) {
  /* smallere schermen: kolommen krijgen hun natuurlijke breedte en de tabel schuift zo nodig horizontaal */
  .dossier-group .table-scroll { overflow-x: auto; }
  .dossier-table { table-layout: auto; min-width: 760px; }
  .dossier-table th { overflow: visible; text-overflow: clip; }
  .dossier-table td.col-adres { min-width: 190px; }
}

/* Instellingen > Beveiliging */
.security-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.security-badge { font-size: 12px; font-weight: 600; color: #0b4a99; background: #eaf2fd; border-radius: 999px; padding: 4px 12px; }
.security-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px 16px; margin-top: 14px; }
.security-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid #e3e8ef; border-radius: 10px; cursor: pointer; background: #fff; }
.security-item input { margin-top: 3px; width: auto; }
.security-item small { display: block; color: #6b7686; font-size: 12px; margin-top: 2px; }
.security-item--sub { margin-left: 18px; }
.security-item.is-off { opacity: .5; }
@media (max-width: 600px) { .security-item--sub { margin-left: 0; } }

/* Interne balans */
.ib-table { width: 100%; table-layout: fixed; margin-bottom: 22px; font-size: 12px; border-collapse: collapse; }
.ib-table thead th { font-size: 10.5px; color: #3f4650; border-bottom: 2px solid #0085CA; padding: 7px 10px; text-transform: none; letter-spacing: 0; background: transparent; }
.ib-table th, .ib-table td { padding: 5px 10px; }
.ib-table th.ib-code, .ib-table td.ib-code { width: 84px; text-align: left; font-weight: 700; color: #111; white-space: nowrap; }
.ib-table th.ib-oms, .ib-table td.ib-oms { text-align: left; white-space: normal; overflow-wrap: anywhere; }
.ib-table th.num { width: 150px; white-space: normal; text-align: right; }
.ib-table td.num { white-space: nowrap; text-align: right; }
.ib-table tbody tr { border-bottom: 1px solid #eef1f5; }
.ib-lvl1 td.ib-oms { padding-left: 24px; }
.ib-lvl2 td.ib-oms { padding-left: 40px; }
.ib-head td { text-align: left; font-weight: 700; color: #0085CA; padding-top: 12px; border-bottom: 1px solid #cfe6f5; }
.ib-sub td { font-weight: 700; }
.ib-sub td.ib-oms { padding-left: 24px; }
.ib-total td { font-weight: 700; border-top: 1px solid #0085CA; }
.ib-section td { font-weight: 700; background: #D9EDF9; color: #0b3550; }
.ib-result td { font-weight: 700; background: #EEF7FC; border-top: 1px solid #0085CA; border-bottom: 1px solid #0085CA; }
.ib-grand td { font-weight: 700; background: #0085CA; color: #fff; font-size: 12.5px; padding-top: 8px; padding-bottom: 8px; }
.ib-grand td.negative { color: #fff; }
.ib-check td { font-style: italic; color: var(--muted); }
.ib-detail td { font-size: 11px; color: #5b6572; }
.ib-detail td.ib-code { font-weight: 700; color: #5b6572; }
.ib-detail td.ib-oms { padding-left: 52px; }
.ib-table h2, h2.print-section { color: #0085CA; }
.ib-grand td.ib-code { color: #fff; }

/* Betalingsherinneringen / neerleggingskosten: zelfde look als de interne balans */
.customer-card { box-shadow: none; border-color: #dfe6ee; }
.customer-card:hover { box-shadow: none; transform: none; }
.customer-card__header { background: #D9EDF9; border-bottom: 1px solid #b9dcf1; padding: 12px 18px; align-items: center; }
.customer-card__name { font-weight: 700; font-size: 14px; color: #0b3550; }
.customer-card__header .cell-sub { color: #3d5a70; font-size: 11.5px; }
.customer-card__totals .amount { font-weight: 700; font-size: 14px; color: #0b3550; }
.invoice-subtable { font-size: 12px; }
.invoice-subtable th { font-size: 10.5px; font-weight: 700; color: #3f4650; padding: 8px 14px 6px; border-bottom: 2px solid #0085CA; background: transparent; }
.invoice-subtable td { font-size: 12px; padding: 6px 14px; border-bottom: 1px solid #eef1f5; }
.invoice-subtable tbody tr:last-child td { padding-bottom: 6px; }
.invoice-subtable td:first-child { font-weight: 700; }
.invoice-subtable td:first-child .invoice-link { font-weight: 700; }
.invoice-subtable th.num, .invoice-subtable td.num { text-align: right; }
.invoice-subtable .amount { font-weight: 600; }
.invoice-subtable tfoot td { font-weight: 700; background: #EEF7FC; border-top: 1px solid #0085CA; border-bottom: 1px solid #0085CA; padding: 7px 14px; }
.invoice-subtable tfoot td:first-child { text-align: left; }
.payments-subtable th, .payments-subtable td { padding-left: 14px; padding-right: 14px; }
.payments-subtable tfoot td { border-top: 1px solid #0085CA; font-size: 12px; }
.unreconciled-block { padding: 10px 0 0; }
.unreconciled-block__title { padding: 0 18px 6px; }
.customer-card__footer { background: #fafcfe; }

@media print {
  .afdruk-tabel th { border-bottom: 1.2pt solid #0085CA !important; color: #333; font-weight: 700; }
  .afdruk-klant td { background: #D9EDF9 !important; border-top: 0 !important; color: #0b3550; font-weight: 700; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .afdruk-regel td:first-child { font-weight: 700; }
  .afdruk-totaal td { background: #0085CA !important; color: #fff !important; border-top: 0 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.invoice-subtable--factuur, .invoice-subtable--filing { table-layout: fixed; }
.invoice-subtable--factuur th:nth-child(1) { width: 17%; } .invoice-subtable--factuur th:nth-child(2) { width: 13%; }
.invoice-subtable--factuur th:nth-child(3) { width: 13%; } .invoice-subtable--factuur th:nth-child(4) { width: 22%; }
.invoice-subtable--factuur th:nth-child(5) { width: 17%; }
.invoice-subtable--filing th:nth-child(1) { width: 32%; } .invoice-subtable--filing th:nth-child(2) { width: 15%; }
.invoice-subtable--filing th:nth-child(3) { width: 26%; } .invoice-subtable--filing th:nth-child(4) { width: 15%; }
@media (max-width: 800px) { .invoice-subtable--factuur, .invoice-subtable--filing { table-layout: auto; } }

/* wagenpark */
.wagen-print { display:flex; flex-wrap:wrap; gap:10px; align-items:center; margin-top:14px; }
.wagen-print label { display:flex; align-items:center; gap:8px; margin:0; }
.wagen-print select { width:auto; min-width:150px; margin:0; }
.wagen-print .print-button { margin:0; }
.wagen-actions { white-space:normal; min-width:150px; line-height:1.9; }

.wagen-table th, .wagen-table td { padding: 12px 8px; }
.wagen-table th:nth-child(1) { width: 17%; } .wagen-table th:nth-child(2) { width: 9%; } .wagen-table th:nth-child(3) { width: 9%; }
.wagen-table th:nth-child(4) { width: 10%; } .wagen-table th:nth-child(5), .wagen-table th:nth-child(6), .wagen-table th:nth-child(7) { width: 10%; }
.wagen-table th:nth-child(8) { width: 6%; } .wagen-table th:nth-child(9) { width: 10%; }
.wagen-table .wagen-actions { min-width: 0; line-height: 1.7; }
.wagen-table .wagen-actions a, .wagen-table .wagen-actions form { display: block; }
.wagen-del { background:none; border:0; padding:0; margin:0; cursor:pointer; font:inherit; font-size:12px; font-weight:500; color:var(--brand); box-shadow:none; width:auto; }
.wagen-del:hover { color:var(--brand-dark); text-decoration:underline; background:none; }
.settings-card .wagen-table button.wagen-del, .wagen-table button.wagen-del { background:none !important; border:0 !important; padding:0 !important; margin:0; color:var(--brand) !important; font-size:12px; font-weight:500; box-shadow:none !important; width:auto !important; height:auto; min-height:0; }
.wagen-table button.wagen-del:hover { color:var(--brand-dark) !important; text-decoration:underline; }
.wagen-table th:nth-child(1) { width: 15%; } .wagen-table th:nth-child(9) { width: 11%; } .wagen-table th:nth-child(10) { width: 9%; }

/* jaarbundel */
.jb-year { display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin: 0 0 18px; }
.jb-year label { margin:0; font-weight:600; }
.jb-year select { width:auto; min-width:140px; margin:0; }
.jb-contents { margin: 0; padding-left: 20px; line-height: 2.1; }
.jb-tag { display:inline-block; margin-left:8px; padding:1px 9px; border-radius:99px; font-size:11px; font-weight:600; background:#eef1f5; color:#55606e; text-transform:none; letter-spacing:0; }
.jb-tag--ok { background:#e2f4e9; color:#1b6b3a; }
.jb-tag--no { background:#fdeaea; color:#a12a2a; }
.jb-upload { display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-top:12px; }
.jb-upload input[type=file] { width:auto; max-width:380px; margin:0; }
.jb-files td { vertical-align: middle; }
.print-button.is-disabled { opacity:.45; pointer-events:none; }
