/* ==========================================================================
   Ecointel LCA Studio — design tokens
   Visual language: calm mint canvas, white work surfaces, one green accent.
   ========================================================================== */

:root {
  /* ecointel: stamp brown, leaf green, warm neutrals */
  --green-900: #2b3f26;
  --green-800: #365030;
  --green-700: #3f7339;
  --green-600: #5a9a52;
  --green-500: #74ac6c;
  --green-100: #e8f0e4;
  --green-50: #f4f8f1;

  --brand: #9a6953;
  --brand-dark: #7a4f3d;
  --brand-soft: #f1e9e4;

  --page: #ededed;
  --surface: #ffffff;
  --surface-alt: #f7f6f4;

  --ink: #1a1a1a;
  --ink-2: #333333;
  --muted: #6a6a6a;
  --faint: #8a8a8a;
  --line: #dedbd6;
  --line-strong: #cfcfcf;

  --amber-bg: #fbf1e4;
  --amber-line: #ecd9c2;
  --amber-ink: #7a4f3d;
  --blue-bg: #eef2f5;
  --blue-line: #d7e0e7;
  --blue-ink: #3f5a6b;

  --danger: #b3261e;
  --danger-bg: #fdecea;
  --warn: #8a5a00;
  --ok: #3f7339;

  --radius-sm: 5px;
  --radius: 8px;
  --radius-lg: 10px;
  --shadow-sm: 0 1px 2px rgba(26, 26, 26, 0.06);
  --shadow: 0 2px 10px rgba(26, 26, 26, 0.08);
  --shadow-lg: 0 18px 50px rgba(26, 26, 26, 0.20);

  --font: "Schibsted Grotesk", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", "SF Mono", "Cascadia Mono", "Consolas", monospace;

  --header-h: 64px;
  --card-w: 900px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--green-700); text-decoration: none; }
a:hover { text-decoration: underline; }

button, input, select, textarea { font: inherit; color: inherit; }

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.01em; color: var(--ink); }

/* --------------------------------------------------------------------------
   Banners
   -------------------------------------------------------------------------- */

.banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 20px;
  font-size: 14.5px;
  border-bottom: 1px solid transparent;
  position: relative;
}
.banner__icon { flex: 0 0 auto; margin-top: 1px; opacity: .85; }
.banner__body { flex: 1 1 auto; min-width: 0; }
.banner__title { font-weight: 600; }
.banner__link {
  display: inline-block;
  margin-top: 2px;
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.banner--amber { background: var(--amber-bg); border-bottom-color: var(--amber-line); color: var(--amber-ink); }
.banner--red { background: var(--danger-bg); border-bottom-color: #f0cbc6; color: var(--danger); }
.banner .btn { margin: 4px 8px 0 0; color: inherit; }
.banner--blue { background: var(--blue-bg); border-bottom-color: var(--blue-line); color: var(--blue-ink); }
.banner__close {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: inherit;
  opacity: .55;
  cursor: pointer;
  padding: 2px;
  border-radius: 6px;
  line-height: 0;
}
.banner__close:hover { opacity: 1; background: rgba(0, 0, 0, .05); }

/* --------------------------------------------------------------------------
   Top bar
   -------------------------------------------------------------------------- */

.topbar {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 0 22px;
  position: sticky;
  top: 0;
  z-index: 40;
}

.brand { display: flex; align-items: center; gap: 12px; color: inherit; }
.brand:hover { text-decoration: none; }
.brand__mark { width: 34px; height: 38px; flex: 0 0 auto; display: block; }
.brand__mark svg, .brand__mark use { display: block; width: 34px; height: 38px; }
.brand__text { display: flex; flex-direction: column; line-height: 1.05; }
.brand__name { font-size: 20px; font-weight: 700; letter-spacing: -0.035em; color: var(--ink); }
.brand__sub { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin-top: 1px; }
.brand__ver { display: none; }

.mainnav { display: flex; align-items: center; gap: 4px; flex: 1 1 auto; min-width: 0; overflow: hidden; }
.nav-item {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  border-radius: var(--radius);
  color: var(--ink-2);
  font-size: 14.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: background .12s ease, color .12s ease;
}
.nav-item svg { width: 18px; height: 18px; opacity: .8; flex: 0 0 auto; }
.nav-item:hover { background: var(--green-50); color: var(--green-800); text-decoration: none; }
.nav-item.is-active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.nav-item.is-active svg { opacity: 1; }

.topbar__right { display: flex; align-items: center; gap: 18px; margin-left: auto; }

.userbox { display: flex; align-items: center; gap: 9px; }
.userbox__avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--green-100); color: var(--green-800);
  display: grid; place-items: center;
  font-size: 11.5px; font-weight: 700; letter-spacing: .02em;
}
.userbox__meta { display: flex; flex-direction: column; line-height: 1.15; }
.userbox__name { font-size: 13.5px; font-weight: 600; }
.userbox__org { font-size: 11px; color: var(--faint); }

.langselect {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

.page { padding: 40px 24px 80px; max-width: 1200px; margin: 0 auto; }
.card {
  width: 100%;
  max-width: var(--card-w);
  margin: 0 auto;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(219, 231, 224, .8);
  padding: 34px 38px 38px;
}
.card--wide { max-width: 1120px; }
.card--flush { padding: 0; overflow: hidden; }

.page-head { display: flex; align-items: flex-start; gap: 20px; margin-bottom: 26px; }
.page-head__text { flex: 1 1 auto; min-width: 0; }
.page-head h1 { font-size: 25px; letter-spacing: -0.02em; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 14.5px; }

.section { margin-top: 34px; }
.section:first-child { margin-top: 0; }
.section__title {
  font-size: 12px; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--faint); margin-bottom: 12px;
}

.divider { height: 1px; background: var(--line); border: 0; margin: 26px 0; }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 8px; border: 1px solid transparent;
  padding: 9px 15px; font-size: 14px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  transition: background .12s ease, border-color .12s ease, box-shadow .12s ease, transform .06s ease;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn--primary { background: var(--green-600); color: #fff; box-shadow: 0 1px 2px rgba(20, 70, 45, .25); }
.btn--primary:hover { background: var(--green-700); text-decoration: none; }
.btn--ghost { background: var(--surface); border-color: var(--line-strong); color: var(--ink-2); }
.btn--ghost:hover { background: var(--surface-alt); border-color: var(--line-strong); text-decoration: none; }
.btn--quiet { background: transparent; color: var(--muted); padding: 6px 9px; }
.btn--quiet:hover { background: var(--green-50); color: var(--green-800); }
.btn--danger { background: transparent; color: var(--danger); border-color: #f0cbc6; }
.btn--danger:hover { background: var(--danger-bg); }
.btn--sm { padding: 6px 10px; font-size: 13px; border-radius: 7px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.field__hint { font-size: 12px; color: var(--faint); }
.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 14px;
  color: var(--ink);
  transition: border-color .12s ease, box-shadow .12s ease;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--green-500);
  box-shadow: 0 0 0 3px rgba(47, 160, 106, .16);
}
.input--num { font-variant-numeric: tabular-nums; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

.segmented { display: inline-flex; background: var(--surface-alt); border: 1px solid var(--line); border-radius: 9px; padding: 3px; gap: 2px; }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span {
  display: block; padding: 6px 12px; border-radius: 6px;
  font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer;
}
.segmented input:checked + span { background: var(--surface); color: var(--green-800); box-shadow: var(--shadow-sm); }

/* --------------------------------------------------------------------------
   News (home)
   -------------------------------------------------------------------------- */

.news-item { padding: 20px 0; border-top: 1px solid var(--line); }
.news-item:first-child { border-top: 0; padding-top: 4px; }
.news-item__date { font-size: 12.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.news-item__title { font-size: 15.5px; font-weight: 650; margin: 5px 0 7px; }
.news-item__body { color: var(--ink-2); font-size: 14.8px; line-height: 1.62; }
.news-item__body p { margin: 0 0 12px; }
.news-item__body p:last-child { margin-bottom: 0; }
.news-item__foot { margin-top: 10px; font-size: 13.5px; }

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */

.table-wrap { border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.8px; }
table.data th {
  text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--faint);
  background: var(--surface-alt); padding: 10px 12px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--green-50); }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .muted { color: var(--muted); }
table.data tfoot td { background: var(--surface-alt); font-weight: 650; border-top: 1px solid var(--line-strong); }

/* --------------------------------------------------------------------------
   Stats & results
   -------------------------------------------------------------------------- */

.stat { background: var(--surface-alt); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat__label { font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); }
.stat__value { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat__unit { font-size: 12.5px; color: var(--muted); font-weight: 500; margin-left: 4px; }

.result-hero {
  display: flex; align-items: center; gap: 34px;
  padding: 26px 30px;
  background: linear-gradient(135deg, var(--green-50), #fff 70%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.result-hero__main { flex: 1 1 auto; min-width: 0; }
.result-hero__value { font-size: 44px; font-weight: 750; letter-spacing: -0.035em; line-height: 1; color: var(--green-900); font-variant-numeric: tabular-nums; }
.result-hero__unit { font-size: 14px; color: var(--muted); margin-top: 6px; }
.result-hero__sub { margin-top: 12px; font-size: 13.5px; color: var(--muted); }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; padding: 4px 11px;
  font-size: 12.5px; font-weight: 650; white-space: nowrap;
  border: 1px solid transparent;
}
.pill--ok { background: var(--green-100); color: var(--green-800); border-color: #c5e4d4; }
.pill--bad { background: var(--danger-bg); color: var(--danger); border-color: #f2cfca; }
.pill--guess { background: var(--amber-bg); color: var(--amber-ink); border: 1px dashed var(--amber-line); }
.pill--neutral { background: var(--surface-alt); color: var(--muted); border-color: var(--line); }

.gauge { flex: 0 0 auto; width: 132px; height: 132px; position: relative; }
.gauge svg { transform: rotate(-90deg); }
.gauge__label {
  position: absolute; inset: 0; display: grid; place-content: center;
  text-align: center; line-height: 1.1;
}
.gauge__value { font-size: 21px; font-weight: 750; font-variant-numeric: tabular-nums; }
.gauge__caption { font-size: 10.5px; color: var(--faint); text-transform: uppercase; letter-spacing: .07em; margin-top: 2px; }

.bars { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: grid; grid-template-columns: 150px 1fr 92px; align-items: center; gap: 12px; }
.bar-row__label { font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 7px; }
.bar-row__track { height: 16px; background: var(--surface-alt); border-radius: 4px; overflow: hidden; }
.bar-row__fill { height: 100%; border-radius: 4px; background: var(--green-600); transition: width .35s cubic-bezier(.2,.7,.3,1); }
.bar-row__value { text-align: right; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.swatch { width: 9px; height: 9px; border-radius: 2px; flex: 0 0 auto; }

/* --------------------------------------------------------------------------
   Cards / lists
   -------------------------------------------------------------------------- */

.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.project-card {
  display: block; color: inherit; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease;
}
.project-card:hover { text-decoration: none; border-color: var(--green-500); box-shadow: var(--shadow); transform: translateY(-1px); }
.project-card__top { display: flex; align-items: flex-start; gap: 10px; }
.project-card__name { font-size: 15.5px; font-weight: 650; flex: 1 1 auto; }
.project-card__meta { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.project-card__foot { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; gap: 10px; }
.project-card__kpi { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.project-card__kpi small { font-size: 11.5px; color: var(--faint); font-weight: 500; letter-spacing: 0; }

.empty {
  text-align: center; padding: 54px 24px; color: var(--muted);
  border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface-alt);
}
.empty h3 { font-size: 16px; margin-bottom: 6px; }
.empty p { margin: 0 auto 18px; max-width: 420px; font-size: 14px; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 0 0 26px; overflow-x: auto; }
.tab {
  padding: 11px 15px; font-size: 14px; font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tab:hover { color: var(--green-800); text-decoration: none; }
.tab.is-active { color: var(--green-800); border-bottom-color: var(--green-600); }

.list { display: flex; flex-direction: column; }
.list__row { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-top: 1px solid var(--line); }
.list__row:first-child { border-top: 0; }
.list__main { flex: 1 1 auto; min-width: 0; }
.list__title { font-weight: 600; font-size: 14px; }
.list__sub { font-size: 12.5px; color: var(--muted); }

/* --------------------------------------------------------------------------
   Modal
   -------------------------------------------------------------------------- */

.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(14, 30, 22, .38);
  backdrop-filter: blur(2px);
  display: grid; place-items: center;
  padding: 24px;
  animation: fade .14s ease;
}
.modal {
  width: 100%; max-width: 540px; max-height: min(86vh, 760px);
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; overflow: hidden;
  animation: pop .16s cubic-bezier(.2,.8,.3,1);
}
.modal--wide { max-width: 720px; }
.modal__head { display: flex; align-items: flex-start; gap: 14px; padding: 20px 22px 14px; border-bottom: 1px solid var(--line); }
.modal__head h2 { font-size: 17px; flex: 1 1 auto; }
.modal__body { padding: 20px 22px; overflow: auto; }
.modal__foot { padding: 14px 22px 18px; display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line); background: var(--surface-alt); }
.iconbtn { border: 0; background: transparent; cursor: pointer; color: var(--muted); padding: 4px; border-radius: 6px; line-height: 0; }
.iconbtn:hover { background: var(--surface-alt); color: var(--ink); }

@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.99); } }

/* --------------------------------------------------------------------------
   Toast
   -------------------------------------------------------------------------- */

.toast-root { position: fixed; right: 22px; bottom: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--green-900); color: #fff;
  padding: 11px 16px; border-radius: 9px; font-size: 13.5px; font-weight: 500;
  box-shadow: var(--shadow); animation: pop .18s ease;
  max-width: 340px;
}
.toast--bad { background: #7a1f18; }

/* --------------------------------------------------------------------------
   Rapport
   -------------------------------------------------------------------------- */

.report { padding: 44px 48px; }
.report__head { border-bottom: 2px solid var(--brand); padding-bottom: 18px; margin-bottom: 24px; }
.report__brand { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--brand); font-weight: 700; }
.report h1 { font-size: 28px; margin: 6px 0; }
.report__meta { font-size: 13px; color: var(--muted); }
.report__summary {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 28px;
}
.report__cell { padding: 16px 18px; border-left: 1px solid var(--line); }
.report__cell:first-child { border-left: 0; background: var(--green-50); }
.report__kpi { font-size: 38px; font-weight: 750; letter-spacing: -0.03em; line-height: 1; color: var(--green-900); font-variant-numeric: tabular-nums; }
.report__val { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.report__label { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); font-weight: 600; margin-top: 4px; }
.report__h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--green-800); margin: 30px 0 10px; }
.report__table { font-size: 13px; }
.report__text { font-size: 13px; color: var(--ink-2); line-height: 1.65; }

/* --------------------------------------------------------------------------
   Projektarbejdsflade: sidebar + indhold
   -------------------------------------------------------------------------- */

.workspace {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  background: var(--page);
  min-height: calc(100vh - var(--header-h));
}

.sidebar {
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 14px 10px 18px;
  position: sticky;
  top: var(--header-h);
  align-self: start;
  min-height: calc(100vh - 194px);
  display: flex;
  flex-direction: column;
}

.sidebar__title { padding: 4px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.sidebar__name { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.sidebar__sub { font-size: 11px; color: var(--faint); }

.side-link {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px;
  border-radius: 7px;
  border-left: 3px solid transparent;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 1px;
}
.side-link:hover { background: var(--green-50); text-decoration: none; }
.side-link.is-active { background: var(--brand-soft); border-left-color: var(--brand); color: var(--brand-dark); font-weight: 600; }
.side-link svg { width: 16px; height: 16px; opacity: .75; flex: 0 0 auto; }
.side-link.is-active svg { opacity: 1; }

.side-sub {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px 6px 34px;
  border-radius: 6px;
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 1px;
}
.side-sub:hover { background: var(--green-50); text-decoration: none; }
.side-sub.is-active { background: #f7f2ee; color: var(--brand-dark); font-weight: 600; }

.sidebar__spacer { flex: 1 1 auto; min-height: 18px; }

.threshold { border: 1px solid var(--line); border-radius: 9px; padding: 11px 12px; background: var(--surface-alt); }
.threshold__row + .threshold__row { margin-top: 10px; }
.threshold__label { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.threshold__bar { height: 9px; border-radius: 5px; background: #e3ece7; margin-top: 4px; overflow: hidden; }
.threshold__fill { height: 100%; background: var(--green-600); border-radius: 5px; }
.threshold__fill--over { background: #c98a1a; }
.threshold__status { font-size: 11px; margin-top: 6px; color: var(--green-700); font-weight: 600; }
.threshold__status--over { color: #a35c00; }

.content { padding: 20px 26px 70px; min-width: 0; }
.content__head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.content__head h1 { font-size: 21px; letter-spacing: -0.02em; }
.content__head .spacer { flex: 1 1 auto; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; padding: 3px 9px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line-strong);
  color: var(--muted); font-weight: 600;
}
.badge--soft { background: #f1eee9; border-color: transparent; }

.kpi-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; margin-bottom: 16px;
}
.kpi { padding: 13px 16px; border-left: 1px solid var(--line); min-width: 0; }
.kpi:first-child { border-left: 0; }
.kpi__label { font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); font-weight: 700; }
.kpi__value { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin-top: 3px; font-variant-numeric: tabular-nums; }
.kpi__value small { font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0; white-space: nowrap; }
.kpi__sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.kpi__tag { display: inline-block; margin-top: 4px; font-size: 11px; font-weight: 600; color: var(--green-700); }
.kpi__tag--over { color: #a35c00; }

.panel { background: #fff; border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.panel__head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.panel__head h2 { font-size: 14px; flex: 1 1 auto; }
.panel__body { padding: 16px; }
.panel--flush .panel__body { padding: 0; }
.panel--muted { background: var(--surface-alt); }

.grid-2c { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3c { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.tree { display: flex; flex-direction: column; }
.tree-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 84px 54px 62px;
  align-items: center; gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  cursor: pointer; font-size: 13px; background: #fff;
}
.tree-row:hover { background: var(--green-50); }
.tree-row.is-active { background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--brand); }
.tree-row__name { display: flex; align-items: center; gap: 7px; font-weight: 600; color: var(--ink); min-width: 0; }
.tree-row__name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-row__qty, .tree-row__share { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.tree-row__bar { height: 5px; border-radius: 3px; background: #e3ece7; overflow: hidden; }
.tree-row__bar span { display: block; height: 100%; background: var(--green-500); }

.detail-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 4px; }
.detail-head h2 { font-size: 17px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mini-stat { background: var(--surface-alt); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.mini-stat__label { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); font-weight: 700; }
.mini-stat__value { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }

.donut { position: relative; width: 190px; height: 190px; margin: 0 auto; }
.donut__center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.donut__center strong { font-size: 18px; }
.donut__legend { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; font-size: 12.5px; }
.donut__legend div { display: flex; align-items: center; gap: 8px; }
.donut__legend span:last-child { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }

.linechart { width: 100%; height: auto; display: block; }

.empty-mini { padding: 26px 16px; text-align: center; color: var(--faint); font-size: 13px; }

@media (max-width: 1100px) {
  .workspace { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .grid-2c, .grid-3c { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   LCA-rapport (skærm + print)
   -------------------------------------------------------------------------- */

.rpt {
  max-width: 820px;
  margin: 0 auto;
  padding: 44px 48px 56px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  color: #1a1a1a;
  font-size: 10.5pt;
  line-height: 1.5;
}

.rpt__cover {
  display: flex;
  flex-direction: column;
  min-height: 720px;
}
.rpt__brandrow { display: flex; align-items: center; justify-content: space-between; }
.rpt__brand { display: flex; align-items: center; gap: 10px; font-size: 15pt; font-weight: 700; letter-spacing: -0.03em; }
.rpt__brandmeta { font-size: 9pt; color: var(--faint); }
.rpt h1 { font-size: 30pt; font-weight: 700; letter-spacing: -0.035em; margin: 64px 0 4px; }
.rpt__sub { font-size: 14pt; color: var(--ink-2); margin: 0 0 34px; }
.rpt__meta { display: grid; grid-template-columns: 210px 1fr; gap: 6px 18px; margin: 0; }
.rpt__meta dt { font-weight: 600; }
.rpt__meta dd { margin: 0; }
.rpt__coverfoot { margin-top: auto; padding-top: 30px; font-size: 9pt; color: var(--faint); }

.rpt__section { padding-top: 4px; }
.rpt__run {
  display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 1px solid #e6e2dc; padding-bottom: 6px; margin-bottom: 18px;
  font-size: 8.5pt; color: var(--faint);
}
.rpt__run span:first-child { font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--brand); }

.rpt h2 { font-size: 17pt; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 14px; }
.rpt h3 { font-size: 11.5pt; font-weight: 700; margin: 18px 0 6px; }
.rpt p { margin: 0 0 10px; }
.rpt__lead { margin-bottom: 10px; }
.rpt__verdict { font-weight: 700; }
.is-ok { color: var(--green-700); font-weight: 600; }
.is-bad { color: var(--danger); font-weight: 600; }

.rpt__kv { width: 100%; border-collapse: collapse; margin: 4px 0 10px; }
.rpt__kv th { width: 230px; text-align: left; font-weight: 600; padding: 4px 0; vertical-align: top; }
.rpt__kv td { padding: 4px 0; }

.rpt__table { width: 100%; border-collapse: collapse; font-size: 9.2pt; margin: 4px 0 8px; }
.rpt__table th { background: #f3efe9; text-align: left; font-weight: 700; padding: 6px 8px; border-bottom: 1px solid #d9d4cc; }
.rpt__table td { padding: 5px 8px; border-bottom: 1px solid #e6e2dc; vertical-align: top; }
.rpt__table tfoot td { font-weight: 700; border-top: 1px solid #cfc9c0; border-bottom: 0; }
.rpt__table .num { text-align: right; font-variant-numeric: tabular-nums; }
.rpt__table--compact { font-size: 8.8pt; }
.rpt__muted { color: #7a7a7a; }
.rpt__note { font-size: 8.4pt; color: #6a6a6a; margin: 2px 0 12px; }

.rpt__figure { margin: 12px 0 8px; }
.rpt figcaption { font-size: 8.4pt; color: #6a6a6a; margin-top: 4px; }
.rpt__svg { width: 100%; height: auto; display: block; }

.rpt__toc { list-style: none; margin: 18px 0 0; padding: 0; }
.rpt__toc li { display: flex; align-items: baseline; gap: 8px; padding: 6px 0; }
.rpt__tocnum { width: 28px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rpt__toctitle { font-weight: 600; }
.rpt__toc i { flex: 1 1 auto; border-bottom: 1px dotted #b9b2a8; transform: translateY(-3px); }
.rpt__toc a { color: inherit; text-decoration: none; display: flex; gap: 8px; }
.rpt__logo { max-height: 40px; max-width: 160px; object-fit: contain; }
.rpt__guess { padding: 8px 12px; border: 1px solid var(--amber-line); background: var(--amber-bg); color: var(--amber-ink); border-radius: 6px; }
.rpt__check { list-style: none; padding: 0; margin: 8px 0 12px; }
.rpt__check li { padding: 5px 0; }
.rpt__signoff { margin-top: 22px; break-inside: avoid; }

@media print {
  @page { size: A4; margin: 16mm 15mm 14mm; }
  .rpt {
    max-width: none; margin: 0; padding: 0;
    border: 0; border-radius: 0; box-shadow: none;
    font-size: 9.6pt;
  }
  .rpt__cover { min-height: 240mm; }
  .rpt__section, .rpt__cover { break-before: page; }
  .rpt__cover { break-before: auto; }
  .rpt tr { break-inside: avoid; }
  .rpt h2, .rpt h3 { break-after: avoid; }
  .rpt__figure { break-inside: avoid; }
  .rpt__toc li { break-inside: avoid; }
  .rpt__signoff, .rpt__guess, .rpt__note { break-inside: avoid; }
  .rpt h2 + table, .rpt h3 + table, .rpt h2 + p, .rpt h3 + p { break-before: avoid; }
  .rpt thead { display: table-header-group; }
  .rpt tfoot { display: table-row-group; }
}

/* Versionsmærkning: KLADDE (ulåst) vs. låst version. Teksten kommer fra data-watermark. */
.rpt--draft::before,
.rpt--locked::before {
  content: attr(data-banner);
  display: block;
  width: fit-content;
  margin: 0 0 14px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 8pt;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.rpt--draft::before {
  color: var(--amber-ink);
  background: var(--amber-bg);
  border: 1px solid var(--amber-line);
}
.rpt--locked::before {
  color: var(--muted);
  background: var(--surface-alt);
  border: 1px solid var(--line);
}

/* Diagonalt vandmærke på hver printet side. Ligger oven på teksten (svag farve): bag ved skjules det af sidens hvide baggrund. */
@media print {
  .rpt--draft::after {
    content: attr(data-watermark);
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-35deg);
    z-index: 5;
    pointer-events: none;
    white-space: nowrap;
    font-size: 96pt;
    font-weight: 800;
    letter-spacing: .06em;
    color: rgba(0, 0, 0, .07);
  }
  .rpt--locked::after {
    content: attr(data-watermark);
    position: fixed;
    right: 15mm;
    bottom: 4mm;
    z-index: 5;
    pointer-events: none;
    font-size: 7.5pt;
    letter-spacing: .06em;
    color: #6a6a6a;
  }
  .rpt--draft::before,
  .rpt--locked::before {
    margin-bottom: 10mm;
  }
}

/* --------------------------------------------------------------------------
   Print / PDF
   -------------------------------------------------------------------------- */

@media print {
  .banner, .topbar, .no-print, .tabs, .toast-root, .modal-backdrop { display: none !important; }
  body { background: #fff; font-size: 10.5pt; }
  .page { padding: 0; max-width: none; }
  .card { max-width: none; border: 0; box-shadow: none; padding: 0; }
  .report { padding: 0; }
  .report__summary { break-inside: avoid; }
  .report__table tr { break-inside: avoid; }
  .report__h2 { break-after: avoid; }
  a { color: inherit; text-decoration: none; }
  @page { margin: 16mm 14mm; }
}

/* --------------------------------------------------------------------------
   Misc
   -------------------------------------------------------------------------- */

.notice {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 11px 14px; border-radius: 9px; font-size: 13px; line-height: 1.5;
  background: var(--amber-bg); border: 1px solid var(--amber-line); color: var(--amber-ink);
}
.notice--info { background: var(--blue-bg); border-color: var(--blue-line); color: var(--blue-ink); }
.notice svg { flex: 0 0 auto; margin-top: 1px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.chip {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; background: var(--green-50); color: var(--green-800);
  border: 1px solid var(--line);
}

.mono { font-family: var(--mono); font-size: 12.5px; }
.hint { font-size: 12.5px; color: var(--faint); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 10px; }
.row--between { justify-content: space-between; }
.spacer { flex: 1 1 auto; }

@media (max-width: 1080px) {
  .nav-item span.label { display: none; }
  .nav-item { padding: 9px 11px; }
}
@media (max-width: 860px) {
  .banner { font-size: 13.5px; }
  .card { padding: 24px 20px 28px; }
  .page { padding: 24px 14px 60px; }
  .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; }
  .result-hero { flex-direction: column; align-items: flex-start; gap: 20px; }
  .userbox__meta { display: none; }
  .bar-row { grid-template-columns: 110px 1fr 76px; }
  .page-head { flex-direction: column; }
}

.fixlist { font-size: 13px; }
.fixlist summary { cursor: pointer; font-weight: 600; margin-bottom: 6px; }
.fixlist .btn { margin-top: 6px; }

/* Genimport: tabel over ændringer i forhold til projektet */
[data-diff] td { vertical-align: top; }
[data-diff] label { display: inline-flex; gap: 6px; align-items: flex-start; }

.toast { display: flex; align-items: center; gap: 12px; }
.toast__action { background: transparent; border: 1px solid rgba(255,255,255,.6); color: #fff; border-radius: 6px; padding: 3px 10px; font: inherit; font-weight: 600; cursor: pointer; }
.toast__action:hover { background: rgba(255,255,255,.15); }

/* Smal skærm (≈400 px): ingen sidescroll på siden; tabeller ruller i deres egen beholder. */
@media (max-width: 600px) {
  html, body { overflow-x: hidden; }
  .topbar { height: auto; flex-wrap: wrap; gap: 8px 12px; padding: 8px 12px; }
  .mainnav { order: 3; flex: 1 0 100%; overflow-x: auto; }
  .topbar__right { gap: 8px; }
  .projects-layout { grid-template-columns: minmax(0, 1fr) !important; }
  .card, .card--wide { padding: 18px 14px 22px; }
  .page { padding: 18px 10px 50px; }
  .row { flex-wrap: wrap; }
  .modal-backdrop { padding: 8px; }
  .modal__head, .modal__body { padding-left: 14px; padding-right: 14px; }
  .modal__foot { padding: 12px 14px; flex-wrap: wrap; }
  .toast-root { left: 10px; right: 10px; bottom: 10px; }
  .toast { max-width: none; }
  .page-head .row { width: 100%; }
}
