:root {
  --navy: #131f2e;
  --navy-2: #1b2b3d;
  --navy-3: #243a52;
  --red: #f8362f;
  --red-soft: #fde4e3;
  --teal: #08566a;
  --teal-soft: #dcecef;
  --orange: #e8890c;
  --orange-soft: #fdf0dc;
  --grey: #c2c2c2;
  --grey-2: #e1e1e1;
  --bg: #efefef;
  --card: #ffffff;
  --ink: #131f2e;
  --muted: #5b6673;
  --line: #d9dcdf;
  --sidebar: 268px;
  --font: 'Lato', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
button, input, select { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--teal); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- sidebar ---------- */
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); background: var(--navy); color: #fff; display: flex; flex-direction: column; z-index: 40; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 14px; margin-top: 84px; padding: 20px 26px; background: var(--navy-2); text-decoration: none; color: #fff; }
.brand img { width: 50px; height: 50px; border-radius: 10px; flex: none; }
.brand b { display: block; font-size: 24px; font-weight: 900; letter-spacing: .01em; line-height: 1.05; }
.brand small { display: block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .85; margin-top: 4px; }
.nav { padding: 56px 34px 18px; }
.nav-label { color: var(--red); font-weight: 700; font-size: 15px; letter-spacing: .02em; padding-bottom: 18px; border-bottom: 1.5px solid var(--red); }
.nav a { display: flex; align-items: center; justify-content: space-between; color: #fff; text-decoration: none; font-weight: 700; font-size: 15px; letter-spacing: .03em; text-transform: uppercase; padding: 22px 0 22px; border-bottom: 1.5px solid rgba(248, 54, 47, .85); transition: color .15s, padding .15s; }
.nav a:hover { color: #ffd6d4; padding-left: 4px; }
.nav a.active { color: var(--red); }
.pill { white-space: nowrap; flex: none; display: inline-flex; align-items: center; justify-content: center; min-width: 30px; padding: 3px 10px; border-radius: 999px; background: var(--red); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .03em; line-height: 1.3; }
.pill.teal { background: var(--teal); }
.pill.navy { background: var(--navy-3); }
.side-tools { margin-top: auto; padding: 22px 34px 28px; display: grid; gap: 10px; }
.side-tools label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .7; }
.side-tools select, .side-btn { width: 100%; background: var(--navy-2); color: #fff; border: 1px solid var(--navy-3); border-radius: 4px; padding: 9px 11px; font-weight: 700; font-size: 13px; cursor: pointer; text-align: left; }
.side-btn:hover, .side-tools select:hover { border-color: var(--red); }
.side-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.side-foot { font-size: 11px; opacity: .55; padding: 0 34px 20px; }
.side-foot a { color: #fff; }

/* ---------- topbar ---------- */
.main { margin-left: var(--sidebar); min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 30; height: 92px; background: var(--grey); display: flex; align-items: center; gap: 30px; padding: 0 48px 0 54px; }
.burger { background: none; border: 0; padding: 6px; cursor: pointer; display: grid; gap: 6px; }
.burger span { display: block; width: 34px; height: 4px; background: var(--navy); border-radius: 1px; }
.topbar h1 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.bubble { position: relative; width: 46px; height: 40px; border: 0; background: none; cursor: pointer; padding: 0; }
.bubble svg { width: 46px; height: 40px; }
.bubble .badge { position: absolute; top: -8px; right: -6px; min-width: 24px; height: 24px; border-radius: 12px; background: var(--red); color: #fff; font-size: 14px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--grey); padding: 0 5px; }
.company { font-size: 19px; text-transform: uppercase; letter-spacing: .02em; max-width: 34vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- content ---------- */
.content { padding: 40px 44px 60px; }
.page { display: none; }
.page.active { display: block; }
.grid { display: grid; gap: 34px; margin-bottom: 34px; }
.g-top { grid-template-columns: minmax(0, 1.75fr) minmax(0, 1.75fr) minmax(0, .55fr); }
.g-mid { grid-template-columns: minmax(0, 2.05fr) minmax(0, 1fr); }
.g-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.card { background: var(--card); padding: 30px 34px; position: relative; min-width: 0; }
.card h2 { margin: 0 0 16px; font-size: 26px; font-weight: 900; text-transform: uppercase; letter-spacing: .005em; line-height: 1.1; }
.card h3 { margin: 0; font-size: 16px; font-weight: 900; text-transform: uppercase; letter-spacing: .01em; }
.card p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.redtxt { color: var(--red); }
.tealtxt { color: var(--teal); }

/* donuts */
.donuts { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; text-align: center; }
.donut { position: relative; width: min(100%, 236px); aspect-ratio: 1; margin: 0 auto 18px; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut .c { position: absolute; inset: 0; display: grid; place-content: center; line-height: 1; }
.donut .c small { font-size: 17px; font-weight: 700; text-transform: uppercase; }
.donut .c b { font-size: clamp(26px, 2.6vw, 34px); font-weight: 900; margin-top: 4px; }
.donuts h3 { font-size: 19px; }
.donuts p { font-size: 14px; margin-top: 4px; }

/* horizontal bars */
.hbars { display: grid; gap: 0; }
.hbar { display: grid; grid-template-columns: minmax(120px, .95fr) minmax(0, 1.25fr); gap: 24px; align-items: center; padding: 15px 0; }
.hbar .lab { font-weight: 900; font-size: 15px; text-transform: uppercase; padding-bottom: 16px; border-bottom: 1.5px solid var(--navy); margin-bottom: -16px; }
.hbar:last-child .lab { border-bottom: 0; }
.hbar .lab small { display: block; font-weight: 400; font-size: 11px; text-transform: none; color: var(--muted); }
.track { position: relative; height: 40px; background: var(--grey); }
.fill { position: absolute; inset: 0 auto 0 0; background: var(--teal); transition: width .5s ease-out; }
.fill.red { background: var(--red); }
.fill.navy { background: var(--navy); }
.track span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #fff; font-weight: 900; font-size: 21px; text-shadow: 0 0 6px rgba(0, 0, 0, .25); white-space: nowrap; }

/* stars */
.stars { display: grid; gap: 30px; text-align: center; align-content: center; height: 100%; }
.stars svg { width: 50px; height: 50px; }
.stars b { display: block; font-size: 30px; font-weight: 900; line-height: 1.1; }
.stars p { font-size: 12px; line-height: 1.3; }

/* gauge */
.gauge-wrap { display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: 38px; align-items: center; }
.gauge svg { width: 100%; height: auto; display: block; }
.totals { display: grid; grid-template-columns: 1fr auto 1fr; gap: 22px; align-items: center; text-align: center; margin: 18px 0 26px; }
.totals .div { width: 2px; height: 110px; background: var(--navy); }
.tot small { display: block; font-size: 26px; text-transform: uppercase; line-height: 1; }
.tot b { display: block; white-space: nowrap; font-size: clamp(26px, 2.7vw, 44px); font-weight: 900; line-height: 1.05; letter-spacing: -.01em; }
.tot em { display: block; font-style: normal; color: var(--red); font-size: 18px; text-transform: uppercase; }

/* signals card */
.sig-head { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 22px; align-items: start; }
.sig-icon { width: 120px; height: 120px; background: var(--red); display: grid; place-items: center; }
.sig-icon svg { width: 80px; height: 80px; }
.sig-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: end; margin: 6px 0 22px; }
.vbars { display: flex; gap: 30px; align-items: end; height: 140px; }
.vbar { width: 30px; height: 100%; background: var(--grey); position: relative; }
.vbar i { position: absolute; left: 0; right: 0; bottom: 0; background: var(--navy); transition: height .5s; }
.vbar i.red { background: var(--red); }
.vbar i.teal { background: var(--teal); }
.vbar i.orange { background: var(--orange); }
.vbar-lab { display: flex; gap: 30px; font-size: 10px; font-weight: 700; text-transform: uppercase; margin-top: 6px; }
.vbar-lab span { width: 30px; text-align: center; }

/* bottom cards */
.split { display: grid; grid-template-columns: minmax(0, 1.15fr) 2px minmax(0, 1fr); gap: 36px; align-items: center; }
.split .div { width: 2px; align-self: stretch; background: var(--navy); }
.kpi-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 2px solid var(--navy); }
.kpi-head small { font-size: clamp(18px, 1.7vw, 26px); text-transform: uppercase; line-height: 1; }
.kpi-big { white-space: nowrap; font-size: clamp(30px, 3.2vw, 50px); font-weight: 900; margin: 12px 0 12px; line-height: 1.05; letter-spacing: -.01em; }
.rbar { height: 40px; border-radius: 20px; background: var(--grey); overflow: hidden; position: relative; }
.rbar i { position: absolute; inset: 0 auto 0 0; border-radius: 20px; background: var(--red); transition: width .5s; }
.rbar i.teal { background: var(--teal); }
.rbar-lab { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; }

/* trend chart */
.chart svg { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; margin-top: 10px; }
.legend i { display: inline-block; width: 12px; height: 12px; margin-right: 6px; vertical-align: -1px; }

/* tables */
.table-wrap { overflow-x: auto; margin: 0 -6px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 10px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; white-space: normal; }
thead th { font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; border-bottom: 2px solid var(--navy); vertical-align: bottom; }
tbody tr:hover { background: #f7f7f7; }
tr.grp td { background: var(--navy); color: #fff; font-weight: 900; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; padding: 7px 10px; }
td.cur, th.cur { background: #f3f7f8; }
.lvl { display: inline-block; font-size: 10px; font-weight: 900; letter-spacing: .05em; padding: 1px 6px; border-radius: 3px; margin-left: 6px; vertical-align: 1px; background: var(--grey-2); color: var(--muted); }
.lvl.b { background: var(--navy); color: #fff; }
.tag { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; }
.tag.good { background: var(--teal-soft); color: var(--teal); }
.tag.mid { background: var(--grey-2); color: var(--navy); }
.tag.bad { background: var(--red-soft); color: #b3201a; }
.tag.info { background: #eef1f4; color: var(--muted); }
.f-desc { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }

/* inputs */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px 22px; }
.field label { display: block; font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.field input, .field select { width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 0; background: #fff; }
.field input:focus, .field select:focus, td input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(8, 86, 106, .15); }
.field .hint { font-size: 11px; color: var(--muted); margin-top: 4px; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 700; font-size: 14px; margin-top: 26px; }
.check input { width: 18px; height: 18px; accent-color: var(--teal); }
td input { width: 132px; text-align: right; padding: 7px 9px; border: 1.5px solid var(--line); background: #fff; font-variant-numeric: tabular-nums; }
td.cur input { background: #fbfdfd; }
.bal-ok { color: var(--teal); font-weight: 900; }
.bal-bad { color: var(--red); font-weight: 900; }
.btn { display: inline-flex; align-items: center; gap: 8px; background: var(--navy); color: #fff; border: 0; padding: 11px 18px; font-weight: 900; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; cursor: pointer; }
.btn.red { background: var(--red); }
.btn.ghost { background: transparent; color: var(--navy); border: 1.5px solid var(--navy); }
.btn:hover { filter: brightness(1.12); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* signals list */
.flags { display: grid; gap: 12px; }
.flag { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; gap: 16px; align-items: center; background: #fafafa; padding: 14px 16px 14px 0; }
.flag::before { content: ''; align-self: stretch; background: var(--orange); }
.flag.red::before { background: var(--red); }
.flag.ok::before { background: var(--teal); }
.flag b { display: block; text-transform: uppercase; font-size: 14px; font-weight: 900; }
.flag p { font-size: 13px; color: var(--muted); }
.comments { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.comment { border-left: 5px solid var(--grey); padding: 12px 16px; background: #fafafa; font-size: 14px; }
.comment.hoog { border-color: var(--orange); }
.comment.zeerhoog { border-color: var(--red); }
.comment.gem { border-color: var(--navy); }
.comment.info { border-color: var(--teal); }
.comment small { display: block; font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 3px; }

/* banners */
.banner { padding: 14px 18px; margin-bottom: 26px; font-weight: 700; display: flex; gap: 12px; align-items: center; }
.banner.bad { background: var(--red); color: #fff; }
.banner.warn { background: var(--orange-soft); color: #7a4a05; }
.banner.info { background: var(--teal-soft); color: var(--teal); }

/* valuation tree */
.tree { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 6px 0 22px; }
.node { border: 2px solid var(--grey); padding: 14px 16px; font-size: 13px; opacity: .55; }
.node b { display: block; font-size: 13px; text-transform: uppercase; font-weight: 900; margin-bottom: 4px; }
.node.on { border-color: var(--teal); background: var(--teal-soft); opacity: 1; }
.lines { display: grid; }
.line { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.line b { font-variant-numeric: tabular-nums; }
.line.total { border-bottom: 0; border-top: 2px solid var(--navy); font-size: 16px; font-weight: 900; margin-top: 4px; }
.method h3 { margin-top: 22px; margin-bottom: 8px; }
.method p, .method li { font-size: 14px; }
.method code { background: #f1f3f5; padding: 1px 6px; font-size: 13px; }
.method ol, .method ul { padding-left: 20px; }
.formula { background: var(--navy); color: #fff; padding: 12px 16px; font-family: ui-monospace, Menlo, monospace; font-size: 13px; margin: 8px 0 12px; overflow-x: auto; white-space: nowrap; }
.disclaimer { font-size: 12px; color: var(--muted); margin-top: 6px; }

.toast { position: fixed; right: 24px; bottom: 24px; background: var(--navy); color: #fff; padding: 12px 18px; font-weight: 700; transform: translateY(calc(100% + 40px)); visibility: hidden; transition: transform .25s, visibility .25s; z-index: 60; }
.toast.show { transform: none; visibility: visible; }
.scrim { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1380px) {
  .g-top { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .g-top .card-stars { grid-column: 1 / -1; }
  .stars { grid-template-columns: 1fr 1fr; }
  .gauge-wrap { grid-template-columns: minmax(200px, 260px) minmax(0, 1fr); gap: 26px; }
}
@media (max-width: 1100px) {
  .g-top, .g-mid, .g-2 { grid-template-columns: minmax(0, 1fr); }
  :root { --sidebar: 240px; }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s; width: 280px; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 35; }
  .main { margin-left: 0; }
  .brand { margin-top: 24px; }
  .nav { padding-top: 30px; }
  .topbar { height: 68px; padding: 0 16px; gap: 14px; }
  .topbar h1 { font-size: 17px; }
  .company { font-size: 14px; max-width: 30vw; }
  .content { padding: 18px 16px 40px; }
  .grid { gap: 18px; margin-bottom: 18px; }
  .card { padding: 22px 18px; }
  .card h2 { font-size: 21px; }
}
@media (max-width: 640px) {
  .donuts { grid-template-columns: 1fr 1fr; gap: 10px; }
  .donut .c small { font-size: 12px; }
  .donuts h3 { font-size: 14px; }
  .donuts p { font-size: 12px; }
  .hbar { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .hbar .lab { border: 0; padding: 0; margin: 0; }
  .gauge-wrap { grid-template-columns: minmax(0, 1fr); }
  .gauge { max-width: 280px; margin: 0 auto; }
  .totals { grid-template-columns: minmax(0, 1fr); }
  .totals .div { width: 60%; height: 2px; margin: 0 auto; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .split .div { height: 2px; width: 100%; }
  .sig-head { grid-template-columns: 76px minmax(0, 1fr); }
  .sig-icon { width: 76px; height: 76px; }
  .sig-icon svg { width: 50px; height: 50px; }
  .tree { grid-template-columns: minmax(0, 1fr); }
  .top-right .company { display: none; }
  .comments { grid-template-columns: minmax(0, 1fr); }
}

@media print {
  .sidebar, .topbar, .scrim, .toast, .no-print { display: none !important; }
  .main { margin: 0; }
  body { background: #fff; }
  .content { padding: 0; }
  .page { display: block !important; break-before: page; }
  .page:first-child { break-before: auto; }
  .card { border: 1px solid #ddd; break-inside: avoid; }
  .grid { gap: 14px; margin-bottom: 14px; }
  td input { border: 0; width: auto; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
