/* smartcrm — licht als standaard; donker alleen via de thema-knop (data-theme="dark"). */
:root, :root[data-theme="light"] {
  --bg: #f4f6f9; --panel: #ffffff; --side: #ffffff; --ink: #1d2433; --muted: #667085; --line: #e4e7ec;
  --accent: #3b5bdb; --accent-soft: #edf1ff; --accent-ink: #ffffff; --hover: #f2f4f7;
  --ok: #157f3c; --ok-bg: #e7f6ec; --warn: #9a6200; --warn-bg: #fff6e0; --err: #c0362c; --err-bg: #fdeceb;
  --code: #f5f7fa; --shadow: 0 1px 2px rgba(16, 24, 40, .05);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #15181e; --panel: #1c2028; --side: #1a1d24; --ink: #e6e8ec; --muted: #9aa3b2; --line: #2c313b;
  --accent: #7c9bff; --accent-soft: #232b45; --accent-ink: #0f1320; --hover: #242933;
  --ok: #5fd394; --ok-bg: #16301f; --warn: #f2c35b; --warn-bg: #33290f; --err: #ff8a7a; --err-bg: #3a1c1a;
  --code: #232831; --shadow: none;
  color-scheme: dark;
}
* { box-sizing: border-box }
body { margin: 0; font: 14px/1.55 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink) }
a { color: var(--accent); text-decoration: none } a:hover { text-decoration: underline }

/* ---------- layout: zijbalk + inhoud ---------- */
.shell { display: flex; min-height: 100vh }
.side { width: 236px; flex: none; background: var(--side); border-right: 1px solid var(--line); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 10px }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 16px; color: var(--ink) } .brand:hover { text-decoration: none }
.logo { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 15px }
.side nav { flex: 1; padding: 4px 10px 12px }
.nav-group { margin-top: 14px }
.nav-title { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 0 10px 5px }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px; color: var(--ink); margin: 1px 0 }
.nav-item:hover { background: var(--hover); text-decoration: none }
.nav-item.on { background: var(--accent-soft); color: var(--accent); font-weight: 600 }
.nav-item .badge { margin-left: auto }
.ico { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .85 }
.side-foot { border-top: 1px solid var(--line); padding: 12px 14px; display: grid; gap: 8px }
.me { display: flex; align-items: center; gap: 10px; color: var(--ink) } .me:hover { text-decoration: none }
.me small { display: block; color: var(--muted); font-size: 12px } .me b { font-weight: 600; display: block; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700 }
.content { flex: 1; min-width: 0; display: flex; flex-direction: column }
.topbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 28px; border-bottom: 1px solid var(--line); background: var(--panel) }
main { width: 100%; max-width: 1180px; padding: 24px 28px 48px }
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; padding: 4px 10px; border-radius: 999px; background: var(--code); color: var(--muted) }
.status .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor }
.status.dryrun, .status.ok { background: var(--ok-bg); color: var(--ok) }
.status.test { background: var(--warn-bg); color: var(--warn) }
.status.live { background: var(--err-bg); color: var(--err); font-weight: 700 }
.navtoggle, .hamburger, .navclose, .scrim { display: none }
@media (max-width: 900px) {
  .side { position: fixed; z-index: 30; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 10px 30px rgba(0,0,0,.15) }
  .navtoggle:checked ~ .shell .side { transform: none }
  .navtoggle:checked ~ .shell .scrim { display: block; position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.25) }
  .hamburger, .navclose { display: inline-block; cursor: pointer; font-size: 20px; line-height: 1; padding: 2px 6px; color: var(--muted) }
  .topbar { padding: 10px 16px } main { padding: 18px 16px 40px }
}

/* ---------- componenten ---------- */
h1 { font-size: 22px; font-weight: 700; margin: 0 0 16px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap }
h2 { font-size: 16px; margin: 26px 0 10px } h3 { font-size: 14px; margin: 12px 0 6px }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; margin-bottom: 16px; box-shadow: var(--shadow) }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 16px }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; box-shadow: var(--shadow) }
.stat b { display: block; font-size: 24px; font-weight: 700 } .stat span { color: var(--muted); font-size: 12.5px }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--code); color: var(--muted); white-space: nowrap }
.badge.ok { background: var(--ok-bg); color: var(--ok) } .badge.warn { background: var(--warn-bg); color: var(--warn) } .badge.err { background: var(--err-bg); color: var(--err) }
.badge.count { background: var(--accent); color: var(--accent-ink) }
table { width: 100%; border-collapse: collapse }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top }
tr:last-child td { border-bottom: 0 }
th { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--code) }
.tablewrap { overflow-x: auto; padding: 0 } .tablewrap table { min-width: 640px }
.tablewrap > table th:first-child, .tablewrap > table td:first-child { padding-left: 16px }
input, select, textarea { font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 7px; padding: 7px 10px; max-width: 100% }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent) }
textarea { width: 100%; min-height: 90px }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=date] { width: 100% }
label { display: block; font-size: 12.5px; font-weight: 500; color: var(--muted); margin: 10px 0 4px }
label.inline { display: inline-flex; gap: 7px; align-items: center; color: var(--ink); font-size: 14px; font-weight: 400 }
.form2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 4px 16px }
button, .btn { font: inherit; font-weight: 500; cursor: pointer; border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 7px; padding: 7px 14px; display: inline-block; box-shadow: var(--shadow) }
button:hover, .btn:hover { background: var(--hover); text-decoration: none }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink) }
button.primary:hover, .btn.primary:hover { filter: brightness(1.07); background: var(--accent) }
button.danger { color: var(--err); border-color: var(--err-bg) } button.danger:hover { background: var(--err-bg) }
button.ghost { border-color: transparent; background: transparent; box-shadow: none; color: var(--muted); padding: 5px 8px }
button.ghost:hover { background: var(--hover); color: var(--ink) }
button:disabled { opacity: .5; cursor: not-allowed }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap }
.spacer { flex: 1 } .muted { color: var(--muted) } .small { font-size: 12.5px }
.flash { padding: 11px 15px; border-radius: 9px; margin-bottom: 16px; border: 1px solid transparent }
.flash.ok { background: var(--ok-bg); color: var(--ok) } .flash.warn { background: var(--warn-bg); color: var(--warn) } .flash.error { background: var(--err-bg); color: var(--err) }
pre, .mail { white-space: pre-wrap; word-break: break-word; background: var(--code); border-radius: 7px; padding: 12px; font: 13px/1.55 ui-monospace, Menlo, Consolas, monospace; margin: 0 }
code { background: var(--code); padding: 1px 5px; border-radius: 4px; font-size: 12.5px }
ul.issues { margin: 8px 0; padding-left: 18px } ul.issues li.block { color: var(--err) } ul.issues li.warn { color: var(--warn) }
.qitem { border-left: 4px solid var(--accent) } .qitem.reply { border-left-color: var(--ok) }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px } @media (max-width: 900px) { .two { grid-template-columns: 1fr } }
.login { max-width: 380px; margin: 12vh auto }
