* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); font-size: 14px; color: var(--ink); background: var(--bg); line-height: 1.45; }
a { color: var(--brand-2); }
h1 { font-size: 20px; margin: 0 0 4px; }
h2 { font-size: 20px; margin: 0 0 4px; }
h3, .modal h2 { font-size: 15px; margin: 0 0 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
fieldset.plain { border: 0; margin: 0 0 8px; padding: 0; min-width: 0; }
.sub { color: var(--muted); margin: 0 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* Frame */
.app { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--brand); color: #fff; padding: 16px 12px; position: sticky; top: 0; height: 100vh; overflow: auto; }
.side .brand { font-size: 15px; font-weight: bold; margin: 4px 8px 14px; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 100; background: #fff; color: var(--brand); padding: 8px 14px; border-radius: 8px; font-weight: bold; }
.skip:focus { top: 8px; }
.side .grp { font-size: 11px; text-transform: uppercase; opacity: .75; margin: 14px 8px 4px; }
.side .navlink { display: block; color: #fff; text-decoration: none; padding: 8px 10px; border-radius: 8px; }
.side .navlink:hover { background: rgba(255, 255, 255, .1); }
.side .navlink.on { background: rgba(255, 255, 255, .2); font-weight: bold; }
.main { min-width: 0; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface); border-bottom: 1px solid var(--line); padding: 10px 20px; position: sticky; top: 0; z-index: 5; }
.top .left { display: flex; gap: 10px; align-items: center; min-width: 0; }
.crumb { color: var(--muted); }
.crumb b { color: var(--ink); }
.btn.menu-btn { display: none; }
.who { display: flex; align-items: center; gap: 8px; }
.cnt { background: #b3261e; color: #fff; border-radius: 10px; font-size: 11px; padding: 1px 7px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: #fff; border: 0; font-weight: bold; font-size: 12px; cursor: pointer; }
.acc { position: relative; }
.accmenu { display: none; position: absolute; right: 0; top: 38px; min-width: 210px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 6px 20px rgba(0, 0, 0, .12); padding: 6px; z-index: 30; }
.accmenu.open { display: block; }
.accmenu .accname { padding: 8px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.accmenu a, .accmenu button { display: block; width: 100%; text-align: left; background: none; border: 0; font: inherit; color: var(--ink); text-decoration: none; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.accmenu a:hover, .accmenu button:hover { background: var(--bg); }
.wrap { padding: 20px; max-width: 1280px; }

/* Onderdelen */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.kpi .n { font-size: 28px; font-weight: bold; color: var(--brand); }
.kpi .l { color: var(--muted); font-size: 12px; }
.badge { display: inline-block; border-radius: 20px; padding: 2px 9px; font-size: 12px; background: #eceff2; color: #34414d; white-space: nowrap; font-weight: normal; }
.b-ok { background: var(--ok-bg); color: var(--ok); }
.btn { display: inline-block; font: inherit; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 7px 13px; border-radius: 8px; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--brand-2); }
.btn.pri { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
.btn.pri:hover { background: var(--brand); }
.btn.dan { color: var(--bad); border-color: #e7b9b5; }
.btn.sm { padding: 3px 9px; font-size: 12px; }
.bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
input[type=text], input[type=email], input[type=password], input[type=search], select, textarea { font: inherit; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; background: #fff; color: var(--ink); max-width: 100%; }
label.f { display: block; margin-bottom: 12px; font-weight: bold; font-size: 12px; color: var(--muted); }
label.f input { display: block; margin-top: 4px; font-weight: normal; color: var(--ink); font-size: 14px; width: 100%; }
.tablewrap { position: relative; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table { border-collapse: collapse; width: 100%; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #f0f3f6; font-size: 12px; color: var(--muted); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.sortlink { color: inherit; text-decoration: none; }
.matrix td, .matrix th { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: left; }
td.acts { display: flex; gap: 6px; flex-wrap: wrap; }
td.acts form { margin: 0; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; padding: 8px 0; color: var(--muted); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; flex-wrap: wrap; }
.tab { padding: 9px 14px; color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; }
.tab.on { color: var(--brand); border-bottom-color: var(--brand-2); font-weight: bold; }
.note { background: var(--info-bg); border: 1px solid #c5dcec; color: #1d4d6e; border-radius: 8px; padding: 9px 12px; margin-bottom: 12px; font-size: 13px; }
.note.ok { background: var(--ok-bg); border-color: #b5dfc9; color: var(--ok); }
.note.bad { background: var(--bad-bg); border-color: #e7b9b5; color: var(--bad); }
.note.warn { background: var(--warn-bg); border-color: #ecd48a; color: var(--warn); }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.demo { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.demo button { padding: 16px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font: inherit; cursor: pointer; text-align: left; }
.demo button:hover { border-color: var(--brand-2); }

/* Inloggen */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.authcard { width: 100%; max-width: 420px; }
.authcard h1 { font-size: 17px; margin: 0 0 12px; color: var(--brand); }

/* Bevestigingsvenster */
.modal { border: 0; border-radius: 12px; max-width: 460px; width: calc(100% - 32px); padding: 20px; }
.modal::backdrop { background: rgba(20, 30, 40, .5); }
.modal .acts { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }

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

/* Responsive: tablet en telefoon */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; left: -260px; width: 240px; z-index: 40; transition: left .2s, visibility 0s .2s; visibility: hidden; }
  .side.open { left: 0; visibility: visible; transition: left .2s; }
  .btn.menu-btn { display: inline-block; }
  .g5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wrap { padding: 14px; }
}
@media (max-width: 560px) {
  .g2, .g5 { grid-template-columns: 1fr; }
  .top { padding: 10px 12px; }
  .crumb { display: none; }
}

/* Klassen die inline style= in beheertemplates vervingen */
.w-full { width: 100%; }
.mt-0 { margin-top: 0; }
.bar.bar-kop-klein { margin: 6px 0 0; }
.bar.bar-kop-midden { margin-top: 14px; }
textarea.code.code-kort { min-height: 140px; }
