/* GreenGrid Besigtigelse – designsystem baseret på greengrid.dk
   Farver: CTA-grøn #3EC383, oliven #87A413, skovgrøn #14251E, navy (logo) #2C3E91
   Skrift: Montserrat (overskrifter), Open Sans (brødtekst) */

:root {
  --ink-900: #14251e;
  --ink-800: #1a3027;
  --ink-700: #243e32;
  --ink-600: #2f4c3f;
  --green-400: #3ec383;
  --green-500: #2aa46b;
  --green-600: #1e8455;
  --green-700: #186f47;
  --green-50: #eef8f2;
  --green-100: #d6efe1;
  --olive: #87a413;
  --olive-text: #5f7409;
  --olive-50: #f3f7e3;
  --navy: #2c3e91;
  --text: #1c2521;
  --text-2: #4a5650;
  --text-3: #6b7671;
  --border: #e1e6e2;
  --border-2: #cdd5d0;
  --bg: #f3f5f3;
  --surface: #ffffff;
  --surface-2: #f8faf8;
  --hover: #f3f7f4;
  --danger: #c23b3b;
  --danger-50: #fcefef;
  --warning: #9a6200;
  --warning-50: #fdf5e4;
  --info: #2a5ea8;
  --info-50: #edf3fb;
  /* Diagrammer (valideret: kontrast >= 3:1 mod hvid) */
  --viz-1: #23935f;
  --viz-track: #d6efe1;
  --grid: #e8ece9;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(16, 30, 24, .06);
  --shadow: 0 1px 3px rgba(16, 30, 24, .08), 0 1px 2px rgba(16, 30, 24, .04);
  --shadow-lg: 0 16px 40px rgba(16, 30, 24, .18);
  --font: 'Open Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-head: 'Montserrat', 'Open Sans', system-ui, sans-serif;
  --sidebar-w: 236px;
  --topbar-h: 60px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 14px/1.5 var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; margin: 0; color: var(--text); letter-spacing: -.005em; }
h1 { font-size: 21px; line-height: 1.3; }
h2 { font-size: 15px; }
h3 { font-size: 14px; }
p { margin: 0 0 10px; }
a { color: var(--green-600); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.boot { display: grid; place-items: center; min-height: 100vh; color: var(--text-3); }
:focus-visible { outline: 2px solid var(--green-400); outline-offset: 2px; }

/* ---------- App-skal ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 30;
  background: var(--ink-900); color: rgba(255, 255, 255, .78);
  display: flex; flex-direction: column;
}
.brand { height: var(--topbar-h); display: flex; align-items: center; gap: 10px; padding: 0 18px; border-bottom: 1px solid rgba(255, 255, 255, .07); }
/* Green Grids logo: lodret streg, GREEN GRID og det runde ikon (hvidt på mørk baggrund som på greengrid.dk). */
.brand-logo { display: inline-flex; align-items: stretch; gap: 12px; min-width: 0; color: #fff; text-decoration: none; }
.brand-bar { width: 2px; flex: none; background: currentColor; border-radius: 1px; }
.brand-text { display: flex; flex-direction: column; justify-content: center; gap: 4px; min-width: 0; line-height: 1.1; }
.brand-row { display: flex; align-items: center; gap: 9px; }
.brand-mark { width: 20px; height: 20px; flex: none; }
.brand-word { font-family: var(--font-head); font-weight: 600; font-size: 14px; letter-spacing: .22em; color: #fff; white-space: nowrap; }
.brand-word b { font-weight: 600; color: inherit; }
.brand-product { font-size: 11.5px; font-weight: 500; letter-spacing: .04em; color: rgba(255, 255, 255, .62); white-space: nowrap; }
.brand-logo.light { color: #3d3d3b; }
.brand-logo.light .brand-word { color: #3d3d3b; }
.brand-logo.light .brand-word b { color: #7aa868; }
.nav { flex: 1; overflow-y: auto; padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; }
.nav-section { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .38); padding: 14px 10px 6px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 11px; height: 38px; padding: 0 10px;
  color: rgba(255, 255, 255, .78); border-radius: 7px; font-weight: 600; font-size: 13.5px; text-decoration: none;
}
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a.active { background: rgba(255, 255, 255, .09); color: #fff; }
.nav a.active::before { content: ''; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--green-400); }
.nav a .count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--green-400); color: var(--ink-900); font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
.sidebar-foot { padding: 12px; border-top: 1px solid rgba(255, 255, 255, .07); display: flex; align-items: center; gap: 10px; }
.sidebar-foot .who { min-width: 0; flex: 1; }
.sidebar-foot .who strong { display: block; color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-foot .who span { display: block; font-size: 12px; color: rgba(255, 255, 255, .5); }
.sidebar-foot .btn-icon { color: rgba(255, 255, 255, .7); border-color: transparent; background: transparent; }
.sidebar-foot .btn-icon:hover { background: rgba(255, 255, 255, .08); color: #fff; }

.main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--topbar-h); background: var(--surface);
  border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; padding: 0 24px;
}
.topbar .menu-btn { display: none; }
.search { position: relative; width: min(420px, 100%); }
.search svg.i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-3); width: 16px; height: 16px; }
.search input { padding-left: 34px; background: var(--surface-2); }
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); max-height: 420px; overflow-y: auto; padding: 6px; z-index: 40;
}
.search-results .group { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); padding: 8px 10px 4px; }
.search-results a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 6px; color: var(--text); text-decoration: none; }
.search-results a:hover, .search-results a.focus { background: var(--hover); }
.search-results small { color: var(--text-3); margin-left: auto; white-space: nowrap; }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.content { padding: 24px; flex: 1; }
.page { max-width: 1440px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .titles { min-width: 0; }
.page-head .sub { color: var(--text-3); font-size: 13px; margin-top: 2px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumbs { font-size: 12.5px; color: var(--text-3); margin-bottom: 4px; }
.crumbs a { color: var(--text-3); }

/* ---------- Knapper & formularer ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px;
  border: 1px solid var(--border-2); border-radius: var(--radius-sm); background: var(--surface); color: var(--text);
  font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap; text-decoration: none; line-height: 1;
}
.btn:hover { background: var(--hover); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg.i { width: 16px; height: 16px; }
.btn-primary { background: var(--green-600); border-color: var(--green-600); color: #fff; }
.btn-primary:hover { background: var(--green-700); border-color: var(--green-700); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-50); border-color: #e7b7b7; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--hover); color: var(--text); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn-icon { width: 34px; padding: 0; }
.btn-sm.btn-icon { width: 30px; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; }
.btn-group .btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.btn-group .btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.btn-group .btn + .btn { margin-left: -1px; }
.btn-group .btn.active { background: var(--green-50); color: var(--green-700); border-color: var(--border-2); }

.input, select.input, textarea.input {
  width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--border-2); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit; font-size: 14px;
}
textarea.input { height: auto; min-height: 88px; padding: 8px 10px; resize: vertical; line-height: 1.5; }
select.input { padding-right: 28px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%234a5650' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; }
.input:focus { outline: none; border-color: var(--green-600); box-shadow: 0 0 0 3px rgba(62, 195, 131, .22); }
.input:disabled { background: var(--surface-2); color: var(--text-3); }
.input-sm { height: 30px; font-size: 13px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.field label, .label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }
.field .hint { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.field-row { display: flex; gap: 8px; align-items: center; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; }
.check input { width: 16px; height: 16px; accent-color: var(--green-600); }
.form-error { background: var(--danger-50); color: var(--danger); border: 1px solid #f0caca; border-radius: var(--radius-sm); padding: 8px 12px; font-size: 13px; margin-bottom: 14px; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .input { width: auto; min-width: 160px; }
.toolbar .grow { flex: 1; min-width: 200px; max-width: 360px; }
.toolbar .spacer { flex: 1; }
.toolbar .btn-group { max-width: 100%; overflow-x: auto; }
.page-head .actions select.input { width: auto; min-width: 110px; }
.page[aria-busy="true"] { opacity: .55; pointer-events: none; transition: opacity .15s; }
.nowrap { white-space: nowrap; }

/* ---------- Kort, tabeller, badges ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card + .card { margin-top: 16px; }
.grid > .card + .card { margin-top: 0; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); min-height: 52px; flex-wrap: wrap; }
.card-head h2 { font-size: 14.5px; }
.card-head .actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card-head .meta { color: var(--text-3); font-size: 12.5px; }
.card-body { padding: 16px; }
.card-body.flush { padding: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.stack > * + * { margin-top: 16px; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.table th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--text-2); background: var(--surface-2);
  padding: 9px 12px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.click { cursor: pointer; }
.table tbody tr.click:hover td { background: var(--hover); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .muted, .muted { color: var(--text-3); }
.table .nowrap { white-space: nowrap; }
.table .strong { font-weight: 600; }
.table td.actions { text-align: right; white-space: nowrap; width: 1%; }
.table tfoot td { font-weight: 600; background: var(--surface-2); border-top: 1px solid var(--border); border-bottom: 0; }
.truncate { max-width: 340px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell-title { font-weight: 600; color: var(--text); }
.cell-sub { font-size: 12.5px; color: var(--text-3); }

.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px;
  font-size: 12px; font-weight: 600; background: #eef1ef; color: var(--text-2); white-space: nowrap;
}
.badge-green { background: var(--green-50); color: var(--green-700); }
.badge-olive { background: var(--olive-50); color: var(--olive-text); }
.badge-blue { background: var(--info-50); color: var(--info); }
.badge-amber { background: var(--warning-50); color: var(--warning); }
.badge-red { background: var(--danger-50); color: var(--danger); }
.badge-navy { background: #eceefa; color: var(--navy); }
.badge svg.i { width: 13px; height: 13px; }

.stage { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.stage::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--stage, #8a96a3); flex: none; }
[data-stage="lead"] { --stage: #8a96a3; }
[data-stage="kontakt"] { --stage: #2a5ea8; }
[data-stage="tilbud"] { --stage: #c58a16; }
[data-stage="vundet"] { --stage: #87a413; }
[data-stage="planlagt"] { --stage: #5a62b5; }
[data-stage="udfoerelse"] { --stage: #1e8455; }
[data-stage="kls"] { --stage: #2c3e91; }
[data-stage="afsluttet"] { --stage: #4f5f57; }
[data-stage="tabt"] { --stage: #c23b3b; }

.avatar {
  width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  background: var(--ink-700); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .02em;
}
.avatar.sm { width: 22px; height: 22px; font-size: 9.5px; }
.avatar.light { background: #e3e9e5; color: var(--text-2); }
.avatars { display: inline-flex; }
.avatars .avatar { border: 2px solid var(--surface); margin-left: -6px; }
.avatars .avatar:first-child { margin-left: 0; }

.empty { text-align: center; padding: 40px 16px; color: var(--text-3); }
.empty svg.i { width: 28px; height: 28px; color: var(--border-2); margin-bottom: 8px; }
.empty strong { display: block; color: var(--text-2); font-weight: 600; margin-bottom: 4px; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; background: var(--info-50); color: #1f4a86; border: 1px solid #d3e1f4; }
.notice.green { background: var(--green-50); color: var(--green-700); border-color: var(--green-100); }
.notice.amber { background: var(--warning-50); color: #7a4e00; border-color: #f1dfb8; }
.notice svg.i { margin-top: 1px; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.kbd { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 12.5px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; }
.copy-field { display: flex; gap: 8px; }
.copy-field .input { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 12.5px; }

/* Definitionslister (detaljer) */
.dl { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 9px 12px; font-size: 13.5px; margin: 0; }
.dl dt { color: var(--text-3); }
.dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ---------- Nøgletal ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 16px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm); min-width: 0; display: block; color: inherit; text-decoration: none; }
a.tile:hover { border-color: var(--border-2); text-decoration: none; }
.tile-label { font-size: 12.5px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.tile-value { font-family: var(--font-head); font-size: 26px; font-weight: 600; margin-top: 6px; line-height: 1.15; color: var(--text); }
.tile-sub { font-size: 12.5px; color: var(--text-3); margin-top: 4px; }
.meter { height: 8px; border-radius: 999px; background: var(--viz-track); overflow: hidden; margin-top: 10px; }
.meter > span { display: block; height: 100%; border-radius: 999px; background: var(--viz-1); }
.meter.thin { height: 6px; margin-top: 0; }
.rate { display: flex; align-items: center; gap: 10px; min-width: 150px; }
.rate .meter { flex: 1; margin: 0; }
.rate b { font-variant-numeric: tabular-nums; min-width: 42px; text-align: right; font-weight: 600; }

/* Søjlediagram (HTML) */
.colchart { position: relative; height: 220px; margin: 8px 0 0 var(--axis-w, 44px); }
.chart-table { margin-top: 14px; }
.chart-table summary { cursor: pointer; font-size: 13px; color: var(--text-2); width: fit-content; }
.chart-table .table-wrap { margin-top: 8px; }
.colchart .gridline { position: absolute; left: 0; right: 0; height: 1px; background: var(--grid); }
.colchart .gridline span { position: absolute; right: calc(100% + 8px); top: -8px; font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.colchart .baseline { position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--border-2); }
.colchart .cols { position: absolute; inset: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; align-items: end; }
.colchart .col { height: 100%; display: flex; align-items: flex-end; justify-content: center; cursor: default; position: relative; }
.colchart .col:hover { background: rgba(35, 147, 95, .05); }
.colchart .bar { width: min(24px, 60%); background: var(--viz-1); border-radius: 4px 4px 0 0; min-height: 0; }
.colchart-x { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; margin-left: var(--axis-w, 44px); padding-top: 6px; font-size: 11.5px; color: var(--text-3); text-align: center; }
.barlist { display: flex; flex-direction: column; gap: 10px; }
.barlist .row { display: grid; grid-template-columns: 170px minmax(0, 1fr) 110px; gap: 12px; align-items: center; font-size: 13px; }
.barlist .track { height: 10px; position: relative; }
.barlist .fill { height: 100%; background: var(--viz-1); border-radius: 0 4px 4px 0; min-width: 2px; }
.barlist .val { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-2); }
.viz-tip {
  position: fixed; z-index: 120; pointer-events: none; background: var(--ink-900); color: #fff; padding: 7px 10px;
  border-radius: 6px; font-size: 12.5px; box-shadow: var(--shadow-lg); white-space: nowrap;
}
.viz-tip b { display: block; font-weight: 600; }

/* ---------- Faner ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 10px 12px; font-weight: 600; font-size: 13.5px; color: var(--text-2); border: 0; background: none; cursor: pointer;
  box-shadow: inset 0 -2px 0 transparent; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); box-shadow: inset 0 -2px 0 var(--green-600); }
.tab .n { font-size: 11.5px; color: var(--text-3); font-weight: 600; }
.card .tabs { padding: 0 8px; margin-bottom: 0; }

/* ---------- Pipeline (kanban) ---------- */
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.board-col { flex: 0 0 276px; background: #e9eeea; border-radius: var(--radius); display: flex; flex-direction: column; max-height: calc(100vh - 230px); }
.board-col-head { padding: 11px 12px 9px; }
.board-col-head .title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; }
.board-col-head .title .n { margin-left: auto; color: var(--text-3); font-size: 12px; }
.board-col-head .sum { font-size: 12px; color: var(--text-3); margin-top: 2px; font-variant-numeric: tabular-nums; }
.board-col-body { padding: 4px 8px 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; min-height: 90px; border-radius: 0 0 var(--radius) var(--radius); }
.board-col.drop .board-col-body { background: rgba(62, 195, 131, .14); outline: 2px dashed var(--green-500); outline-offset: -4px; }
.deal {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; box-shadow: var(--shadow-sm);
  cursor: pointer; display: block; color: inherit; text-decoration: none;
}
.deal[draggable="true"] { cursor: grab; }
.deal:hover { border-color: var(--border-2); text-decoration: none; }
.deal.dragging { opacity: .45; }
.deal-num { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.deal-title { font-weight: 600; font-size: 13.5px; margin: 2px 0 2px; color: var(--text); line-height: 1.35; }
.deal-cust { font-size: 12.5px; color: var(--text-2); }
.deal-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--text-3); }
.deal-foot .value { margin-left: auto; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }

/* Det enkle forløb på sagen: lead → tilbud givet → pris accepteret */
.flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 12px; }
.flow-step { display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px; min-width: 0; }
.flow-step + .flow-step { border-left: 1px solid var(--border); }
.flow-dot { width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center; background: #e6ebe7; color: var(--text-2); font-weight: 700; font-size: 13px; }
.flow-dot svg.i { width: 15px; height: 15px; }
.flow-step.done .flow-dot { background: var(--green-600); color: #fff; }
.flow-body { min-width: 0; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.flow-title { font-family: var(--font-head); font-weight: 600; font-size: 14px; }
.flow-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.flow-stage { width: auto; min-width: 170px; }
.flow-start { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.flow-start label { font-weight: 600; color: var(--text-2); }
.flow-start .input { width: auto; }

.install-app { display: flex; align-items: center; gap: 8px; margin: 0 12px 10px; padding: 8px 12px; border-radius: var(--radius-sm); border: 1px dashed rgba(255, 255, 255, .28); background: transparent; color: inherit; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; opacity: .9; }
.install-app:hover { background: rgba(255, 255, 255, .08); opacity: 1; }
.install-app[hidden] { display: none; }

/* ---------- Forløb: henvendelse → lead → tilbud → accepteret ---------- */
.process { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.process li { position: relative; display: flex; gap: 8px; align-items: flex-start; padding-right: 8px; min-width: 0; }
.process li::before { content: ''; position: absolute; top: 7px; left: 16px; right: 0; height: 2px; background: var(--border); }
.process li:last-child::before { display: none; }
.process li.done::before { background: var(--green-500); }
.process .pdot { position: relative; z-index: 1; flex: none; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border-2); }
.process li.done .pdot { background: var(--green-500); border-color: var(--green-500); box-shadow: inset 0 0 0 3px var(--surface); }
.process li.current .pdot { border-color: var(--green-500); }
.process li.lost .pdot { border-color: var(--danger); background: var(--danger); }
.process li.skip .pdot { border-style: dashed; }
.process li > div { display: flex; flex-direction: column; min-width: 0; position: relative; z-index: 1; background: var(--surface); padding-right: 6px; }
.process strong { font-size: 12.5px; }
.process span { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.process li.lost strong { color: var(--danger); }
.process-card { padding: 14px 18px; }
@media (max-width: 640px) {
  .process { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 0; }
  .process li:nth-child(2)::before { display: none; }
}

/* ---------- Totrinsbekræftelse ---------- */
.steps-2fa { margin: 0 0 14px; padding-left: 20px; line-height: 1.7; font-size: 14px; }
.qr-2fa { display: flex; justify-content: center; margin: 6px 0 10px; }
.qr-2fa svg { width: 200px; height: 200px; background: #fff; padding: 6px; border-radius: 8px; border: 1px solid var(--border); }
.code-input { font-size: 22px; letter-spacing: .3em; text-align: center; max-width: 220px; font-variant-numeric: tabular-nums; }

/* ---------- Opfølgning (farvekoder) ---------- */
.fu-red { --fu: var(--danger); --fu-bg: var(--danger-50); }
.fu-amber { --fu: #c98a00; --fu-bg: var(--warning-50); }
.fu-blue { --fu: var(--info); --fu-bg: var(--info-50); }
.fu-green { --fu: var(--green-500); --fu-bg: var(--green-50); }
.fu-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.fu-tile { border: 1px solid var(--border); border-left: 4px solid var(--fu); background: var(--fu-bg); border-radius: var(--radius-sm); padding: 10px 14px; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.fu-tile span { font-size: 12px; font-weight: 700; color: var(--fu); text-transform: uppercase; letter-spacing: .03em; }
.fu-tile strong { font-family: var(--font-head); font-size: 24px; line-height: 1.2; }
.fu-tile em { font-style: normal; font-size: 12px; color: var(--text-3); }
.fu-table td.fu-bar, .fu-table th.fu-bar { width: 5px; padding: 0; }
.fu-row td.fu-bar { background: var(--fu); }
.fu-label { font-weight: 600; white-space: nowrap; color: var(--text); }
.fu-actions { text-align: right; }
.fu-actions .btn + .btn { margin-left: 4px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 0; background: var(--fu, var(--text-3)); }
.dot-red { --fu: var(--danger); } .dot-amber { --fu: #e0a100; } .dot-blue { --fu: var(--info); } .dot-green { --fu: var(--green-500); }
.tab .n.n-red { background: var(--danger); color: #fff; }
.fu-box { display: flex; flex-direction: column; gap: 6px; }
.flow-follow { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 10px 18px; border-top: 1px solid var(--border); font-size: 13px; }
@media (max-width: 800px) { .fu-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Tilbud ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border-2); background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer; font-family: inherit; }
.chip:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.chip.active { background: var(--ink-800); border-color: var(--ink-800); color: #fff; }
.chip .n { font-size: 12px; opacity: .7; }
button.link { background: none; border: 0; padding: 0; color: var(--green-600); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; }
.input.invalid { border-color: var(--danger); background: var(--danger-50); }
.quarter { margin-bottom: 16px; }
.quarter-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--border); }
.quarter-stats > div { padding: 12px 18px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.quarter-stats > div + div { border-left: 1px solid var(--border); }
.quarter-stats span, .quarter-stats em { font-size: 12px; color: var(--text-3); font-style: normal; }
.quarter-stats strong { font-family: var(--font-head); font-size: 17px; }
tr.status-accepteret td:first-child { box-shadow: inset 3px 0 0 var(--green-500); }
tr.status-afvist td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
tr.status-sendt td:first-child { box-shadow: inset 3px 0 0 var(--info); }
.offer-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 40%); gap: 18px; align-items: start; }
.offer-form { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.offer-form > .card { margin: 0; }
.offer-preview { position: sticky; top: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.preview-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 13px; }
.offer-preview iframe { display: block; width: 100%; height: calc(100vh - 120px); min-height: 480px; border: 0; background: #e9ecea; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.quick .chip { height: 26px; font-size: 12px; font-weight: 500; }
.offer-lines .offer-line { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 2fr) auto; gap: 6px; margin-bottom: 6px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.calc-section { padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.calc-title { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.calc-title h3 { margin: 0; font-size: 14px; }
.calc-sub { font-weight: 600; font-size: 13px; color: var(--text-2); }
.calc-rates { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 12.5px; color: var(--text-2); margin-bottom: 8px; }
.role-rate { display: inline-flex; gap: 5px; align-items: center; }
.input-xs { width: 64px; height: 26px; padding: 0 6px; font-size: 12.5px; text-align: right; }
.sheet-wrap { overflow-x: auto; margin-bottom: 8px; }
.sheet { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 600px; }
.sheet td:first-child { min-width: 190px; }
.sheet th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--text-3); padding: 4px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.sheet td { padding: 3px 4px; border-bottom: 1px solid var(--grid); vertical-align: middle; }
.sheet .input { height: 30px; font-size: 13px; padding: 0 8px; }
.sheet .input.num, .sheet .num { text-align: right; }
.sheet td.out { white-space: nowrap; font-variant-numeric: tabular-nums; }
.sheet .w-qty { width: 64px; }
.sheet .w-unit { width: 58px; }
.sheet .w-num { width: 98px; }
.sheet .w-role { width: 118px; }
.sheet .w-x { width: 34px; }
.sheet-empty td { color: var(--text-3); font-size: 12.5px; padding: 8px 4px; }
.calc-total dl { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; margin: 0; font-size: 13.5px; }
.calc-total dt { color: var(--text-2); }
.calc-total dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.calc-total .sum { border-top: 1px solid var(--border); padding-top: 6px; font-weight: 600; color: var(--text); }
.calc-total .grand { font-weight: 700; color: var(--text); font-size: 15px; }
.price-card .price-label { font-family: var(--font-head); font-weight: 600; font-size: 14px; display: block; margin-bottom: 6px; }
.price-input { display: flex; align-items: center; gap: 8px; }
.price-input .input { height: 52px; font-size: 26px; font-weight: 700; font-family: var(--font-head); max-width: 280px; text-align: right; }
.price-input span { font-size: 18px; font-weight: 600; color: var(--text-2); }
.price-db { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 10px; font-size: 13px; color: var(--text-2); }
.price-db strong { color: var(--text); }
.price-db .neg { color: var(--danger); }
details.texts > summary { cursor: pointer; list-style: none; }
details.texts > summary::-webkit-details-marker { display: none; }
details.texts > summary h2::before { content: '▸ '; color: var(--text-3); }
details.texts[open] > summary h2::before { content: '▾ '; }
.save-state { margin-left: 8px; font-size: 12.5px; }
.attachment-row { display: flex; gap: 8px; align-items: center; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); font-size: 13px; margin-bottom: 8px; }
@media (max-width: 1100px) {
  .offer-layout { grid-template-columns: minmax(0, 1fr); }
  .offer-preview { display: none; }
}
@media (max-width: 640px) {
  .quarter-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quarter-stats > div:nth-child(3) { border-left: 0; }
  .quarter-stats > div:nth-child(n+3) { border-top: 1px solid var(--border); }
  .offer-lines .offer-line { grid-template-columns: minmax(0, 1fr) auto; }
  .price-input .input { font-size: 22px; }
}
.extras { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; font-size: 13px; }
@media (max-width: 800px) {
  .flow { grid-template-columns: minmax(0, 1fr); }
  .flow-step + .flow-step { border-left: 0; border-top: 1px solid var(--border); }
}

/* Fase-trin på sagen */
.stepper { display: flex; gap: 3px; margin: 4px 0 18px; overflow-x: auto; }
.step {
  flex: 1 1 0; min-width: 96px; height: 34px; display: block; line-height: 34px; text-align: center; padding: 0 14px 0 18px;
  font-size: 12px; font-weight: 600; color: var(--text-2); background: #e6ebe7; border: 0; cursor: default;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%, 10px 50%);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.step:first-child { clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%); border-radius: 6px 0 0 6px; }
.step:last-child { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 10px 50%); border-radius: 0 6px 6px 0; }
.step.done { background: var(--green-100); color: var(--green-700); }
.step.current { background: var(--green-600); color: #fff; }
.step.can { cursor: pointer; }
.step.can:hover:not(.current) { filter: brightness(.96); }
.stepper.lost .step { background: #eceeed; color: var(--text-3); }

/* ---------- Tidslinje ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.timeline li:last-child { border-bottom: 0; }
.timeline .ico { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #eef1ef; color: var(--text-2); }
.timeline .ico svg.i { width: 15px; height: 15px; }
.timeline .ico.status { background: var(--green-50); color: var(--green-700); }
.timeline .ico.tilbud { background: #eceefa; color: var(--navy); }
.timeline .ico.henvendelse { background: var(--olive-50); color: var(--olive-text); }
.timeline .head { font-size: 12.5px; color: var(--text-3); }
.timeline .head strong { color: var(--text); font-weight: 600; }
.timeline .text { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 2px; font-size: 13.5px; }
.composer { display: flex; flex-direction: column; gap: 8px; }
.composer .row { display: flex; gap: 8px; align-items: center; }
.composer .row select { width: auto; }

/* ---------- Tjekliste (KLS) ---------- */
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: grid; grid-template-columns: 24px minmax(0, 1fr) minmax(140px, 260px); gap: 10px 12px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.checklist li:last-child { border-bottom: 0; }
.checklist li.done .lbl { color: var(--text-2); }
.checklist input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--green-600); cursor: pointer; }
.checklist .lbl { font-size: 13.5px; }
.checklist .by { display: block; font-size: 12px; color: var(--text-3); }
.progress-line { display: flex; align-items: center; gap: 12px; }
.progress-line .meter { flex: 1; margin: 0; }

/* ---------- Modal, skuffe, toast ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(12, 22, 17, .45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; overflow-y: auto; }
.modal { background: var(--surface); border-radius: 12px; width: min(560px, 100%); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; max-height: 88vh; }
.modal.lg { width: min(880px, 100%); }
.modal.sm { width: min(420px, 100%); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 16px; }
.modal-head .btn-icon { margin-left: auto; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 12px 12px; }
.modal-foot .left { margin-right: auto; }
.drawer-backdrop { position: fixed; inset: 0; z-index: 55; background: rgba(12, 22, 17, .3); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(600px, 100%); background: var(--surface); z-index: 56; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slidein .16s ease-out; }
@keyframes slidein { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.drawer .modal-body { flex: 1; }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast { background: var(--ink-900); color: #fff; padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow-lg); font-size: 13.5px; display: flex; gap: 8px; align-items: center; max-width: 420px; }
.toast.error { background: #8e2626; }
.toast svg.i { width: 16px; height: 16px; }
.menu { position: absolute; z-index: 45; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-lg); padding: 6px; min-width: 190px; }
.menu button, .menu a { display: flex; width: 100%; align-items: center; gap: 10px; padding: 8px 10px; border: 0; background: none; border-radius: 6px; font-size: 13.5px; color: var(--text); cursor: pointer; text-align: left; text-decoration: none; }
.menu button:hover, .menu a:hover { background: var(--hover); text-decoration: none; }
.menu svg.i { width: 16px; height: 16px; color: var(--text-2); }

/* Tilbudslinjer */
.lines-table input { height: 32px; font-size: 13.5px; }
.lines-table td { padding: 6px 6px; border-bottom: 0; }
.lines-table th { padding: 6px; background: none; border-bottom: 1px solid var(--border); }
.totals { margin-left: auto; width: min(320px, 100%); font-size: 13.5px; }
.totals div { display: flex; justify-content: space-between; padding: 4px 0; font-variant-numeric: tabular-nums; }
.totals .grand { font-weight: 700; border-top: 1px solid var(--border); margin-top: 4px; padding-top: 8px; font-size: 14.5px; }
.attachment { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); font-size: 13px; }

/* Ugeoversigt (timer) */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.day { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.day.today { border-color: var(--green-500); box-shadow: inset 0 0 0 1px var(--green-500); }
.day .d { font-size: 12px; color: var(--text-3); font-weight: 600; }
.day .h { font-family: var(--font-head); font-size: 18px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.quick-add { display: grid; grid-template-columns: 150px minmax(180px, 1.4fr) 170px 100px minmax(160px, 1.6fr) auto; gap: 8px; align-items: end; }

/* ---------- Login ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; background: var(--ink-900); padding: 24px 16px; }
.auth-box { width: min(400px, 100%); }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 22px; }
.auth-brand .brand-word { font-size: 18px; }
.auth-brand .brand-product { font-size: 13.5px; }
.auth-brand .brand-mark { width: 24px; height: 24px; }
.auth .card { padding: 28px; border: 0; box-shadow: var(--shadow-lg); }
.auth h1 { font-size: 19px; margin-bottom: 4px; }
.auth .sub { color: var(--text-3); font-size: 13px; margin-bottom: 20px; }
.auth .field + .field { margin-top: 14px; }
.auth .btn-primary { width: 100%; height: 40px; margin-top: 20px; }
.auth-foot { text-align: center; color: rgba(255, 255, 255, .45); font-size: 12px; margin-top: 18px; }

/* ---------- Besigtigelse ---------- */
.insp-head { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; }
.insp-when { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.insp-when .badge { margin-top: 2px; }
.insp-when strong { font-size: 14.5px; }
.insp-when .muted { font-size: 12.5px; margin-top: 1px; }
.insp-head .actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.insp-progress {
  position: sticky; top: var(--topbar-h); z-index: 5; display: flex; align-items: center; gap: 6px 12px; flex-wrap: wrap;
  padding: 9px 16px; background: var(--surface-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  font-size: 12.5px; color: var(--text-3);
}
.save-state { margin-left: auto; font-weight: 600; color: var(--green-700); }
.save-state.error { color: var(--danger); }
.insp-section + .insp-section { border-top: 1px solid var(--border); }
.insp-section h3 { margin-bottom: 12px; }
.insp-section > .hint { font-size: 12.5px; color: var(--text-3); }
.seg { display: inline-flex; border: 1px solid var(--border-2); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.seg > label { position: relative; display: block; margin: 0; cursor: pointer; font-size: 13.5px; color: var(--text-2); }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.seg span { display: flex; align-items: center; justify-content: center; min-width: 64px; height: 34px; padding: 0 14px; font-weight: 600; }
.seg > label + label span { border-left: 1px solid var(--border-2); }
.seg > label:hover input:not(:checked):not(:disabled) + span { background: var(--hover); color: var(--text); }
.seg input:checked + span { background: var(--green-600); color: #fff; }
.seg input:focus-visible + span { box-shadow: inset 0 0 0 2px var(--green-400); }
.seg input:disabled + span { cursor: not-allowed; }
.seg input:disabled:not(:checked) + span { color: var(--text-3); }
.unit-input { position: relative; }
.unit-input .input { padding-right: 46px; }
.unit-input .unit { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 12.5px; color: var(--text-3); pointer-events: none; }
.insp-photos-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.insp-photos-head h3 { margin: 0; }
.insp-photos-head .btn { margin-left: auto; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.photo-grid figure { margin: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface-2); min-width: 0; }
.photo-grid img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #e6ebe7; }
.photo-grid figcaption { padding: 8px 10px; font-size: 12.5px; color: var(--text-2); overflow-wrap: anywhere; }
.photo-tools { display: flex; gap: 4px; align-items: center; padding: 6px; }
.photo-tools .input { flex: 1; min-width: 0; }

/* Liste over besigtigelser */
.tabs-end { margin-left: auto; padding: 0 8px; flex: none; font-size: 13px; color: var(--text-2); }
.insp-day { padding: 9px 16px; font-size: 12.5px; font-weight: 600; color: var(--text-2); background: var(--surface-2); border-bottom: 1px solid var(--border); }
.insp-row {
  display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 16px;
  border-bottom: 1px solid var(--border); color: inherit; text-decoration: none;
}
.insp-row:last-child { border-bottom: 0; }
.insp-row:hover { background: var(--hover); text-decoration: none; }
.insp-date { display: flex; flex-direction: column; align-items: center; padding: 6px 4px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); line-height: 1.3; text-align: center; }
.insp-date .d { font-size: 12px; font-weight: 600; color: var(--text-3); }
.insp-date .t { font-family: var(--font-head); font-size: 15px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.insp-main { min-width: 0; }
.insp-main .cell-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.insp-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; text-align: right; }
.insp-meta .cell-sub { display: inline-flex; align-items: center; gap: 4px; }
.insp-meta svg.i { width: 13px; height: 13px; }

/* Rapport (skærm og print) */
.report { max-width: 860px; margin: 0 auto; padding: 32px 36px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.report-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding-bottom: 18px; margin-bottom: 6px; border-bottom: 2px solid var(--green-600); }
.report-brand { display: flex; align-items: center; gap: 12px; }
.report-brand { flex-direction: column; align-items: flex-start; gap: 8px; }
.report-brand .brand-logo { height: 30px; }
.report-brand .brand-word { font-size: 17px; }
.report-brand .brand-mark { width: 26px; height: 26px; }
.report-company { font-family: var(--font-head); font-size: 17px; font-weight: 700; }
.report-meta { text-align: right; font-size: 13px; color: var(--text-2); }
.report-block { padding: 16px 0; border-bottom: 1px solid var(--border); break-inside: avoid; }
.report-block:last-of-type { border-bottom: 0; }
.report-block h2 { margin-bottom: 10px; font-size: 14.5px; color: var(--green-700); }
.report-dl { grid-template-columns: 200px minmax(0, 1fr); }
.report-dl dd { white-space: pre-wrap; }
.report-photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.report-photos figure { margin: 0; break-inside: avoid; }
.report-photos img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; }
.report-photos figcaption { margin-top: 4px; font-size: 12.5px; color: var(--text-2); }
.report-foot { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-3); text-align: center; }

/* ---------- Mobil ---------- */
@media (max-width: 1100px) {
  .grid-main { grid-template-columns: minmax(0, 1fr); }
  .quick-add { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-add .wide { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .18s ease; }
  .app.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .app.nav-open::after { content: ''; position: fixed; inset: 0; background: rgba(12, 22, 17, .4); z-index: 25; }
  .main { margin-left: 0; }
  .topbar { padding: 0 12px; }
  .topbar .menu-btn { display: inline-flex; }
  .content { padding: 16px; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .week { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .barlist .row { grid-template-columns: 110px minmax(0, 1fr) 90px; }
}
@media (max-width: 600px) {
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .page-head .actions { margin-left: 0; width: 100%; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile-value { font-size: 21px; }
  .checklist li { grid-template-columns: 24px minmax(0, 1fr); }
  .checklist li .note { grid-column: 2; }
  .quick-add { grid-template-columns: minmax(0, 1fr); }
  .topbar-actions .btn span { display: none; }
  .dl { grid-template-columns: 110px minmax(0, 1fr); }
  .modal-backdrop { padding: 0; align-items: stretch; }
  .modal { border-radius: 0; max-height: none; min-height: 100vh; }
  /* Besigtigelse på telefonen: større knapper og ingen zoom, når et felt får fokus (iOS). */
  .insp-head .actions { margin-left: 0; width: 100%; }
  .insp-section .input, .photo-tools .input { font-size: 16px; }
  .insp-section .input:not(textarea) { height: 42px; }
  .seg span { min-width: 76px; height: 40px; }
  .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .insp-row { grid-template-columns: 72px minmax(0, 1fr); gap: 12px; }
  .insp-meta { grid-column: 2; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 10px; text-align: left; }
  .tabs-end { padding-left: 12px; }
  .report { padding: 20px 16px; }
  .report-head { flex-direction: column; }
  .report-meta { text-align: left; }
  .report-dl { grid-template-columns: 120px minmax(0, 1fr); }
  .report-photos { grid-template-columns: minmax(0, 1fr); }
}
@page { margin: 14mm; }
@media print {
  .sidebar, .topbar, .page-head .actions, .toolbar { display: none !important; }
  .main { margin-left: 0; }
  body { background: #fff; }
  .content { padding: 0; }
  .report { max-width: none; padding: 0; border: 0; border-radius: 0; box-shadow: none; }
  .report-photos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report a { color: inherit; }
}
