﻿:root {
  color-scheme: light;
  --navy: #142b4c;
  --blue: #2563eb;
  --background: #f3f6fb;
  --muted: #536681;
  --line: #dce5f1;
  --shadow: 0 5px 20px rgb(20 43 76 / .055);
  font: 15px/1.55 "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  color: var(--navy);
  background: var(--background);
}

* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
a { color: #164dbf; text-underline-offset: .2em; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
button, input, select, textarea { font: inherit; }
button, .button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 38px; padding: 8px 13px; border: 1px solid var(--line);
  border-radius: 9px; background: #fff; color: var(--navy);
  font-weight: 600; text-decoration: none; cursor: pointer;
}
button:hover, .button:hover { border-color: #a3baf0; background: #edf3ff; }
button:disabled { opacity: .55; cursor: default; }
input:not([type="checkbox"]), select, textarea {
  padding: 8px 10px; min-height: 39px; border: 1px solid #bdcce0;
  border-radius: 8px; background: #f8faff; color: var(--navy); max-width: 100%;
}
label { display: block; font-size: .82rem; font-weight: 650; }
h1, h2, h3 { margin: 0 0 .65em; line-height: 1.14; letter-spacing: -.025em; }
h1 { font-size: clamp(1.95rem, 4vw, 3.45rem); }
h2 { font-size: clamp(1.17rem, 2vw, 1.55rem); }
h3 { font-size: 1rem; }
p { margin: 0 0 .9rem; }
small, .sub { color: var(--muted); }
section { scroll-margin-top: 18px; }

.dashboard-shell { --sidebar: 230px; }
.dashboard-shell.nav-collapsed { --sidebar: 70px; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 2; width: var(--sidebar);
  display: flex; flex-direction: column; gap: 24px; padding: 22px 12px;
  overflow: auto; background: #fff; border-right: 1px solid var(--line);
}
.brand { display: flex; gap: 11px; align-items: center; color: var(--navy); text-decoration: none; margin: 0 4px; }
.brand-mark {
  width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center;
  border-radius: 11px; color: #fff; background: var(--blue); box-shadow: 0 5px 12px #2455a940;
}
.brand-mark svg, .icon-button svg { width: 22px; height: 22px; }
.brand-name { font-size: .89rem; letter-spacing: .11em; font-weight: 800; line-height: 1.1; white-space: nowrap; }
.brand-name small { display: block; margin-top: 5px; font-size: .65rem; letter-spacing: .16em; }
.sidebar nav { display: grid; gap: 4px; }
.sidebar nav a {
  min-height: 42px; padding: 8px 10px; display: flex; gap: 9px; align-items: center;
  border-radius: 8px; color: var(--muted); font-size: .83rem; font-weight: 600; text-decoration: none;
}
.sidebar nav a svg { flex: 0 0 18px; height: 18px; }
.sidebar nav a:hover, .sidebar nav a[aria-current] { color: #154cba; background: #eaf1ff; }
.sidebar-footer { margin: auto 8px 0; font-size: .78rem; }
.nav-collapsed .sidebar nav a span, .nav-collapsed .brand-name, .nav-collapsed .sidebar-footer {
  position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; white-space: nowrap;
}
.nav-collapsed .sidebar nav a { justify-content: center; }
.dashboard-shell main { margin-left: var(--sidebar); padding: 0 clamp(16px, 3vw, 44px) 24px; max-width: 1720px; }
.executive-header {
  min-height: 72px; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; border-bottom: 1px solid var(--line);
}
.executive-header > div { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.executive-header strong { font-size: .8rem; font-weight: 800; letter-spacing: .11em; }
.icon-button { padding: 7px; width: 38px; }
#role { color: var(--muted); font-size: .8rem; }
#notice { margin: 10px 0 0; color: #754716; font-size: .85rem; }
#notice:empty { display: none; }
#overzicht { padding-top: 22px; }
.heading {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  padding: clamp(21px, 3vw, 36px); border-radius: 19px; color: #fff;
  background: radial-gradient(ellipse at 85% -55%, #3e79dc 0, transparent 68%), linear-gradient(112deg, #142b4c 35%, #1d4384);
}
.heading h1 { margin: 0 0 8px; }
.heading .sub { margin: 0; color: #d8e6ff; }
.demo-label {
  flex: 0 0 auto; border: 1px solid #ffe3a3; border-radius: 20px; background: #fff0c8;
  color: #604212; padding: 5px 10px; font-size: .67rem; letter-spacing: .05em;
}
.dashboard-filters, .invoice-controls {
  display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin: 14px 0 8px;
  padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: white;
}
.dashboard-filters input, .dashboard-filters select, .invoice-controls input, .invoice-controls select {
  display: block; margin-top: 4px;
}
.dashboard-filters button, .composer button, .login-card button, #scenario-form button {
  background: var(--blue); color: #fff; border-color: var(--blue);
}
.dashboard-filters button:hover, .composer button:hover, .login-card button:hover, #scenario-form button:hover {
  background: #184dc1;
}
.dashboard-status { margin: 8px 0; color: var(--muted); font-size: .79rem; }
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 14px 0; }
.card, #controller, #facturen, #rapporten, #owner-tools, #inzichten, #liquiditeit, #begroting, #databronnen {
  min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: 15px;
  padding: clamp(14px, 1.8vw, 22px); box-shadow: var(--shadow);
}
#controller, #facturen, #rapporten, #owner-tools, #inzichten, #liquiditeit, #begroting, #databronnen { margin-top: 16px; }
.kpi-card { display: grid; justify-content: stretch; justify-items: start; text-align: left; overflow-wrap: anywhere; }
.card .label { color: var(--muted); font-size: .82rem; font-weight: 700; }
.card .value {
  margin: 4px 0; font-size: clamp(1.18rem, 2vw, 1.77rem); font-weight: 750;
  line-height: 1.15; letter-spacing: -.035em; font-variant-numeric: tabular-nums;
}
.negative-value { color: #9e2c38; }
.kpi-card small { font-size: .72rem; }
.kpi-trend { display: block; width: 100%; margin-top: 4px; }
.kpi-trend svg { display: block; width: min(100%, 120px); height: 25px; }
.kpi-trend polyline { fill: none; stroke: var(--blue); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#kpi-detail, .quality { margin: 0 0 14px; overflow-wrap: anywhere; }
.quality { margin-top: 14px; background: #eaf1ff; border-radius: 10px; padding: 14px; }

.finance-charts { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 14px; }
.finance-charts h2 { font-size: 1.16rem; margin-bottom: 8px; }
.finance-plot { display: grid; gap: 4px; max-height: 285px; overflow: auto; padding: 4px; }
.chart-point { display: grid; grid-template-columns: minmax(75px, 34%) 1fr; text-align: left; gap: 7px; background: #f5f8ff; font-size: .78rem; }
.chart-meters { display: grid; gap: 2px; }
.chart-meters meter { width: 100%; height: 10px; accent-color: var(--blue); }
.chart-meters meter::-webkit-meter-bar { background: #e4ecfc; border: 0; }
.chart-meters meter::-webkit-meter-optimum-value { background: var(--blue); }
.chart-meters .negative::-webkit-meter-optimum-value { background: #a72e45; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 11px; color: var(--muted); font-size: .76rem; }
.chart-legend span { border-left: 7px solid var(--blue); padding-left: 5px; }
.chart-legend span:nth-child(2) { border-color: #6980aa; }
.chart-legend span:nth-child(3) { border-color: #087f88; }
#profit-chart > svg { display: block; width: 100%; height: auto; }
#profit-chart svg text { fill: var(--muted); font-size: 13px; }
#profit-chart svg line { stroke: #e0e8f4; }
#profit-chart svg polyline { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
#profit-chart svg .series-0 { stroke: var(--blue); }
#profit-chart svg .series-1 { stroke: #6980aa; }
#profit-chart svg .series-2 { stroke: #087f88; }
#profit-chart svg .selected-point { stroke: #526789; stroke-dasharray: 4 4; }
.plot-dates { display: flex; gap: 4px; overflow-x: auto; padding: 4px 3px; }
.plot-dates button { min-height: 32px; white-space: nowrap; padding: 4px 7px; font-size: .72rem; }
.plot-dates button[aria-pressed="true"] { background: #e5efff; border-color: #6d97ef; }
.chart-reading { margin: 8px 0 0; min-height: 1.5em; font-size: .78rem; color: var(--muted); }
.insight-card { background: linear-gradient(160deg, #132d54, #1c4382); border-color: #1c4382; color: #fff; }
.insight-card h3 { margin-top: 13px; }
.insight-card p, .insight-card li { color: #e3edff; font-size: .82rem; }
.insight-card ul { padding: 0; margin: 0; list-style: none; }
.insight-card li { padding: 7px 0; border-bottom: 1px solid #ffffff38; }
.insight-card .source { margin: 4px 0 0; min-height: 30px; background: #fff; color: #174594; }
.section-head, .composer { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.suggestions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.composer { margin: 5px 0 8px; }
.composer textarea { flex: 1; min-width: 0; resize: vertical; }
.pill { display: inline-block; font-size: .72rem; background: #eaf1ff; color: #174594; padding: 5px 9px; border-radius: 20px; }
.answer { white-space: pre-wrap; overflow-wrap: anywhere; border-left: 3px solid var(--blue); padding: 12px 15px; background: #f3f7ff; margin: 12px 0; border-radius: 8px; }
.source { font-size: .74rem; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; text-align: left; border-collapse: collapse; }
th, td { padding: 10px 13px; border-bottom: 1px solid var(--line); font-size: .85rem; }
th { background: #f1f5fe; }
details, #detail { margin-top: 12px; }
summary { cursor: pointer; color: #164dbf; }
#scenario-form, #member-form { margin-top: 16px; display: grid; gap: 8px; justify-items: start; }
pre { max-width: 100%; overflow: auto; }
footer { border-top: 1px solid var(--line); color: var(--muted); padding-top: 15px; margin-top: 25px; font-size: .8rem; }

.login-shell { display: grid; place-items: center; min-height: 100dvh; padding: 18px; background: radial-gradient(ellipse at 90% 5%, #dce9ff, transparent 57%), var(--background); }
.login-card { width: min(100%, 450px); border: 1px solid var(--line); border-radius: 19px; background: #fff; box-shadow: var(--shadow); padding: clamp(22px, 5vw, 38px); }
.login-brand { color: #164dbf; font-size: .77rem; font-weight: 800; letter-spacing: .1em; }
.login-card h1 { font-size: clamp(1.6rem, 5vw, 2.15rem); }
.login-card input, .login-card button { display: block; width: 100%; margin-top: 5px; }
.login-card form { margin-bottom: 16px; }

@media (max-width: 1120px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .finance-charts { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .dashboard-shell main { margin: 0; }
  .sidebar { position: static; width: 100%; padding: 12px 15px; gap: 10px; border: 0; border-bottom: 1px solid var(--line); }
  .sidebar nav { grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); }
  .sidebar nav a { padding: 5px 7px; }
  .nav-collapsed .sidebar { display: none; }
  .executive-header { min-height: 62px; }
  .heading { flex-direction: column; }
  .section-head { align-items: flex-start; flex-wrap: wrap; }
}
@media (max-width: 380px) {
  .dashboard-shell main { padding-inline: 11px; }
  .executive-header strong { font-size: .68rem; }
  .grid { gap: 8px; }
  .card { padding: 11px; }
}
