/* RaBePro Accounting — zwart · groen · wit */
:root {
  --zwart: #0d0f0e;
  --zwart-2: #171a18;
  --groen: #2fb36d;
  --groen-d: #1f8a50;
  --groen-l: #e7f6ee;
  --grijs: #d9ddda;
  --grijs-l: #f4f6f5;
  --lijn: #e3e7e4;
  --tekst: #141614;
  --muted: #6b726d;
  --rood: #c2412d;
  --oranje: #b7791f;
  --radius: 12px;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { color: var(--tekst); font-size: 14px; line-height: 1.45; }
a { color: var(--groen-d); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; margin: 0 0 18px; letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 22px 0 10px; }
h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 14px 0 4px; }
code, pre.code { background: var(--grijs-l); border-radius: 6px; padding: 2px 6px; font-size: 12px; }
pre.code { padding: 12px; overflow: auto; white-space: pre-wrap; }
.muted { color: var(--muted); }

/* ---------- Inlogscherm (uniform met de andere RaBePro-apps) ---------- */
body.login { background: var(--grijs); min-height: 100vh; }
.login-wrap { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); min-height: 100vh; padding: 14px 0 14px 14px; }
.login-panel { position: relative; background: var(--zwart); color: #fff; border: 2px solid var(--groen); border-radius: 20px;
  display: flex; flex-direction: column; justify-content: center; padding: 56px; overflow: hidden; }
.login-brand { position: absolute; top: 32px; left: 40px; font-size: 16px; display: flex; align-items: center; gap: 10px; }
.login-brand b { color: var(--groen); font-weight: 700; }
.login-text { position: relative; z-index: 1; max-width: 460px; }
.login-text h1 { font-size: 44px; line-height: 1.08; margin: 0 0 16px; color: #fff; }
.login-text p { color: #b9c1bc; font-size: 16px; margin: 0; }
.login-chart { position: absolute; left: 40px; right: 40px; bottom: 36px; width: calc(100% - 80px); height: 140px; }
.login-side { background: #fff; display: flex; align-items: center; justify-content: center; padding: 32px; }
.login-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 12px; }
.login-card.wide { max-width: 440px; }
.login-card h2 { font-size: 26px; margin: 0; }
.login-card label, .stack label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 13px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.btn-pill { display: inline-block; background: var(--zwart); color: #fff; border: 0; border-radius: 999px; padding: 13px 22px; font-weight: 600;
  font-size: 15px; cursor: pointer; text-align: center; margin-top: 6px; }
.btn-pill:hover { background: #000; text-decoration: none; box-shadow: 0 0 0 3px var(--groen-l); }
.brand-mark { width: 14px; height: 14px; border-radius: 4px; background: var(--groen); display: inline-block; box-shadow: 0 0 0 3px rgba(47,179,109,.25); }
@media (max-width: 860px) {
  .login-wrap { grid-template-columns: 1fr; padding: 14px; gap: 14px; }
  .login-panel { min-height: 300px; padding: 70px 28px 28px; }
  .login-text h1 { font-size: 32px; }
  .login-chart { display: none; }
  .login-side { border-radius: 20px; }
}

/* ---------- App-indeling ---------- */
body.app { display: flex; min-height: 100vh; background: var(--grijs-l); }
.side { width: 240px; flex-shrink: 0; background: var(--zwart); color: #cfd6d2; padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  border-right: 3px solid var(--groen); }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-size: 15px; padding: 4px 8px 18px; }
.brand b { color: var(--groen); }
.brand:hover { text-decoration: none; }
.nav-section { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #7d8681; margin: 16px 8px 6px; }
.nav-link { display: block; color: #e6ebe8; padding: 7px 10px; border-radius: 8px; }
.nav-link:hover { background: var(--zwart-2); text-decoration: none; }
.nav-link.active { background: var(--groen); color: #fff; font-weight: 600; }
.nav-sub { margin: 4px 0 4px 10px; border-left: 1px solid #2a2f2c; padding-left: 6px; }
.nav-sub a { display: block; color: #9fb0a7; font-size: 12.5px; padding: 4px 8px; border-radius: 6px; }
.nav-sub a:hover { color: #fff; background: var(--zwart-2); text-decoration: none; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 28px; background: #fff; border-bottom: 1px solid var(--lijn); position: sticky; top: 0; z-index: 5; }
.adminswitch { display: flex; align-items: center; gap: 10px; }
.adminswitch label { font-size: 12px; color: var(--muted); }
.adminswitch select { min-width: 280px; font-weight: 600; }
.user { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--zwart); color: var(--groen); display: grid; place-items: center; font-weight: 700; }
.content { padding: 24px 28px 60px; max-width: 1500px; }

/* ---------- Formulieren ---------- */
input, select, textarea { font: inherit; padding: 8px 10px; border: 1px solid #cfd5d1; border-radius: 8px; background: #fff; color: var(--tekst); min-width: 0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--groen); box-shadow: 0 0 0 3px var(--groen-l); }
input.num { text-align: right; font-variant-numeric: tabular-nums; }
.card { background: #fff; border: 1px solid var(--lijn); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; }
.card h2:first-child { margin-top: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid.narrow { max-width: 640px; }
.form-grid label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 12.5px; color: #3b413d; }
.form-grid label small { font-weight: 400; color: var(--muted); }
.form-grid label.check, label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
.span2 { grid-column: span 2; } .span3 { grid-column: span 3; } .span4 { grid-column: 1 / -1; }
.form-grid h2 { margin: 0; }
.readonly .lbl { display: block; font-size: 12px; color: var(--muted); }
.actions { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.actions .spacer { flex: 1; }
.actions .right { margin-left: auto; }
.hint { color: var(--muted); font-size: 12.5px; margin: 10px 0 0; }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; border: 1px solid #cfd5d1; background: #fff; color: var(--tekst);
  font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--zwart); text-decoration: none; }
.btn-primary { background: var(--zwart); border-color: var(--zwart); color: #fff; }
.btn-primary:hover { background: #000; box-shadow: 0 0 0 3px var(--groen-l); }
.btn-danger { color: var(--rood); border-color: #f0c8c1; }
.btn-danger:hover { border-color: var(--rood); }
.btn-sm { padding: 4px 10px; font-size: 12.5px; }
.icon-btn { border: 0; background: none; font-size: 18px; color: #9aa39d; cursor: pointer; padding: 0 6px; }
.icon-btn:hover { color: var(--rood); }

.toolbar, .filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar form.inline, .filters { margin-left: 0; }
.toolbar form.inline { display: flex; gap: 8px; margin-left: auto; }
.filters select.wide { min-width: 320px; }
.inline-lbl { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }

.flash { padding: 10px 14px; border-radius: 10px; margin-bottom: 12px; border: 1px solid; }
.flash-ok { background: var(--groen-l); border-color: #bfe6cf; color: #145c36; }
.flash-warn { background: #fdf6e7; border-color: #f1dca8; color: #7a5310; }
.flash-err { background: #fdeeec; border-color: #f2c4bc; color: #8a2a1b; }

.badge { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: #eceeed; color: #505752; }
.badge.ok { background: var(--groen-l); color: var(--groen-d); }
.badge.warn { background: #fdf1d8; color: var(--oranje); }
a.badge:hover { text-decoration: none; filter: brightness(.97); }

/* ---------- Tabellen ---------- */
table.grid { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; border: 1px solid var(--lijn); border-radius: var(--radius); overflow: hidden; }
table.grid th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); background: #fafbfa; padding: 9px 10px; border-bottom: 1px solid var(--lijn); white-space: nowrap; }
table.grid td { padding: 8px 10px; border-bottom: 1px solid #eef1ef; vertical-align: middle; }
table.grid tbody tr:last-child td { border-bottom: 0; }
table.grid tr.clickable { cursor: pointer; }
table.grid tbody tr:hover td { background: #f7faf8; }
table.grid tr.current td { background: var(--groen-l); }
table.grid .num, table.grid th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.grid th.c { text-align: center; }
table.grid .right { text-align: right; white-space: nowrap; }
table.grid .cb { width: 28px; }
table.grid .empty, p.empty { color: var(--muted); text-align: center; padding: 22px; }
table.grid tr.muted-row td { color: #a3aaa5; }
table.grid tr.auto-row td { color: var(--muted); background: #fafbfa; }
table.grid tr.section td { background: var(--zwart); color: #fff; font-weight: 600; font-size: 12.5px; letter-spacing: .02em; }
table.grid tr.subtotal td { font-weight: 600; background: #f3f6f4; border-top: 1px solid var(--lijn); }
table.grid tr.total td, table.grid tfoot td { font-weight: 700; background: #eef6f1; border-top: 2px solid var(--groen); }
table.grid.compact td { padding: 6px 8px; }
table.grid .strong { font-weight: 700; }
.narrow-table { max-width: 900px; }
.neg { color: var(--rood); } .pos { color: var(--groen-d); }

table.lines { margin-top: 16px; }
table.lines td { padding: 5px 6px; }
table.lines input, table.lines select { width: 100%; padding: 6px 8px; }
table.lines .w-s { max-width: 130px; }
table.lines td.del { width: 34px; text-align: center; }
table.lines td:first-child { min-width: 240px; }

.status-line { display: flex; align-items: center; gap: 10px; margin: -8px 0 14px; }
.status-line .right { margin-left: auto; }

/* ---------- Dashboard ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: #fff; border: 1px solid var(--lijn); border-left: 4px solid var(--groen); border-radius: var(--radius); padding: 12px 14px; }
.kpi span { display: block; font-size: 12px; color: var(--muted); }
.kpi b { font-size: 20px; font-variant-numeric: tabular-nums; }
.kpi.small b { font-size: 16px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; }
.chart { width: 100%; height: auto; }
.chart .gridline { stroke: #edf0ee; }
.chart .bar-opbr { fill: var(--groen); }
.chart .bar-kost { fill: var(--zwart); }
.chart .axis { font-size: 11px; fill: var(--muted); }
.legend { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; margin-top: 6px; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-left: 8px; }
.sw.opbr { background: var(--groen); } .sw.kost { background: var(--zwart); }

@media (max-width: 1000px) {
  body.app { flex-direction: column; }
  .side { width: 100%; height: auto; position: static; border-right: 0; border-bottom: 3px solid var(--groen); }
  .two-col, .form-grid, .form-grid.three, .form-grid.four { grid-template-columns: 1fr; }
  .span2, .span3, .span4 { grid-column: auto; }
  .adminswitch select { min-width: 0; }
}
