:root {
  --bg: #f6f5f1; --card: #ffffff; --ink: #1d2a26; --muted: #5f6b67; --line: #dfe3df;
  --accent: #2e6b4f; --accent-ink: #ffffff; --warn: #a2481b; --error: #a12a2a; --ok: #2e6b4f;
  --c1: #2e6b4f; --c2: #7aa38b; --c3: #c58a2d; --c4: #8b8f8d; --c5: #4f6d8f; --c6: #b5654a; --c7: #a99a6b;
  --changed: #fff4d6; --yr0: #fafaf7; --yr1: #f1f1ec;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141917; --card: #1d2421; --ink: #e6ebe8; --muted: #9aa6a1; --line: #2f3a36;
    --accent: #5fae86; --accent-ink: #0f1513; --warn: #e09a6b; --error: #ec8a8a; --ok: #79c39c;
    --c1: #5fae86; --c2: #a7cdb6; --c3: #e0ad57; --c4: #7d8582; --c5: #7d9cc0; --c6: #d48b70; --c7: #c4b685;
    --changed: #3a3420; --yr0: #1b221f; --yr1: #212a26;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); }
.top { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--card); }
.brand { color: var(--ink); text-decoration: none; font-weight: 600; }
.who { color: var(--muted); font-size: 14px; }
main { max-width: 1240px; margin: 0 auto; padding: 20px 16px 60px; }
h1 { font-size: 24px; font-weight: 600; margin: 4px 0 8px; }
h2 { font-size: 17px; font-weight: 600; margin: 0 0 12px; }
h3 { font-size: 15px; font-weight: 600; margin: 18px 0 8px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 18px; margin: 16px 0; }
.narrow { max-width: 420px; margin: 60px auto; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.error { color: var(--error); } .ok { color: var(--ok); } .warn { color: var(--warn); }
label { display: block; margin: 10px 0; font-size: 14px; color: var(--muted); }
input, textarea { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; width: 100%; }
label input, label textarea { margin-top: 4px; }
input.changed { background: var(--changed); }
button, .button { font: inherit; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 6px; padding: 8px 14px; cursor: pointer; text-decoration: none; display: inline-block; }
button.secondary, .button.secondary { background: transparent; color: var(--accent); border: 1px solid var(--line); }
button.small { padding: 4px 10px; font-size: 13px; } button.danger { background: var(--error); }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.actions form { margin: 0; } .right { text-align: right; }
.crumb { margin: 0; font-size: 13px; }
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { font-weight: 600; font-size: 13px; color: var(--muted); }
table.num td:not(:first-child), table.num th:not(:first-child) { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.num td.unit, table.num th.unit { text-align: left; color: var(--muted); font-size: 13px; }
table.edit input { width: 66px; min-width: 0; padding: 5px 6px; }
table.edit th, table.edit td { padding: 5px 5px; }
table.edit th { font-size: 12px; line-height: 1.25; min-width: 58px; max-width: 96px; white-space: normal; vertical-align: bottom; }
/* Troels 22 October: nothing hidden to the right; the site name stays in view when the table scrolls */
main.wide { max-width: 1600px; }
table.edit td:nth-child(2), table.edit th:nth-child(2) { position: sticky; left: 0; background: var(--card); z-index: 1; min-width: 150px; max-width: 200px; }
table.inputs td:first-child { width: 28%; } table.inputs td:nth-child(2) { width: 140px; }
details { border-top: 1px solid var(--line); padding: 8px 0; } summary { cursor: pointer; padding: 4px 0; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.status { font-size: 12px; padding: 1px 7px; border-radius: 9px; border: 1px solid var(--line); color: var(--muted); }
.s-open, .s-proposed { color: var(--warn); border-color: var(--warn); }
/* approval status, Troels 22 October: easy to spot among many cases */
.st { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 9px; border: 1px solid; white-space: nowrap; vertical-align: middle; }
.st-approved { background: var(--ok); border-color: var(--ok); color: var(--accent-ink); }
.st-waiting { color: var(--warn); border-color: var(--warn); }
.st-not { color: var(--muted); border-color: var(--line); font-weight: 400; }
.checks { display: flex; gap: 16px; flex-wrap: wrap; } .checks label { display: flex; gap: 6px; align-items: center; margin: 4px 0; color: var(--ink); }
.checks input { width: auto; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.grid2 .card { margin: 0; }
.bar-row { display: grid; grid-template-columns: 70px 1fr; gap: 4px 12px; align-items: center; margin: 6px 0; }
.bar-label { color: var(--muted); font-size: 13px; }
.bar { height: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.bar .fill { display: block; height: 100%; background: var(--c1); }
.bar-val { grid-column: 2; font-size: 13px; color: var(--muted); }
table.list form { margin: 0; text-align: right; }
@media (max-width: 640px) { main { padding: 12px 16px 40px; } .card { padding: 14px; } }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 14px 0 4px; overflow-x: auto; }
.tabs a { padding: 8px 14px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--accent); }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0; }   /* 3 rows of 3 (Troels 27 Oct) */
@media (max-width: 760px) { .kpis { grid-template-columns: 1fr; } }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.k-label { font-size: 13px; color: var(--muted); }
.k-val { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.k-sub { font-size: 12px; color: var(--muted); }
.k-bar { height: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; margin-top: 6px; }
.k-bar span { display: block; height: 100%; background: var(--c1); }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.legend { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.sw { display: inline-block; width: 14px; height: 10px; border-radius: 2px; margin-left: 8px; }
.sw.setup { background: var(--c2); opacity: .55; } .sw.prod { background: var(--c1); } .sw.mile { background: var(--c3); border-radius: 50%; width: 10px; }
svg.timeline { width: 100%; min-width: 760px; height: auto; display: block; }
svg.timeline .yr0 { fill: var(--yr0); } svg.timeline .yr1 { fill: var(--yr1); }
svg.timeline .axis { fill: var(--muted); font-size: 11px; }
svg.timeline .lab { fill: var(--ink); font-size: 12px; }
svg.timeline .setup { fill: var(--c2); opacity: .55; } svg.timeline .prod { fill: var(--c1); } svg.timeline .mile { fill: var(--c3); }

tr.total td { border-top: 2px solid var(--line); font-weight: 600; }

.warnings ul { margin: 0; padding-left: 0; list-style: none; }
.warnings li { margin: 6px 0; font-size: 14px; }
.warnings .tag { display: inline-block; min-width: 46px; font-size: 12px; padding: 1px 7px; margin-right: 6px; border-radius: 9px; border: 1px solid currentColor; text-align: center; }
.w-short .tag, .w-cash .tag { color: var(--error); } .w-idle .tag { color: var(--warn); } .w-check .tag { color: var(--muted); }

form.inline { display: inline-block; margin: 0 4px 0 0; }
form.inline select { font-size: 13px; padding: 2px 4px; }
.actions-cell { white-space: nowrap; text-align: right; }
.folder h2 .small { font-weight: normal; margin-left: 6px; }
.small-input { font-size: 13px; padding: 2px 6px; width: 170px; }
details.add { margin: 6px 0 18px; font-size: 14px; }
details.add .add-fields { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: flex-end; padding: 8px 0; }
details.add label { margin: 0; display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
details.add input:not([type=checkbox]), details.add select { width: 150px; }
.grid-wide { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; }
@media (max-width: 800px) { .grid-wide { grid-template-columns: 1fr; } }
.kpi.highlight { border: 2px solid var(--accent); }
.map-frame { width: 100%; height: 620px; border: 1px solid var(--line); border-radius: 6px; background: #dbe8f1; }
.row-input { display: grid; grid-template-columns: 1fr 120px 90px; gap: 8px; align-items: center; margin: 6px 0 0; color: var(--ink); }
.row-input input { width: 100%; }
p.src { margin: 0 0 4px; }
svg.timeline .mo { fill: var(--ink); font-size: 9.5px; } svg.timeline .mo.on { fill: var(--accent-ink); }
table.edit input[name$="__oneoff"], table.edit input[name$="__monthly"], table.edit input[name$="__amount"],
table.edit input[name$="__salary"], table.edit input[name$="__cap"] { width: 116px; }
