:root {
  --bg: #f5f7f7;
  --surface: #ffffff;
  --surface-2: #f0f4f2;
  --text: #17231e;
  --muted: #6c7872;
  --line: #dfe7e2;
  --accent: #0e7a5f;
  --accent-2: #dff3eb;
  --danger: #b23a48;
  --warning: #9a6810;
  --shadow: 0 14px 34px rgba(20, 47, 36, .08);
  --radius: 18px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 280px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; background: #10241d; color: #fff; padding: 28px 22px; display: flex; flex-direction: column; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 4px; }
.brand-mark { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; font-weight: 800; font-size: 24px; background: #dff3eb; color: #0b654f; box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); }
.brand-name { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.brand-sub { font-size: 12px; opacity: .65; margin-top: 1px; }
.tenant-block { padding: 14px; border-radius: 15px; background: rgba(255,255,255,.075); border: 1px solid rgba(255,255,255,.09); }
.tenant-block label { display:block; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; opacity:.62; margin-bottom:7px; }
.tenant-block select { width:100%; border:0; border-radius:10px; padding:10px; color:#10241d; background:#fff; font-weight:650; }
.tenant-caption { font-size: 11px; opacity:.55; margin-top:8px; line-height:1.35; }
.nav { display: grid; gap: 7px; }
.nav-item { border: 0; text-align: left; color: rgba(255,255,255,.72); background: transparent; border-radius: 12px; padding: 11px 12px; display:flex; align-items:center; gap:10px; font-weight:650; transition:.15s ease; }
.nav-item span { width: 22px; text-align:center; opacity:.8; }
.nav-item:hover { background: rgba(255,255,255,.06); color:#fff; }
.nav-item.active { background: #dff3eb; color:#0d5e4a; }
.sidebar-footer { margin-top:auto; display:grid; gap:10px; padding:0 4px; }
.env-pill { display:inline-flex; width:max-content; border-radius:999px; padding:5px 9px; background:rgba(255,255,255,.08); font-size:11px; }
.small { font-size: 11px; line-height:1.45; }
.muted { color: var(--muted); }
.sidebar .muted { color: rgba(255,255,255,.52); }
.main { min-width:0; }
.topbar { min-height: 104px; padding: 24px 34px 20px; display:flex; align-items:center; justify-content:space-between; gap:18px; border-bottom:1px solid var(--line); background:rgba(245,247,247,.93); backdrop-filter: blur(14px); position:sticky; top:0; z-index:10; }
h1 { font-size: 28px; line-height:1.05; margin:4px 0 0; letter-spacing:-.035em; }
h2 { margin:0; font-size:20px; letter-spacing:-.02em; }
h3 { margin:0; font-size:15px; }
.eyebrow { font-size:11px; text-transform:uppercase; letter-spacing:.09em; color:var(--muted); font-weight:750; }
.top-actions { display:flex; gap:10px; align-items:center; }
.button { border:1px solid var(--line); border-radius:11px; padding:10px 14px; background:#fff; color:var(--text); font-weight:700; }
.button.primary { background:var(--accent); color:#fff; border-color:var(--accent); }
.button.ghost { background:transparent; }
.button.small-btn { padding:7px 10px; font-size:12px; }
.icon-button { width:38px; height:38px; border:1px solid var(--line); background:#fff; border-radius:10px; display:grid; place-items:center; color:var(--text); }
.mobile-only { display:none; }
.view { padding: 28px 34px 48px; max-width: 1450px; margin:0 auto; }
.grid { display:grid; gap:16px; }
.kpi-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
.card { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow); }
.kpi { padding:19px 20px; min-height:130px; display:flex; flex-direction:column; justify-content:space-between; }
.kpi-label { color:var(--muted); font-size:12px; font-weight:700; }
.kpi-value { font-size:28px; font-weight:820; letter-spacing:-.035em; margin-top:8px; }
.kpi-meta { font-size:12px; color:var(--muted); margin-top:5px; }
.kpi.accent { background:linear-gradient(140deg,#0e7a5f,#105b4b); color:#fff; border-color:transparent; }
.kpi.accent .kpi-label,.kpi.accent .kpi-meta { color:rgba(255,255,255,.7); }
.content-grid { display:grid; grid-template-columns: 1.45fr .85fr; gap:16px; margin-top:16px; }
.panel { padding:20px; }
.panel-header { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:16px; }
.panel-title-sub { font-size:12px; color:var(--muted); margin-top:4px; }
.category-list { display:grid; gap:12px; }
.category-row { display:grid; grid-template-columns:minmax(210px,1fr) 120px; gap:16px; align-items:center; }
.category-top { display:flex; justify-content:space-between; gap:14px; font-size:13px; }
.bar { height:7px; border-radius:999px; background:#edf1ef; overflow:hidden; margin-top:7px; }
.bar > div { height:100%; border-radius:inherit; background:linear-gradient(90deg,#0e7a5f,#47a889); }
.money { font-variant-numeric: tabular-nums; white-space:nowrap; }
.stat-list { display:grid; gap:10px; }
.stat-row { display:flex; align-items:center; justify-content:space-between; gap:18px; padding:12px 0; border-bottom:1px solid var(--line); }
.stat-row:last-child { border-bottom:0; }
.stat-row .label { font-size:13px; color:var(--muted); }
.stat-row strong { font-size:14px; }
.notice { margin-top:16px; padding:14px 16px; border-radius:14px; border:1px solid #f0dfba; background:#fff8e9; color:#61440e; font-size:13px; line-height:1.45; }
.notice.success { border-color:#cbe7dc; background:#eef8f4; color:#0e604c; }
.toolbar { display:flex; gap:10px; align-items:center; justify-content:space-between; margin-bottom:14px; flex-wrap:wrap; }
.toolbar-left,.toolbar-right { display:flex; gap:9px; align-items:center; flex-wrap:wrap; }
.search { border:1px solid var(--line); border-radius:11px; background:#fff; padding:9px 12px; min-width:270px; }
.select { border:1px solid var(--line); border-radius:11px; background:#fff; padding:9px 11px; }
.table-card { overflow:hidden; }
.table-wrap { overflow:auto; }
table { width:100%; border-collapse:collapse; font-size:13px; }
th { text-align:left; color:var(--muted); font-size:11px; text-transform:uppercase; letter-spacing:.055em; background:#fafcfa; position:sticky; top:0; }
th,td { padding:12px 14px; border-bottom:1px solid var(--line); vertical-align:middle; }
td.right, th.right { text-align:right; }
tbody tr:hover { background:#fbfdfc; }
.tag { display:inline-flex; align-items:center; gap:5px; border-radius:999px; padding:4px 8px; font-size:11px; font-weight:750; background:var(--surface-2); color:#4f5f58; }
.tag.active { color:#0e654f; background:#e0f3eb; }
.tag.waiting { color:#755212; background:#fbf0d7; }
.tag.completed { color:#6e7270; background:#ecefed; }
.tag.reserve { color:#305d91; background:#eaf2fb; }
.group-title { font-weight:800; font-size:12px; text-transform:uppercase; letter-spacing:.05em; color:#496057; background:#f5f8f6; }
.goal-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.goal-card { padding:18px; display:grid; gap:15px; }
.goal-card .top { display:flex; justify-content:space-between; gap:12px; }
.goal-name { font-weight:800; line-height:1.25; }
.goal-category { font-size:11px; color:var(--muted); margin-top:4px; }
.goal-numbers { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.goal-number { background:#f7faf8; border:1px solid #edf2ef; border-radius:12px; padding:10px; }
.goal-number span { display:block; font-size:10px; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); margin-bottom:5px; }
.goal-number strong { font-size:14px; }
.section-heading { display:flex; align-items:end; justify-content:space-between; gap:12px; margin:24px 0 12px; }
.section-heading:first-child { margin-top:0; }
.empty { padding:34px; text-align:center; color:var(--muted); }
.member-list { display:grid; gap:10px; }
.member { display:flex; align-items:center; justify-content:space-between; padding:12px; border:1px solid var(--line); border-radius:13px; }
.member-main { display:flex; gap:10px; align-items:center; }
.avatar { width:34px;height:34px;border-radius:50%;display:grid;place-items:center;background:#e3eee9;color:#0d6b53;font-weight:800; }
.settings-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.integration-card { padding:18px; }
.integration-row { display:flex; justify-content:space-between; align-items:flex-start; gap:18px; padding:12px 0; border-bottom:1px solid var(--line); }
.integration-row:last-child { border-bottom:0; }
.integration-name { font-weight:750; font-size:13px; }
.integration-desc { color:var(--muted); font-size:12px; margin-top:4px; line-height:1.45; }
.code { font-family: ui-monospace,SFMono-Regular,Menlo,monospace; font-size:11px; background:#f2f5f3; padding:3px 6px; border-radius:6px; }
.flash { margin:16px 34px 0; padding:11px 14px; border-radius:11px; background:#e5f5ee; border:1px solid #cbe9dc; color:#145b49; font-size:13px; }
.hidden { display:none !important; }
.dialog { border:0; border-radius:20px; padding:0; width:min(640px,calc(100vw - 28px)); box-shadow:0 26px 80px rgba(7,34,24,.25); }
.dialog::backdrop { background:rgba(10,28,22,.45); backdrop-filter:blur(3px); }
.dialog form { padding:22px; }
.dialog-header { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; margin-bottom:18px; }
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.field { display:grid; gap:6px; font-size:12px; font-weight:700; color:#4c5b55; }
.field-wide { grid-column:1 / -1; }
.field input,.field select { border:1px solid var(--line); border-radius:10px; padding:10px 11px; background:#fff; color:var(--text); }
.calc-preview { margin-top:14px; padding:12px; border-radius:12px; background:#f3f8f5; font-size:13px; }
.dialog-actions { margin-top:20px; display:flex; justify-content:flex-end; gap:9px; }
@media (max-width: 1080px) {
  .kpi-grid { grid-template-columns:repeat(2,1fr); }
  .goal-grid { grid-template-columns:repeat(2,1fr); }
  .content-grid,.settings-grid { grid-template-columns:1fr; }
}
@media (max-width: 780px) {
  .app-shell { grid-template-columns:1fr; }
  .sidebar { position:fixed; left:-300px; z-index:30; width:280px; transition:.2s ease; box-shadow:20px 0 50px rgba(0,0,0,.18); }
  .sidebar.open { left:0; }
  .mobile-only { display:grid; }
  .topbar { padding:18px; min-height:86px; }
  .topbar > div:nth-child(2) { flex:1; }
  .top-actions .ghost { display:none; }
  .view { padding:18px; }
  .flash { margin:12px 18px 0; }
  .kpi-grid,.goal-grid { grid-template-columns:1fr; }
  .category-row { grid-template-columns:1fr; gap:5px; }
  .search { min-width:0; width:100%; }
  .toolbar-left,.toolbar-right { width:100%; }
  .form-grid { grid-template-columns:1fr; }
  .field-wide { grid-column:auto; }
}

/* Fivaldi Core 0.2 aanvullingen */
a { color: inherit; text-decoration: none; }
.brand { text-decoration: none; }
.nav-item { display:flex; text-decoration:none; }
.field-label { display:block; font-size:.76rem; font-weight:700; color:var(--muted); margin-bottom:6px; text-transform:uppercase; letter-spacing:.06em; }
.tenant-link { display:block; padding:10px 11px; border:1px solid var(--border); border-radius:10px; background:var(--surface); font-weight:700; }
.inline-form { display:inline; margin:0; }
.messages { margin: 0 0 14px; }
.flash { padding:12px 14px; border:1px solid var(--border); border-radius:12px; background:var(--surface); }
.flash.success { border-color:#b9e7d1; background:#f1fbf6; }
.flash.error { border-color:#f0c1c1; background:#fff5f5; }
.main-auth { margin-left:0; min-height:100vh; display:grid; place-items:center; width:100%; }
.auth-view { width:min(460px, calc(100vw - 32px)); }
.auth-card { padding:30px; }
.auth-brand { margin-bottom:26px; }
.auth-card h1 { margin:.35rem 0 .5rem; }
.stack-form { display:grid; gap:16px; margin-top:22px; }
.stack-form label { display:grid; gap:7px; font-weight:700; }
.stack-form input, .model-form input, .model-form select, .model-form textarea { width:100%; box-sizing:border-box; border:1px solid var(--border); border-radius:10px; background:var(--surface); padding:10px 11px; color:var(--text); font:inherit; }
.stack-form input:focus, .model-form input:focus, .model-form select:focus, .model-form textarea:focus { outline:2px solid rgba(30,91,79,.18); border-color:var(--accent); }
.wide { width:100%; justify-content:center; }
.narrow-panel { max-width:760px; }
.family-list { display:grid; gap:10px; }
.family-choice { border:1px solid var(--border); border-radius:12px; background:var(--surface); padding:15px 16px; display:flex; justify-content:space-between; text-align:left; cursor:pointer; color:inherit; font:inherit; }
.family-choice:hover { border-color:var(--accent); background:var(--accent-soft); }
.family-choice span:first-child { display:grid; gap:3px; }
.family-choice small { color:var(--muted); }
.form-panel { max-width:980px; }
.model-form .field { display:grid; gap:7px; }
.model-form .field > span { font-weight:700; font-size:.9rem; }
.model-form .field small { color:var(--muted); line-height:1.35; }
.model-form .field small.error { color:#a62828; }
.model-form ul.errorlist { margin:0; padding-left:18px; color:#a62828; }
.model-form input[type=checkbox] { width:auto; justify-self:start; }
.notice.danger { border-color:#f0c1c1; background:#fff5f5; color:#7b2020; }
.card-actions { margin-top:14px; display:flex; justify-content:flex-end; }
code, .code { font-family: ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace; }
@media (max-width:760px){ .main-auth{padding:16px}.auth-card{padding:22px}.inline-form{display:none} }
