/* udforske indsigt – designsystem i udforske.com-stil: Inter, #111 / mint #AEF7A4, store afrundinger. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("../fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("../fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink: #111111;
  --ink-2: #2a2a2a;
  --mint: #aef7a4;
  --mint-strong: #93ee87;
  --mint-soft: #ecfde9;
  --muted: #6e6e6e;
  --line: #d9d9d9;
  --line-soft: #eeeeee;
  --bg: #f4f4f1;
  --surface: #ffffff;
  --danger: #c93c3c;
  --danger-soft: #fdecec;
  --warning: #b97a00;
  --warning-soft: #fff4dc;
  --info: #2c6fbb;
  --info-soft: #e8f1fc;
  --success: #2f7a27;

  --r-xl: 30px;
  --r-lg: 22px;
  --r-md: 15px;
  --r-sm: 10px;
  --pill: 999px;

  --shadow: 0 1px 2px rgba(17, 17, 17, .04), 0 8px 24px rgba(17, 17, 17, .05);
  --shadow-lg: 0 20px 60px rgba(17, 17, 17, .18);
  --sidebar-w: 256px;
  --font: "Inter", Helvetica, Arial, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration-color: rgba(17, 17, 17, .3); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink); }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.15; letter-spacing: -0.02em; font-weight: 700; }
h1 { font-size: clamp(1.6rem, 2.4vw, 2.1rem); }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--line-soft); margin: 1.5rem 0; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- App-skal ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; min-height: 100dvh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; height: 100dvh;
  background: var(--ink); color: #fff;
  display: flex; flex-direction: column;
  padding: 26px 16px 18px;
  overflow-y: auto;
}
.sidebar__logo { display: flex; align-items: baseline; gap: 10px; padding: 0 12px 26px; text-decoration: none; }
.sidebar__logo img { height: 22px; width: auto; }
.sidebar__logo span { color: var(--mint); font-weight: 600; font-size: .95rem; letter-spacing: .01em; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav__label { color: #8a8a8a; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; padding: 18px 12px 6px; }
.nav__link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--pill);
  color: #e6e6e6; text-decoration: none; font-weight: 500;
  transition: background .15s, color .15s;
}
.nav__link svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav__link:hover { background: #222; color: #fff; }
.nav__link.is-active { background: var(--mint); color: var(--ink); }
.nav__link.is-active svg { opacity: 1; }
.sidebar__footer { margin-top: auto; padding-top: 18px; border-top: 1px solid #262626; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-md); color: #fff; text-decoration: none; }
.user-chip:hover { background: #1d1d1d; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--mint); color: var(--ink); font-weight: 700; font-size: .8rem;
}
.avatar--sm { width: 26px; height: 26px; font-size: .68rem; }
.user-chip__name { font-weight: 600; font-size: .9rem; line-height: 1.2; }
.user-chip__roles { color: #9a9a9a; font-size: .75rem; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 28px 36px 8px;
}
.topbar__title h1 { margin: 0; }
.topbar__title .crumbs { color: var(--muted); font-size: .85rem; margin-bottom: 4px; }
.topbar__title .crumbs a { color: var(--muted); }
.topbar__actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.content { padding: 20px 36px 48px; flex: 1; }
.content--narrow { max-width: 860px; }

.mobilebar { display: none; }
.scrim { display: none; }

@media (max-width: 900px) {
  /* Rækkerne må ikke strækkes – ellers deler headeren den tomme plads på korte sider. */
  .app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; align-content: start; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: min(86vw, 300px); z-index: 60;
    transform: translateX(-102%); transition: transform .25s ease;
    padding-top: calc(20px + env(safe-area-inset-top));
  }
  .app.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 55; opacity: 0; pointer-events: none; transition: opacity .2s; }
  .app.nav-open .scrim { opacity: 1; pointer-events: auto; }
  .mobilebar {
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 40;
    background: var(--ink); color: #fff;
    padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  }
  .mobilebar__logo { display: flex; align-items: baseline; gap: 8px; text-decoration: none; }
  .mobilebar__logo img { height: 18px; width: auto; }
  .mobilebar__logo span { color: var(--mint); font-weight: 600; font-size: .9rem; }
  .mobilebar button { background: none; border: 0; color: #fff; padding: 6px; cursor: pointer; }
  .mobilebar svg { width: 24px; height: 24px; }
  .topbar { padding: 20px 16px 4px; }
  .content { padding: 14px 16px 40px; }
}

/* ---------- Kort, grid ---------- */
.card {
  background: var(--surface); border-radius: var(--r-lg);
  padding: 24px; box-shadow: var(--shadow);
}
.card + .card { margin-top: 20px; }
.card__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card__head h2, .card__head h3 { margin: 0; }
.card--dark { background: var(--ink); color: #fff; }
.card--dark .muted { color: #a7a7a7; }
.card--mint { background: var(--mint); }
.card--flush { padding: 0; overflow: hidden; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } .card { padding: 18px; border-radius: var(--r-md); } }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.spacer { flex: 1; }

.kpi { display: flex; flex-direction: column; gap: 4px; }
.kpi__label { color: var(--muted); font-size: .82rem; font-weight: 500; }
.kpi__value { font-size: 1.7rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi__sub { font-size: .82rem; color: var(--muted); }
.card--dark .kpi__label, .card--dark .kpi__sub { color: #a7a7a7; }

/* ---------- Knapper ---------- */
.btn {
  --bg: var(--ink); --fg: #fff; --bd: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 20px;
  border-radius: var(--pill); border: 1.5px solid var(--bd);
  background: var(--bg); color: var(--fg);
  font: inherit; font-weight: 600; font-size: .93rem; text-decoration: none; white-space: nowrap;
  cursor: pointer; transition: transform .08s, background .15s, border-color .15s, opacity .15s;
}
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn svg { width: 17px; height: 17px; }
.btn--primary { --bg: var(--mint); --fg: var(--ink); --bd: var(--mint); }
.btn--primary:hover { --bg: var(--mint-strong); --bd: var(--mint-strong); filter: none; }
.btn--ghost { --bg: transparent; --fg: var(--ink); --bd: var(--line); }
.btn--ghost:hover { --bd: var(--ink); filter: none; }
.btn--danger { --bg: var(--danger); --bd: var(--danger); }
.btn--link { --bg: transparent; --bd: transparent; --fg: var(--ink); padding: 0 6px; text-decoration: underline; }
.btn--sm { min-height: 34px; padding: 0 14px; font-size: .85rem; }
.btn--block { width: 100%; }
.btn--icon { width: 38px; min-height: 38px; padding: 0; }
.card--dark .btn--ghost { --fg: #fff; --bd: #444; }

/* ---------- Formularer ---------- */
.form { display: grid; gap: 18px; }
.form-row { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.field { display: grid; gap: 6px; align-content: start; }
fieldset.field { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.field > .check + .check { margin-top: 10px; }
.field > label, .label { font-weight: 600; font-size: .88rem; }
.hint { color: var(--muted); font-size: .82rem; }
.field-error { color: var(--danger); font-size: .84rem; font-weight: 500; }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 10px 14px;
  border: 1.5px solid var(--line); border-radius: var(--r-sm);
  background: #fff; color: var(--ink); font: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 110px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px rgba(174, 247, 164, .55); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.input--code { font-size: 1.6rem; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }
.input--num { text-align: right; font-variant-numeric: tabular-nums; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; padding-right: 40px; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-weight: 500; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--ink); flex: none; }
.checks { display: flex; gap: 10px 22px; flex-wrap: wrap; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
:focus-visible { outline: 3px solid var(--mint-strong); outline-offset: 2px; }

/* Segmenteret kontrol (fx Ja/Nej) */
.segmented { display: inline-flex; background: var(--line-soft); border-radius: var(--pill); padding: 4px; gap: 2px; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label { padding: 7px 16px; border-radius: var(--pill); cursor: pointer; font-weight: 600; font-size: .88rem; color: var(--muted); }
.segmented input:checked + label { background: var(--ink); color: #fff; }
.segmented input:focus-visible + label { outline: 3px solid var(--mint-strong); }

/* ---------- Tabeller ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th {
  text-align: left; font-weight: 600; font-size: .78rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: .05em;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafaf8; }
.table .num, .table th.num { text-align: right; }
.table tfoot td { font-weight: 700; border-top: 2px solid var(--ink); border-bottom: 0; }
.table--compact td, .table--compact th { padding: 8px 12px; }
.table a.row-link { font-weight: 600; text-decoration: none; }
.table a.row-link:hover { text-decoration: underline; }

/* ---------- Badges, beskeder ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 11px; border-radius: var(--pill);
  font-size: .78rem; font-weight: 600; line-height: 1.6;
  background: var(--line-soft); color: var(--ink); white-space: nowrap;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .55; }
.badge--plain::before { display: none; }
.badge--mint { background: var(--mint); }
.badge--dark { background: var(--ink); color: #fff; }
.badge--info { background: var(--info-soft); color: var(--info); }
.badge--warning { background: var(--warning-soft); color: var(--warning); }
.badge--danger { background: var(--danger-soft); color: var(--danger); }
.badge--success { background: var(--mint-soft); color: var(--success); }

.alert { padding: 14px 18px; border-radius: var(--r-md); background: var(--info-soft); color: #18406d; font-weight: 500; }
.alert--success { background: var(--mint-soft); color: #1e5418; }
.alert--error { background: var(--danger-soft); color: #7d1f1f; }
.alert--warning { background: var(--warning-soft); color: #6b4700; }
.alert + .alert { margin-top: 10px; }
.flash-stack { margin-bottom: 18px; }

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: grid; gap: 10px; max-width: min(380px, calc(100vw - 40px)); }
.toast { background: var(--ink); color: #fff; padding: 14px 18px; border-radius: var(--r-md); box-shadow: var(--shadow-lg); font-weight: 500; animation: toast-in .2s ease-out; }
.toast--error { background: var(--danger); }
.toast--success { border-left: 6px solid var(--mint); }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } }

/* ---------- Dialog ---------- */
dialog.modal {
  border: 0; padding: 0; border-radius: var(--r-lg);
  width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 48px);
  box-shadow: var(--shadow-lg); color: var(--ink);
}
dialog.modal--wide { width: min(880px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: rgba(17, 17, 17, .5); backdrop-filter: blur(2px); }
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 0; gap: 10px; }
.modal__head h2 { margin: 0; }
.modal__body { padding: 18px 24px; overflow-y: auto; }
.modal__foot { padding: 0 24px 22px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* ---------- Faneblade ---------- */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 10px 14px; text-decoration: none; font-weight: 600; color: var(--muted); border-bottom: 2.5px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.is-active { color: var(--ink); border-bottom-color: var(--ink); }

/* ---------- Diverse ---------- */
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty h3 { color: var(--ink); }
.dl { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 10px 24px; margin: 0; }
.dl dt { color: var(--muted); font-weight: 500; }
.dl dd { margin: 0; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.divider-label { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; margin: 26px 0 12px; }
.divider-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 18px; background: var(--line-soft); border-radius: var(--r-md); font-family: ui-monospace, Menlo, monospace; font-size: 1.05rem; text-align: center; }
.qr { background: #fff; padding: 14px; border-radius: var(--r-md); border: 1px solid var(--line); width: max-content; }
.qr svg, .qr img { width: 200px; height: 200px; }
.secret { font-family: ui-monospace, Menlo, monospace; letter-spacing: .12em; word-break: break-all; background: var(--line-soft); padding: 8px 12px; border-radius: var(--r-sm); }

/* Inaktivitets-advarsel */
.idle-warning { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 120; background: var(--ink); color: #fff; padding: 14px 16px 14px 22px; border-radius: var(--pill); display: flex; gap: 16px; align-items: center; box-shadow: var(--shadow-lg); width: max-content; max-width: calc(100vw - 24px); }
.idle-warning strong { color: var(--mint); font-variant-numeric: tabular-nums; }

/* ---------- Login-sider ---------- */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--ink); }
.auth__brand { color: #fff; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth__brand img { height: 30px; width: auto; align-self: flex-start; position: relative; z-index: 1; }
.auth__brand h2 { font-size: clamp(2rem, 3.6vw, 3.2rem); line-height: 1.05; max-width: 12ch; letter-spacing: -0.035em; }
.auth__brand h2 em { font-style: normal; color: var(--mint); }
.auth__brand p { color: #a7a7a7; max-width: 38ch; }
.auth__blob { position: absolute; right: -120px; bottom: -140px; width: 420px; height: 420px; border-radius: 50%; background: var(--mint); opacity: .9; }
.auth__blob::after { content: ""; position: absolute; inset: 120px; border-radius: var(--pill); background: var(--ink); }
.auth__panel { background: var(--bg); display: grid; place-items: center; padding: 40px 24px; border-radius: var(--r-xl) 0 0 var(--r-xl); }
.auth__box { width: min(420px, 100%); }
.auth__box h1 { font-size: 1.8rem; }
.auth__box .lead { color: var(--muted); margin-bottom: 26px; }
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth__brand { padding: calc(28px + env(safe-area-inset-top)) 24px 26px; }
  .auth__brand h2, .auth__brand p, .auth__blob { display: none; }
  .auth__panel { border-radius: var(--r-xl) var(--r-xl) 0 0; align-items: start; padding-top: 36px; }
}

/* ---------- Fejlside ---------- */
.error-page { min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 24px; }
.error-page .code { font-size: 5rem; font-weight: 800; letter-spacing: -0.05em; line-height: 1; }
.error-page .code span { color: var(--mint-strong); }

/* ---------- Print ---------- */
@media print {
  .sidebar, .mobilebar, .topbar__actions, .no-print, .toasts, .idle-warning { display: none !important; }
  .app { display: block; }
  body { background: #fff; }
  .content, .topbar { padding: 0; }
  .card { box-shadow: none; padding: 0; }
}
.nav__link--button { width: 100%; background: none; border: 0; cursor: pointer; font: inherit; text-align: left; }

/* Afstands-hjælpere (CSP tillader ikke style-attributter). */
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 36px; }
.mb-0 { margin-bottom: 0 !important; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.my-3 { margin-top: 24px; margin-bottom: 24px; }
.w-full { width: 100%; }
.text-right { text-align: right; }
.w-auto { width: auto; }
.offline-logo { height: 28px; width: auto; margin: 0 auto 24px; filter: invert(1); }
.w-search { width: min(360px, 100%); }
.pre-line { white-space: pre-line; }
.grid-span-2 { grid-column: span 2; }
@media (max-width: 1100px) { .grid-span-2 { grid-column: auto; } }

/* ---------- Tilbud ---------- */
.text-danger { color: var(--danger); }
.summary__total { display: flex; flex-direction: column; gap: 2px; padding: 18px 20px; background: var(--ink); color: #fff; border-radius: var(--r-md); margin-bottom: 14px; }
.summary__total .kpi__label, .summary__total .kpi__sub { color: #b5b5b5; }
.summary__amount { font-size: 2.1rem; font-weight: 800; letter-spacing: -0.03em; color: var(--mint); font-variant-numeric: tabular-nums; line-height: 1.15; }
.summary__lines { margin-bottom: 12px; }
.summary__internal { margin-top: 18px; padding: 16px; border-radius: var(--r-md); background: var(--mint-soft); border: 1px dashed var(--mint-strong); }
.summary__internal .table td { border-bottom-color: rgba(17, 17, 17, .06); }
.offer-layout { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 20px; align-items: start; }
.offer-layout__aside { position: sticky; top: 20px; }
@media (max-width: 1200px) { .offer-layout { grid-template-columns: 1fr; } .offer-layout__aside { position: static; } }
.summary.is-loading { opacity: .55; transition: opacity .15s; }

.stages { width: 100%; border-collapse: separate; border-spacing: 0 8px; }
.stages th { text-align: left; font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; padding: 0 8px; }
.stages td { padding: 0 6px; vertical-align: middle; }
.stages td:first-child { font-weight: 700; width: 64px; padding-left: 12px; }
.stages tr td { background: var(--bg); }
.stages tr td:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); }
.stages tr td:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; width: 52px; }
.stages .input { min-height: 40px; padding: 8px 10px; }
.stages .stage-num { width: 110px; }
.stages .check { justify-content: center; }
.stages tr.is-warning td { background: var(--danger-soft); }
.toggle-list { display: grid; gap: 10px; align-content: start; }
.toggle-list > .segmented { justify-self: start; }
@media (max-width: 760px) {
  .stages thead { display: none; }
  .stages, .stages tbody, .stages tr, .stages td { display: block; width: 100% !important; }
  .stages tr { background: var(--bg); border-radius: var(--r-md); padding: 10px 12px; margin-bottom: 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .stages tr td { background: none; padding: 0; border-radius: 0 !important; }
  .stages td[data-label]::before { content: attr(data-label); display: block; font-size: .75rem; color: var(--muted); font-weight: 600; }
  .stages td:first-child { grid-column: 1 / -1; }
}

/* Tilbudsvisning */
.offer-head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.status-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: .9rem; }
.timeline li:last-child { border-bottom: 0; }
.timeline time { color: var(--muted); white-space: nowrap; font-size: .82rem; min-width: 110px; }
.flex-1 { flex: 1; min-width: 0; }
.cfg-input { width: 120px; display: inline-block; min-height: 38px; padding: 6px 10px; }
.unit { display: inline-block; min-width: 46px; text-align: left; }
form.inline { display: inline; }

/* ---------- Kanban ---------- */
.board-wrap { padding: 12px 36px 24px; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.board { display: flex; gap: 16px; align-items: flex-start; overflow-x: auto; padding-bottom: 16px; flex: 1; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.klist { flex: 0 0 300px; background: #e8e8e3; border-radius: var(--r-lg); padding: 12px; display: flex; flex-direction: column; max-height: calc(100dvh - 170px); scroll-snap-align: start; }
.klist--done { background: #e3efe0; }
.klist--new { background: transparent; border: 2px dashed var(--line); }
.klist__head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 10px; }
.klist__head h2 { font-size: .95rem; margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.klist__count { font-size: .78rem; font-weight: 700; background: rgba(17, 17, 17, .08); border-radius: var(--pill); padding: 1px 9px; }
.klist__done svg { width: 16px; height: 16px; color: var(--success); }
.klist__handle { cursor: grab; color: var(--muted); display: inline-flex; }
.klist__handle svg { width: 16px; height: 16px; }
.klist__menu { width: 30px; min-height: 30px; border: 0; background: transparent; }
.klist__cards { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; min-height: 56px; padding: 2px; margin: 0 -2px; }
.klist__add { margin-top: 10px; }
.klist__add .input, .klist--new .input { background: transparent; border-color: transparent; min-height: 40px; }
.klist__add .input:focus, .klist--new .input:focus { background: #fff; border-color: var(--ink); }
.kcard {
  display: flex; flex-direction: column; gap: 4px; background: var(--surface); border-radius: var(--r-md);
  padding: 12px 14px; text-decoration: none; color: var(--ink); box-shadow: 0 1px 2px rgba(17, 17, 17, .08);
  border: 1.5px solid transparent; cursor: grab; transition: border-color .15s, box-shadow .15s;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.kcard:hover { border-color: var(--line); box-shadow: var(--shadow); }
.kcard__title { font-weight: 600; line-height: 1.3; }
.kcard__sub { font-size: .82rem; color: var(--muted); }
.kcard__meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.kcard__meta:empty { display: none; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: var(--pill); background: var(--line-soft); color: var(--ink-2); }
.chip svg { width: 13px; height: 13px; }
.chip--danger { background: var(--danger-soft); color: var(--danger); }
.chip--warning { background: var(--warning-soft); color: var(--warning); }
.chip--done { background: var(--mint); }
.kcard.sortable-ghost { opacity: .35; border: 2px dashed var(--ink); box-shadow: none; }
.kcard.sortable-chosen { box-shadow: var(--shadow-lg); transform: rotate(1.5deg); }
.klist.sortable-ghost { opacity: .4; }
body.is-board .main { height: 100dvh; }
@media (max-width: 900px) {
  .board-wrap { padding: 8px 0 16px; }
  .board { padding: 0 16px 16px; scroll-padding: 16px; }
  .klist { flex-basis: 84vw; max-height: calc(100dvh - 190px); }
  body.is-board .main { height: auto; }
}
.tasks { list-style: none; margin: 0; padding: 0; }
.task { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.task.is-done span { text-decoration: line-through; color: var(--muted); }
.task__del { opacity: 0; width: 32px; min-height: 32px; border: 0; }
.task:hover .task__del, .task__del:focus { opacity: 1; }
@media (hover: none) { .task__del { opacity: .6; } }
.comments { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.comments li { display: flex; gap: 12px; }

/* Visningsskift (Board/Liste) */
.segmented--links { align-items: center; }
.segmented--links a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: var(--pill); font-weight: 600; font-size: .88rem; color: var(--muted); text-decoration: none; }
.segmented--links a svg { width: 15px; height: 15px; }
.segmented--links a.is-active { background: var(--ink); color: #fff; }

/* Tilbudsboard */
.klist--vundet { background: #e3efe0; }
.klist--tabt { background: #f1e6e6; }
.klist__sum { white-space: nowrap; font-variant-numeric: tabular-nums; }
.kcard__amount { font-size: .9rem; font-variant-numeric: tabular-nums; }
.klist.is-blocked { opacity: .45; }
.klist.is-target { outline: 2px dashed var(--ink); outline-offset: -2px; }
#offer-board .klist__add { align-self: flex-start; margin-top: 10px; }
/* Fire faste statuskolonner deler bredden på desktop; på mobil scrolles der vandret som på de andre boards. */
#offer-board .klist { flex: 1 1 0; min-width: 240px; }
@media (max-width: 900px) { #offer-board .klist { flex: 0 0 84vw; } }
@media (max-width: 900px) {
  .board-wrap > form, .board-wrap > .flash-stack { margin-left: 16px; margin-right: 16px; }
  .board-wrap > form { flex-wrap: nowrap; }
  .board-wrap > form .w-search { flex: 1; min-width: 0; }
}
.alloc-row { display: grid; grid-template-columns: 1fr 160px 40px; gap: 8px; align-items: center; }
@media (max-width: 600px) { .alloc-row { grid-template-columns: 1fr 110px 40px; } }

/* ---------- Rapporter ---------- */
.chart { position: relative; height: 280px; }
.card__head.pad { padding: 20px 24px 0; }
.delta { font-weight: 700; }
.delta--up { color: var(--success); }
.delta--down { color: var(--danger); }
.neg { color: var(--danger); }
.pnl th[scope="row"] { font-weight: 500; text-transform: none; letter-spacing: 0; font-size: .9rem; color: var(--ink); white-space: nowrap; position: sticky; left: 0; background: var(--surface); }
.pnl td, .pnl th { font-size: .85rem; }
.pnl__total th[scope="row"], .pnl__total td { font-weight: 700; border-top: 1px solid var(--line); }
.pnl__result th[scope="row"], .pnl__result td { border-top: 2px solid var(--ink); background: var(--mint-soft); }
.pnl__result th[scope="row"] { background: var(--mint-soft); }
.th-group { text-align: center !important; border-bottom: 1px solid var(--line-soft); }
.meter { display: inline-block; width: 60px; height: 6px; border-radius: 3px; background: var(--line-soft); vertical-align: middle; overflow: hidden; }
.meter__fill { display: block; height: 100%; width: 0; background: var(--ink); border-radius: 3px; }
.grid > .card + .card { margin-top: 0; }

/* Overblik */
.card-link { text-decoration: none; color: inherit; transition: box-shadow .15s, transform .15s; }
.card-link:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.dash-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.dash-list li:last-child { border-bottom: 0; }
.dash-list li > a { flex: 1 1 100%; text-decoration: none; }
.dash-list li > a:hover { text-decoration: underline; }
.nudge { display: flex; gap: 16px; align-items: flex-start; }
.nudge__icon { flex: none; width: 48px; height: 48px; border-radius: 50%; background: var(--mint); display: grid; place-items: center; }
.nudge__icon svg { width: 24px; height: 24px; }
.pnl__open th[scope="row"], .pnl__open td { background: var(--warning-soft); }
/* Administration → Tekster */
.texts td { vertical-align: top; width: 45%; }
.texts td:last-child { width: auto; }
.texts__std { display: block; margin-bottom: 6px; overflow-wrap: anywhere; }
.texts__input { min-height: 38px; padding: 7px 10px; }

/* Sprogskift (DA/EN) i sidebarens bund og øverst til højre på login-siderne. */
.sidebar__actions { display: flex; align-items: center; gap: 8px; }
.sidebar__actions > form:first-child { flex: 1; min-width: 0; }
.lang-switch { display: inline-flex; flex: none; gap: 2px; padding: 3px; border-radius: var(--pill); background: var(--line-soft); }
.lang-switch__btn { border: 0; background: none; cursor: pointer; font: inherit; font-size: .72rem; font-weight: 700; letter-spacing: .04em; padding: 4px 9px; border-radius: var(--pill); color: var(--muted); }
.lang-switch__btn:hover { color: var(--ink); }
.lang-switch__btn.is-active { background: var(--ink); color: #fff; }
.lang-switch__btn:focus-visible { outline: 3px solid var(--mint-strong); outline-offset: 1px; }
.lang-switch--dark { background: #1d1d1d; }
.lang-switch--dark .lang-switch__btn { color: #9a9a9a; }
.lang-switch--dark .lang-switch__btn:hover { color: #fff; }
.lang-switch--dark .lang-switch__btn.is-active { background: var(--mint); color: var(--ink); }
.auth__panel { position: relative; }
.auth__lang { position: absolute; top: 18px; right: 18px; }
@media (max-width: 860px) { .auth__panel { padding-top: 64px; } .auth__lang { top: 16px; right: 16px; } }
/* Betaling til LETdata: skjult indtil Ctrl+Shift+L / tre tryk på "Internt" */
.letdata-secret { display: none; }
html.show-letdata .letdata-secret { display: block; }
[data-letdata-toggle] { -webkit-user-select: none; user-select: none; }
/* Tillæg og rabatter i tilbudseditoren */
/* To linjer: type + beskrivelse, derefter visning, kr./%, værdi og beløb */
.adj-row {
  display: grid; gap: 8px; align-items: center; background: var(--bg); padding: 10px; border-radius: var(--r-md);
  grid-template-columns: 170px 76px 120px minmax(0, 1fr) auto 40px;
  grid-template-areas: "type desc desc desc desc del" "show mode value . amount .";
}
.adj-row .input, .adj-row .select { min-height: 40px; padding-top: 7px; padding-bottom: 7px; }
.adj-row__type { grid-area: type; } .adj-row__desc { grid-area: desc; } .adj-row__del { grid-area: del; }
.adj-row__display { grid-area: show; } .adj-row__mode { grid-area: mode; } .adj-row__value { grid-area: value; }
.adj-row__amount { grid-area: amount; font-weight: 600; font-size: .9rem; text-align: right; white-space: nowrap; }
.adj-row__mode[hidden] { display: block !important; visibility: hidden; }
@media (max-width: 760px) {
  .adj-row { grid-template-columns: 1fr 1fr 40px; grid-template-areas: "desc desc desc" "type mode mode" "value value value" "show show show" "amount amount del"; }
  .adj-row__mode[hidden] { display: none !important; }
  .adj-row:has(.adj-row__mode[hidden]) { grid-template-areas: "desc desc desc" "type type type" "value value value" "show show show" "amount amount del"; }
}
.adj-line td { color: var(--ink-2); font-style: italic; }
.adj-line--included td:first-child { padding-left: 18px; font-size: .85rem; }
.adj-line--included td { font-size: .85rem; }
/* Timebudget: smalle talfelter side om side */
.hours-grid { display: flex; flex-wrap: wrap; gap: 12px 32px; }
.hours-grid .field { flex: 0 0 auto; margin: 0; }
.hours-grid__input { width: 120px; }
.hours-input { width: 90px; min-height: 34px; padding: 5px 8px; display: inline-block; }
.cost-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 140px 40px; gap: 8px; align-items: center; }
.cost-row .input, .cost-row .select { min-height: 40px; padding-top: 7px; padding-bottom: 7px; }
@media (max-width: 760px) { .cost-row { grid-template-columns: 1fr 1fr; background: var(--bg); padding: 10px; border-radius: var(--r-md); } .cost-row [data-field="description"] { grid-column: 1 / -1; order: -1; } }
.link-inline { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
