/* Driftsbasen · systemets design */
:root {
  --ground: #F3F5F4;
  --surface: #FFFFFF;
  --ink: #13211D;
  --muted: #4A5A55;
  --line: #D9E0DD;
  --line-soft: #EEF2F0;
  --field: #C3CDC9;
  --accent: #0E6655;
  --accent-dark: #0A4A3E;
  --accent-soft: #E3F0EC;
  --side: #13211D;
  --side-ink: #C2CFCB;
  --side-active: #1F3530;
  --warn-bg: #FBEFD9; --warn-ink: #8A4D00;
  --ok-bg: #E1F1E6; --ok-ink: #1E5A33;
  --bad-bg: #FBE4E2; --bad-ink: #9A2019;
  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --sans: 'IBM Plex Sans', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--sans); font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--ground); }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
h1, h2 { margin: 0; }
h1 { font-family: var(--display); font-size: 34px; letter-spacing: -0.02em; line-height: 1.1; }
h2 { font-size: 18px; margin-bottom: 10px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 13px; }
.right { text-align: right; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--accent); }

/* Knapper og felter */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 0 18px; border-radius: 8px; border: 1px solid transparent; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn-primary { background: var(--accent); color: #FFFFFF; }
.btn-primary:hover { background: var(--accent-dark); color: #FFFFFF; }
.btn-outline { background: var(--surface); color: var(--ink); border-color: var(--field); }
.btn-outline:hover { border-color: var(--ink); color: var(--ink); }
.btn-wide { width: 100%; min-height: 48px; }
.btn-small { min-height: 38px; padding: 0 14px; font-size: 14px; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: #8FD3C2; cursor: pointer; text-decoration: underline; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field > span { font-size: 13px; font-weight: 500; }
.field small { color: var(--muted); font-size: 12px; }
.field input { min-height: 44px; padding: 0 12px; border: 1px solid var(--field); border-radius: 8px; font: inherit; background: var(--surface); color: var(--ink); }
.field input:focus, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.code-input { font-family: var(--mono) !important; font-size: 22px !important; letter-spacing: 0.3em; text-align: center; min-height: 52px !important; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.center-link { text-align: center; font-weight: 600; }

.flash { border-radius: 10px; padding: 12px 16px; border: 1px solid; }
.flash-ok { background: var(--ok-bg); color: #154A2A; border-color: #A9D3B8; }
.flash-fejl { background: var(--bad-bg); color: #7A1913; border-color: #EDB7B2; }

/* Login-sider */
.auth-body { background: var(--side); }
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; padding: 48px 16px; }
.auth-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.auth-logo span { font-family: var(--display); font-weight: 700; font-size: 24px; color: #FFFFFF; }
.auth-card { width: 100%; max-width: 440px; background: var(--surface); border-radius: 16px; padding: 32px; }
.auth-title { font-size: 28px; letter-spacing: -0.01em; margin-bottom: 4px; }
.auth-foot { font-size: 13px; color: #8FA19B; }
.qr { align-self: center; width: 200px; height: 200px; padding: 10px; background: #FFFFFF; border: 1px solid var(--line); border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.qr svg, .qr img { width: 100%; height: 100%; }
.secret { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.secret code { font-family: var(--mono); font-size: 15px; background: var(--ground); border-radius: 8px; padding: 8px 10px; word-break: break-all; }

/* Systemets ramme */
.shell { display: flex; flex-wrap: wrap; min-height: 100vh; }
.side { flex: 1 1 232px; max-width: 100%; background: var(--side); color: var(--side-ink); padding: 20px 16px; display: flex; flex-direction: column; gap: 24px; }
.side-logo { display: flex; align-items: center; gap: 10px; padding: 0 8px; text-decoration: none; }
.side-logo span { font-family: var(--display); font-weight: 700; font-size: 19px; color: #FFFFFF; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a, .side-nav span { display: flex; align-items: center; justify-content: space-between; min-height: 40px; padding: 0 12px; border-radius: 8px; color: var(--side-ink); text-decoration: none; }
.side-nav a:hover { background: var(--side-active); color: #FFFFFF; }
.side-nav a.is-active { background: var(--side-active); color: #FFFFFF; font-weight: 600; }
.side-nav .is-disabled { color: #7F918B; cursor: default; }
.side-nav small { font-size: 11px; border: 1px solid #3A524B; border-radius: 999px; padding: 0 7px; }
.side-foot { margin-top: auto; border-top: 1px solid #2E4741; padding: 16px 8px 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.side-user { color: #FFFFFF; font-weight: 500; }
.main { flex: 999 1 640px; min-width: 0; padding: 32px; display: flex; flex-direction: column; gap: 20px; }
@media (max-width: 700px) { .main { padding: 20px 16px; } h1 { font-size: 28px; } }

.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.card-head h2 { margin: 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.kpi { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; }
.kpi-label { font-size: 13px; color: var(--muted); }
.kpi-value { font-family: var(--display); font-size: 26px; font-weight: 700; }
.kpi-note { font-size: 12px; color: var(--muted); }
.kpi-note.warn { color: var(--warn-ink); font-weight: 600; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 20px; align-items: start; }
@media (max-width: 420px) { .grid-2 { grid-template-columns: 1fr; } }

.steps { margin: 6px 0 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.steps li.done { color: var(--ok-ink); font-weight: 600; }
.steps li.done::marker { content: '✓  '; }
.events { list-style: none; margin: 0; padding: 0; }
.events li { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.events li:last-child { border-bottom: 0; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.copy-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; background: var(--ground); border-radius: 10px; padding: 12px 14px; margin: 10px 0; }
.copy-row .muted { flex: 1 0 100%; font-size: 13px; }
.copy-row code { flex: 1 1 260px; font-family: var(--mono); font-size: 13px; word-break: break-all; }
.sub-head { font-size: 15px; margin: 22px 0 10px; padding-top: 18px; border-top: 1px solid var(--line-soft); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; align-items: end; margin-top: 6px; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; }
.small-note { font-size: 13px; text-align: center; margin: 0; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.badge-ok { background: var(--ok-bg); color: var(--ok-ink); }
.badge-warn { background: var(--warn-bg); color: var(--warn-ink); }
.table-wrap { overflow-x: auto; position: relative; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 13px; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px 8px; border-bottom: 1px solid var(--line-soft); }

/* Etape 2: kunder */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.toolbar-search { flex: 1 1 280px; }
.field select, .field textarea, .input-small { min-height: 44px; padding: 0 12px; border: 1px solid var(--field); border-radius: 8px; font: inherit; background: var(--surface); color: var(--ink); }
.field textarea { padding: 10px 12px; resize: vertical; }
.input-small { min-height: 36px; width: 100px; }
.field-wide { grid-column: span 2; }
.field-narrow { max-width: 420px; }
@media (max-width: 600px) { .field-wide { grid-column: auto; } }
.field-error { color: var(--bad-ink) !important; font-weight: 600; }
.input-with-button { display: flex; gap: 8px; }
.input-with-button input { flex: 1; min-width: 0; }
.cvr-status { min-height: 1em; }
.cvr-status.ok { color: var(--ok-ink) !important; }
.cvr-status.fejl { color: var(--bad-ink) !important; }
.form-card { display: flex; flex-direction: column; gap: 14px; }
.form-card h2 { margin: 8px 0 0; font-size: 16px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; }
.check input { width: 18px; height: 18px; }
.crumbs { font-size: 14px; color: var(--muted); }
.title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.table-card { padding: 6px 12px; }
.row-title { font-weight: 600; color: var(--ink); text-decoration: none; }
.row-title:hover { color: var(--accent); text-decoration: underline; }
.empty { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 40px 22px; }
.badge-muted { background: var(--line-soft); color: #33403C; }
.item-list { list-style: none; margin: 0 0 8px; padding: 0; }
.item-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.item-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.item-main .badge { align-self: flex-start; }
.small { font-size: 13px; }
.notes { white-space: normal; font-size: 14px; }
.add-box { margin-top: 10px; border: 1px dashed var(--field); border-radius: 10px; padding: 12px 14px; }
.add-box summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.add-box[open] summary { margin-bottom: 12px; }
.btn-danger { background: var(--surface); color: var(--bad-ink); border-color: #E3A6A1; }
.btn-danger:hover { background: var(--bad-bg); color: var(--bad-ink); }
.danger-zone { display: flex; justify-content: flex-end; }
.kpi-link { text-decoration: none; color: inherit; }
.kpi-link:hover { border-color: var(--accent); }
.form-card .form-grid { align-items: start; }
.item-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }

/* Etape 3 · udstyr */
[hidden] { display: none !important; }
.badge-info { background: var(--accent-soft); color: var(--accent-dark); }
.badge-bad { background: var(--bad-bg); color: var(--bad-ink); }
.badge-soft { background: var(--ground); color: var(--muted); font-weight: 500; }
.text-bad { color: var(--bad-ink); font-weight: 600; }
.text-warn { color: var(--warn-ink); font-weight: 600; }
.big-mono { font-size: 16px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 20px; align-items: start; }
@media (max-width: 960px) { .grid-main { grid-template-columns: minmax(0, 1fr); } }
.fact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px 20px; margin: 0; }
.fact-grid dt { font-size: 12px; color: var(--muted); }
.fact-grid dd { margin: 2px 0 0; word-break: break-word; }
.timeline { list-style: none; margin: 14px 0 0; padding: 0; }
.timeline li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.timeline li:last-child { border-bottom: 0; }
.timeline-text { flex: 1 1 220px; }
.mono-input { font-family: var(--mono) !important; font-size: 14px !important; }
.file-input { min-height: 0 !important; padding: 10px 12px !important; }
.label-card { display: flex; align-items: center; gap: 18px; }
.qr.qr-small { width: 120px; height: 120px; padding: 8px; flex: none; }
.stack-tight { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.link-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.placement { font-weight: 600; }
.input-name { width: 100%; min-width: 160px; }
.input-num { width: 90px; }
.table th.right { text-align: right; }

/* Etape 4 · kontrakter */
.notice { border-radius: 10px; padding: 12px 16px; background: var(--accent-soft); color: var(--accent-dark); border: 1px solid #BFDCD3; }
.notice-warn { background: var(--warn-bg); color: var(--warn-ink); border-color: #EBCB94; }
.add-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 12px; margin-top: 14px; align-items: start; }
.inline-form { display: inline; }
.nowrap { white-space: nowrap; }
.input-price { width: 110px; }
.input-small.right { text-align: right; }
.lines-table td { vertical-align: top; }
.lines-table tfoot td { border-bottom: 0; padding-top: 14px; }
.lines-table .input-name { min-width: 240px; }
.static-value { min-height: 44px; display: flex; align-items: center; }
#status .danger-zone { margin-top: 14px; }
@media (max-width: 700px) { .kpis { grid-template-columns: 1fr 1fr; } .kpi-value { font-size: 22px; } }
.line-asset { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.swap summary { cursor: pointer; color: var(--accent); font-weight: 600; width: fit-content; }
.swap[open] { background: var(--ground); border-radius: 10px; padding: 10px 12px; margin-top: 4px; max-width: 420px; }
.swap[open] summary { margin-bottom: 8px; }

/* Etape 5 · fakturering */
.inline-filter { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.inline-filter .field input { min-height: 38px; }
.result-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.result-list li { padding: 8px 12px; border-radius: 8px; }
.result-list li.ok { background: var(--ok-bg); color: var(--ok-ink); }
.result-list li.bad { background: var(--bad-bg); color: var(--bad-ink); }
.mini-table { border-collapse: collapse; font-size: 13px; width: 100%; }
.mini-table td { padding: 3px 8px 3px 0; border: 0; }
tr.is-cancelled td { color: var(--muted); text-decoration: line-through; }
tr.is-cancelled td:nth-child(5), tr.is-cancelled td:last-child { text-decoration: none; }
.economic-actions { margin-top: 14px; }
#economic .form-grid { align-items: start; }
#economic .economic-actions + p { margin-top: 8px; }

/* Etape 6 · overblik og påmindelser */
.kpis.kpis-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.link-plain { background: none; border: 0; padding: 0; font: inherit; font-size: 13px; color: var(--accent); cursor: pointer; text-decoration: underline; }
.all-clear { display: flex; flex-direction: column; gap: 4px; padding: 18px; border-radius: 10px; background: var(--ok-bg); color: var(--ok-ink); }
.reminders { list-style: none; margin: 4px 0 0; padding: 0; }
.reminder { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0 12px 12px; border-bottom: 1px solid var(--line-soft); border-left: 3px solid transparent; }
.reminder:last-child { border-bottom: 0; }
.reminder-bad { border-left-color: var(--bad-ink); }
.reminder-warn { border-left-color: #D99A2B; }
.reminder-info { border-left-color: var(--line); }
.reminder-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.reminder-top { display: flex; align-items: center; gap: 8px; }
.reminder-title { font-weight: 600; color: var(--ink); text-decoration: none; }
.reminder-title:hover { text-decoration: underline; color: var(--accent-dark); }
.snooze { position: relative; flex: none; }
.snooze summary { list-style: none; cursor: pointer; font-size: 13px; color: var(--muted); padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; }
.snooze summary::-webkit-details-marker { display: none; }
.snooze-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 5; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(19,33,29,.12); padding: 6px; display: flex; flex-direction: column; min-width: 150px; }
.snooze-menu button { width: 100%; text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 6px; font: inherit; font-size: 14px; cursor: pointer; color: var(--ink); }
.snooze-menu button:hover { background: var(--ground); }
.fact-note { margin: 12px 0 0; }
.side-nav .nav-count { display: inline-block; min-height: 0; font-size: 11px; font-weight: 700; background: #D99A2B; color: #13211D; border-radius: 999px; padding: 0 7px; line-height: 18px; }
