:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --ink: #1d2733;
  --muted: #6b7684;
  --line: #e2e6eb;
  --accent: #1e6f43;
  --accent-soft: #e6f2ea;
  --neg: #b3261e;
  --group: #eef1f5;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 15px/1.5 "Segoe UI", system-ui, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

header {
  background: linear-gradient(135deg, #123c24, #1e6f43);
  color: #fff;
  padding: 28px 5% 22px;
}
header h1 { margin: 0 0 6px; font-size: 22px; font-weight: 600; }
header .sub { margin: 2px 0; opacity: .85; font-size: 13px; }

main { margin: 0 5%; padding: 20px 0 40px; }

.cols { display: grid; grid-template-columns: 1fr 1fr; column-gap: 28px; }

section { margin-top: 30px; }
section.cards { margin-top: 10px; }
h2 { font-size: 17px; margin: 0 0 10px; }
h2 .hint { font-weight: 400; font-size: 12px; color: var(--muted); }
.note { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }
code { background: #eceff3; padding: 1px 5px; border-radius: 4px; font-size: 12px; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
}
.card .label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.card .value {
  font-size: 22px; font-weight: 650; margin-top: 4px;
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
}
.card .value .avg { font-size: 16px; font-weight: 700; color: var(--accent); white-space: nowrap; }
.card .value.neg { color: var(--neg); }
.card .extra { font-size: 12px; color: var(--muted); margin-top: 2px; }

button.card { font: inherit; text-align: left; cursor: pointer; }
button.card.cashflow { border-left: 4px solid var(--accent); }
button.card.cashflow .value { color: var(--accent); }
button.card.cashflow:hover, button.card.cashflow:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 1px 5px rgba(0, 0, 0, .1);
  outline: none;
}

.tablewrap {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow-x: auto;
}
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { padding: 7px 12px; text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
thead th {
  background: var(--group);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: #3c4654;
  border-bottom: 1px solid var(--line);
}
tbody tr + tr td { border-top: 1px solid var(--line); }
tbody tr:hover td { background: #f7f9fb; }

tr.grouphead td {
  background: var(--accent-soft);
  font-weight: 650;
  color: var(--accent);
}
tr.item td:first-child { padding-left: 28px; color: #38424e; }
tr.grouptotal td { font-weight: 650; border-top: 1px solid #ccd3db; }
tr.grandtotal td {
  font-weight: 700;
  background: #123c24;
  color: #fff;
  font-size: 14px;
}
tr.excluded td { color: #9aa3ad; text-decoration: line-through; }
tr.excluded td:first-child { text-decoration: none; }
td .excl-note { display: block; font-size: 11px; text-decoration: none; color: #b3261e; }

td.neg, span.neg { color: var(--neg); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
td.file a { font-size: 12px; }

.chartbox { padding: 14px 16px; }
.chartbox svg { width: 100%; max-width: 760px; display: block; margin: 0 auto; font-family: inherit; }

footer { margin: 0 5%; padding: 10px 0 30px; font-size: 12px; color: var(--muted); }

@media print {
  body { background: #fff; }
  header { background: none; color: #000; padding: 0 0 10px; }
  .tablewrap, .card { border: 1px solid #bbb; }
}
