:root {
  --bg: #eceff6;
  --panel: #f6f7fb;
  --surface: #fff;
  --text: #182033;
  --muted: #6a7288;
  --border: #e4e7f0;
  --primary: #2f5bea;
  --primary-dark: #2447c4;
  --primary-soft: #e4ebff;
  --danger-bg: #fdecec;
  --danger: #b42318;
  --shadow: 0 1px 2px rgba(24, 32, 51, .04), 0 2px 8px rgba(24, 32, 51, .04);
  --shadow-hover: 0 2px 4px rgba(24, 32, 51, .05), 0 8px 20px rgba(24, 32, 51, .08);
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); }
h1 { font-size: 1.55rem; line-height: 1.25; margin: 0 0 .25rem; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; margin-top: 0; letter-spacing: -.005em; }
.muted { color: var(--muted); font-size: .92rem; }
.center { text-align: center; }
.icon { width: 1.15em; height: 1.15em; flex: none; }

/* ---- shell: zijbalk + contentpaneel ---- */
.shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 1rem;
  padding: 1.1rem .85rem .85rem;
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: .6rem; padding: 0 .5rem; text-decoration: none; color: var(--text); }
.brand-mark {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, #4f77ff, #2447c4); color: #fff; font-weight: 800; font-size: 1rem;
  box-shadow: 0 2px 6px rgba(47, 91, 234, .35);
}
.brand-name { font-weight: 700; font-size: 1.15rem; letter-spacing: -.01em; }

/* ---- tenant-wisselaar (alleen bij lidmaatschap van meerdere bedrijven) ---- */
.tenant-switch { margin-top: -.25rem; border: 1px solid var(--border); border-radius: 10px; background: rgba(255, 255, 255, .7); }
.tenant-switch summary {
  display: flex; align-items: center; gap: .55rem; padding: .5rem .65rem; list-style: none;
  border-radius: 10px; font-size: .88rem; font-weight: 600; cursor: pointer;
}
.tenant-switch summary::-webkit-details-marker { display: none; }
.tenant-switch summary:hover { background: rgba(24, 32, 51, .05); }
.tenant-switch summary span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tenant-switch summary .icon { color: #6a7288; }
.tenant-list { padding: .25rem; border-top: 1px solid var(--border); }
.tenant-list form { margin: 0; }
.tenant-option {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem; width: 100%;
  padding: .45rem .55rem; border: 0; border-radius: 8px; background: transparent;
  font: inherit; font-size: .86rem; color: #3b4459; text-align: left; cursor: pointer;
}
.tenant-option span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tenant-option:hover { background: rgba(24, 32, 51, .05); color: var(--text); }
.tenant-option.current { background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }
.tenant-badge {
  flex: none; min-width: 1.25rem; padding: .05rem .35rem; border-radius: 999px;
  background: var(--primary); color: #fff; font-size: .72rem; font-weight: 700; text-align: center;
}
.tenant-invites { padding: .25rem; border-top: 1px solid var(--border); }
.tenant-invites-label { padding: .35rem .55rem .15rem; font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #6a7288; }
.tenant-invite { display: flex; flex-direction: column; gap: .15rem; padding: .45rem .55rem; border-radius: 8px; font-size: .86rem; }
.tenant-invite small { color: #6a7288; font-size: .78rem; }
.tenant-invite-actions { display: flex; gap: .35rem; margin-top: .3rem; }
.tenant-invite-actions form { margin: 0; }
.tenant-invite-actions .btn.small { margin: 0; }

.nav { display: flex; flex-direction: column; gap: 1.1rem; flex: 1; margin-top: .25rem; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-label { padding: 0 .65rem .3rem; font-size: .68rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: #8b93a8; }
.nav-item {
  display: flex; align-items: center; gap: .65rem;
  padding: .5rem .65rem; border-radius: 9px;
  text-decoration: none; font-size: .9rem; color: #3b4459;
  transition: background .12s, color .12s;
}
.nav-item .icon { color: #6a7288; transition: color .12s; }
.nav-item:hover { background: rgba(24, 32, 51, .05); color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }
.nav-item.active .icon { color: var(--primary); }

.sidebar-foot {
  display: flex; align-items: center; gap: .5rem; justify-content: space-between;
  padding: .6rem; border-radius: 12px; background: rgba(255, 255, 255, .7); border: 1px solid var(--border);
}
.who { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.avatar {
  display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%;
  background: #d5f3f0; color: #0d6b63; font-size: .72rem; font-weight: 700;
}
.who-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.who-text strong { font-size: .84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-text small { font-size: .74rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-foot form { margin: 0; }
.icon-btn { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--danger-bg); color: var(--danger); }

.content {
  min-width: 0; margin: .5rem .5rem .5rem 0; padding: 2rem 2.25rem 3rem;
  background: var(--panel); border: 1px solid var(--border); border-radius: 18px;
}
.auth-wrap {
  min-height: 100vh; display: grid; place-items: center; align-content: center; padding: 1.5rem;
  background: radial-gradient(900px 500px at 50% -10%, #dbe4ff 0%, transparent 70%), var(--bg);
}
.auth-wrap .flash { width: 100%; max-width: 420px; }

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.35rem;
  box-shadow: var(--shadow);
}
.auth-card { width: 100%; max-width: 420px; padding: 2.25rem 2rem 2rem; border: 1px solid var(--border); box-shadow: var(--shadow-hover); }
.auth-brand { justify-content: center; margin-bottom: 1.5rem; padding: 0; }
.auth-brand .brand-mark { width: 36px; height: 36px; border-radius: 11px; font-size: 1.15rem; }
.auth-card h1 { text-align: center; font-size: 1.45rem; }
.auth-card > .muted:first-of-type { text-align: center; margin-top: 0; }
.auth-card form + .muted { margin: 1.5rem 0 0; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.auth-card > p:not(.muted) { text-align: center; }
.auth-card > a.btn { display: block; text-align: center; }

/* ---- forms ---- */
form label { display: block; margin: 1rem 0 0; font-size: .88rem; font-weight: 500; }
form label .muted { font-weight: 400; }
input[type=text], input[type=email], input[type=password] {
  width: 100%;
  margin-top: .3rem;
  padding: .6rem .75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  background: #fff;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47, 91, 234, .18); }

.btn {
  display: inline-block;
  margin-top: 1.25rem;
  padding: .55rem 1.05rem;
  border: 0;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-size: .92rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(47, 91, 234, .35);
  transition: background .12s, box-shadow .12s;
}
.btn:hover { background: var(--primary-dark); }
.auth-card .btn { width: 100%; }
.btn.secondary { margin: 0; background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow); }
.btn.secondary:hover { background: var(--panel); }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); cursor: pointer; }
button.link:hover { text-decoration: underline; }

.alert { margin-top: 1rem; padding: .6rem .9rem; border-radius: 10px; background: var(--danger-bg); color: var(--danger); font-size: .9rem; }
.alert p { margin: .15rem 0; }

/* ---- kleurtegels (iconen) ---- */
.tile { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 11px; font-size: 1.15rem; }
.tile.blue { background: #dfe8ff; color: #2f5bea; }
.tile.violet { background: #ece5ff; color: #6d3fd6; }
.tile.amber { background: #ffefcf; color: #a86500; }
.tile.green { background: #d8f4e2; color: #17803a; }

/* ---- dashboard ---- */
.page-title { margin-bottom: 1.5rem; }
.page-title h1 { font-size: 1.7rem; }
.wave { display: inline-block; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; margin: 0 0 2rem; }
.stat { display: flex; flex-direction: column; gap: .15rem; }
.stat .tile { margin-bottom: .6rem; }
.stat-label { color: var(--muted); font-size: .84rem; }
.stat-value { font-size: 1.65rem; font-weight: 700; letter-spacing: -.01em; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 380px); gap: 2rem; align-items: start; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: .85rem; }
.section-head h2 { margin: 0; font-size: 1.1rem; }
.section-head .count { color: var(--muted); font-weight: 500; }
.more { display: inline-flex; align-items: center; gap: .15rem; font-size: .85rem; font-weight: 500; text-decoration: none; }
.more .icon { width: 1em; height: 1em; }
.more:hover { text-decoration: underline; }

.todo-list { display: flex; flex-direction: column; gap: .75rem; }
.todo, .quick { text-decoration: none; color: inherit; transition: box-shadow .15s, transform .15s; }
.todo:hover, .quick:hover { box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.todo { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.15rem; }
.todo-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.todo-text strong { font-size: .95rem; }
.todo-go { color: #a0a7ba; display: grid; }
.todo:hover .todo-go { color: var(--primary); }

.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.quick { display: flex; flex-direction: column; gap: .9rem; padding: 1rem 1.1rem; font-size: .9rem; font-weight: 600; }

/* ---- tabellen ---- */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.25rem; }
.table-card { padding: 0; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: .8rem 1.1rem; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #fafbfd; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f8f9fd; }
.num { text-align: right; }
code { font-size: .85rem; }
.empty { padding: 2.5rem 2rem; text-align: center; color: var(--muted); margin: 0; }

.badge { display: inline-flex; align-items: center; gap: .35rem; padding: .15rem .65rem; border-radius: 999px; font-size: .76rem; font-weight: 600; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.open { background: #fff4d6; color: #8a5a00; }
.badge.shipped { background: #dcf5e4; color: #146c2e; }
.badge.cancelled { background: #eceef4; color: var(--muted); }
.badge.upload-not_uploaded { background: #eceef4; color: var(--muted); }
.badge.upload-pending { background: #fff4d6; color: #8a5a00; }
.badge.upload-uploaded { background: #dcf5e4; color: #146c2e; }
.badge.upload-failed { background: #fde2e2; color: #a11b1b; }

.pager { display: flex; justify-content: center; align-items: center; gap: 1.5rem; margin-top: 1.25rem; font-size: .9rem; }

/* ---- meldingen, formulieren, instellingen ---- */
.flash { margin-bottom: 1rem; padding: .65rem .95rem; border-radius: 10px; font-size: .92rem; }
.flash.ok { background: #dcf5e4; color: #146c2e; }
.flash.error { background: var(--danger-bg); color: var(--danger); }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.actions form, form.inline { margin: 0; display: inline; }
.actions .btn { margin: 0; }
.settings-form { max-width: 860px; }
.settings-form .card { margin-bottom: 1.25rem; }
.settings-form .btn { margin-top: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 1rem; }
.grid .span2 { grid-column: span 2; }
input[type=number], select {
  width: 100%; margin-top: .3rem; padding: .6rem .75rem; border: 1px solid var(--border);
  border-radius: 10px; font: inherit; background: #fff;
}

/* ---- modal ---- */
.modal { width: min(420px, 92vw); padding: 1.5rem; border: 0; border-radius: 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, .4); }
.modal::backdrop { background: rgba(10, 16, 48, .65); }
.modal h2 { margin: 0 0 .25rem; font-size: 1.15rem; }
.modal p { margin: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1.5rem; }
.modal-actions .btn { margin: 0; }

/* ---- factuurlayouts (overzicht) ---- */
.crumb { margin: 0 0 .25rem; font-size: .85rem; }
.new-layout { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; margin-bottom: 1.25rem; }
.new-layout label { margin: 0; flex: 1 1 240px; }
.new-layout .btn { margin: 0; }
.actions-col { text-align: right; white-space: nowrap; }
td.actions-col { display: table-cell; }
td.actions-col > * { vertical-align: middle; }
.btn.small { margin: 0 0 0 .25rem; padding: .3rem .6rem; font-size: .8rem; font-weight: 500; }
.btn.danger { background: var(--surface); color: var(--danger); border: 1px solid var(--border); box-shadow: none; }
.btn.danger:hover { background: var(--danger-bg); }
.badge.default { background: #e0e7ff; color: #3730a3; margin-left: .4rem; vertical-align: middle; }
.badge.default::before { display: none; }

/* ---- producten ---- */
.flash.warn { background: #fff4d6; color: #8a5a00; }
td.wrap { white-space: normal; min-width: 14rem; }
.thumb-col { width: 1%; padding-right: 0; }
.thumb { display: block; width: 48px; height: 48px; border-radius: 10px; object-fit: cover; background: var(--panel); }
.vat-cell { display: flex; align-items: center; gap: .5rem; }
.vat-form { display: contents; }
.vat-select { width: 7.5rem; margin-top: 0; padding: .4rem .6rem; }
.vat-status { order: 2; font-size: .8rem; color: var(--muted); min-width: 6rem; }
.vat-status.ok { color: #146c2e; }
.vat-status.error { color: var(--danger); }
.vat-ai { order: 1; display: inline-flex; }
.ai-btn { position: relative; display: grid; place-items: center; width: 32px; height: 32px; flex: none; padding: 0; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: #3730a3; cursor: pointer; }
.ai-btn:hover { background: #e0e7ff; }
.ai-btn.pending { background: #e0e7ff; border-color: #a5b4fc; }
.ai-badge { position: absolute; right: -6px; bottom: -6px; display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); }
.ai-badge .icon { width: 14px; height: 14px; }
.ai-badge.ok { color: #16a34a; }
.ai-badge.warn { color: #d97706; }
.ai-btn:disabled { cursor: progress; }
.ai-btn .icon { width: 16px; height: 16px; }
.ai-btn.busy { border-radius: 50%; }
.ai-btn.busy::after { content: ""; position: absolute; inset: -4px; border: 2px solid transparent; border-top-color: #4f46e5; border-right-color: #4f46e5; border-radius: 50%; animation: ai-spin .8s linear infinite; }
@keyframes ai-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ai-btn.busy::after { animation-duration: 3s; } }

/* ---- orders: uitklapbare orderregels ---- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.toggle-col { width: 1%; padding-right: 0; }
.channel-col { width: 1%; }
.channel-logo { display: block; width: 28px; height: 28px; border-radius: 7px; }
.row-toggle { display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.row-toggle:hover { background: var(--panel); color: var(--text); }
.row-toggle .icon { width: 18px; height: 18px; transition: transform .15s; }
.row-toggle[aria-expanded="true"] .icon { transform: rotate(90deg); }
.order-row { cursor: pointer; }
.order-row.open, .order-row.open + .order-detail { background: #f8f9fd; }
.order-detail:hover { background: #f8f9fd; }
.order-detail td { padding-top: .25rem; padding-bottom: 1rem; white-space: normal; }
.order-detail[hidden] { display: none; }
table.lines { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; border-collapse: separate; border-spacing: 0; overflow: hidden; }
table.lines tbody tr:hover { background: transparent; }
table.lines .thumb { width: 40px; height: 40px; border-radius: 8px; }
.vat-assumed { color: #8a5a00; cursor: help; }
.lines-note { margin: .5rem 0 0; font-size: .82rem; }

/* ---- responsive ---- */
@media (max-width: 960px) {
  .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding: .75rem 1rem; overflow: visible; }
  .nav { flex-direction: row; flex: 1 1 100%; order: 3; gap: .25rem; margin: 0; overflow-x: auto; }
  .nav-group { flex-direction: row; gap: .25rem; }
  .nav-label { display: none; }
  .nav-item { white-space: nowrap; }
  .sidebar-foot { margin-left: auto; padding: .3rem .4rem; }
  .tenant-switch { margin-top: 0; min-width: 12rem; }
  .who-text { display: none; }
  .content { margin: 0 .5rem .5rem; padding: 1.25rem 1rem 2rem; }
}
@media (max-width: 640px) { .grid .span2 { grid-column: auto; } }

/* ---- integraties ---- */
.integration-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }
.integration-card { display: flex; align-items: flex-start; gap: 1rem; padding: 1.25rem; text-decoration: none; color: inherit; transition: box-shadow .15s, transform .15s; }
a.integration-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-1px); }
a.integration-card:hover .todo-go { color: var(--primary); }
.integration-card.is-connected { opacity: .75; }
.integration-card h2 { margin: 0 0 .25rem; font-size: 1.05rem; }
.integration-card .muted { margin: 0; }
.integration-card .todo-go { align-self: center; }
.integration-body { flex: 1; min-width: 0; }
.provider-mark { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: #0000a4; color: #fff; font-size: 1.6rem; font-weight: 800; line-height: 1; }
.integration-meta { margin: .9rem 0 0; display: grid; gap: .3rem; font-size: .85rem; }
.integration-meta div { display: flex; gap: .5rem; }
.integration-meta dt { color: var(--muted); min-width: 6.5rem; }
.integration-meta dd { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- meldingen rechtsonder ---- */
.toast-stack { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 50; display: flex; flex-direction: column; gap: .5rem; max-width: min(24rem, calc(100vw - 2.5rem)); }
.toast { padding: .7rem 1rem; border-radius: 10px; font-size: .9rem; box-shadow: 0 8px 24px rgba(20, 24, 40, .18); cursor: pointer; animation: toast-in .2s ease-out; }
.toast.error { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger); }
.toast.ok { background: #dcf5e4; color: #146c2e; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---- modal ---- */
.modal { width: min(30rem, calc(100vw - 2rem)); padding: 0; border: 0; border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(20, 24, 40, .3); }
.modal::backdrop { background: rgba(20, 24, 40, .45); }
.modal-body { padding: 1.4rem 1.5rem 1.25rem; }
.modal h2 { margin: 0 0 .75rem; font-size: 1.15rem; }
.modal-product { margin: 0 0 1rem; }
.modal-facts { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin: 0 0 1rem; }
.modal-facts > div { padding: .7rem .85rem; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); }
.modal-facts dt { margin-bottom: .25rem; font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.modal-facts dd { margin: 0; }
.rate-pill { display: inline-block; padding: .1rem .55rem; border-radius: 999px; background: #e0e7ff; color: #3730a3; font-weight: 700; }
.rate-pill.diff { background: #fff4d6; color: #8a5a00; }
.modal-reason { margin: 0 0 1rem; }
.modal-note { display: flex; gap: .55rem; align-items: flex-start; margin: 0 0 1rem; padding: .65rem .85rem; border-radius: 10px; font-size: .9rem; }
.modal-note .note-icon .icon { width: 18px; height: 18px; }
.modal-note.ok { background: #dcf5e4; color: #146c2e; }
.modal-note.warn { background: #fff4d6; color: #8a5a00; }
.modal-note.info { background: var(--panel); color: var(--muted); }
.modal-hint { margin: 0 0 1.1rem; font-size: .8rem; }
.modal-actions { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; }
.modal-actions .btn { margin: 0; }

/* ---- automatisering ---- */
.check { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
.check input { width: auto; margin: 0; }
.conditions { display: flex; flex-direction: column; gap: .6rem; margin-bottom: .75rem; }
.condition { display: grid; grid-template-columns: minmax(10rem, 1.2fr) minmax(8rem, .8fr) minmax(10rem, 1.4fr) auto; gap: .5rem; align-items: center; }
.condition select, .condition input { margin-top: 0; }
.condition .btn { margin: 0; }
.add-condition { margin: 0; }
#layout-label[hidden] { display: none; }
tr.rule-off td { opacity: .55; }
tr.rule-off td.actions-col { opacity: 1; }
tr.rule-fallback { background: #fafbfd; }
.actions-col .btn[disabled] { opacity: .4; cursor: default; }
.apply-filter { margin-bottom: 1rem; padding: .9rem 1.35rem; }
.apply-filter .check { margin: 0; }
.apply-list { margin: 0 0 1rem; padding-left: 1.2rem; }
.order-rule { display: block; margin-top: .15rem; font-size: .78rem; color: var(--muted); }
@media (max-width: 720px) { .condition { grid-template-columns: 1fr 1fr; } }

/* ---- collega's (Instellingen) ---- */
.member-form { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.member-form h3 { margin: 0 0 .75rem; font-size: 1rem; }
td.actions-col form { display: inline; }
.member-subhead { margin: 1.5rem 0 .5rem; font-size: 1rem; }

/* ---- automatisering: tabs, automatisch uitvoeren, logboek ---- */
.tabs { display: flex; gap: .25rem; margin: 0 0 1.25rem; border-bottom: 1px solid var(--border); }
.tab { padding: .55rem .9rem; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--muted); text-decoration: none; font-size: .92rem; font-weight: 500; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary-dark); border-bottom-color: var(--primary); font-weight: 600; }
.auto-card { margin-bottom: 1.25rem; }
.auto-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.auto-head h2 { margin-bottom: .2rem; }
.auto-head p { margin: 0; }
.auto-card .check.switch { margin: 0; font-size: .95rem; }
.auto-status { margin: 1rem 0; }
.auto-card .actions .btn { margin: 0; }
.log-filter { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem; margin-bottom: 1rem; padding: .9rem 1.35rem; }
.log-filter label { margin: 0; min-width: 11rem; }
.log-filter .btn { margin: 0; }
.badge.log-invoiced { background: #dcf5e4; color: #146c2e; }
.badge.log-skipped { background: #eceef4; color: var(--muted); }
.badge.log-error { background: var(--danger-bg); color: var(--danger); }
.log-detail { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1.5rem; }
.log-detail h3 { margin: 0 0 .5rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.log-facts { display: grid; gap: .3rem; margin: 0; font-size: .88rem; }
.log-facts div { display: flex; gap: .75rem; }
.log-facts dt { min-width: 11rem; color: var(--muted); }
.log-facts dd { margin: 0; overflow-wrap: anywhere; }
.log-considered { margin: 0; padding-left: 1.2rem; font-size: .9rem; }
.log-considered .matched { font-weight: 600; }
