/* Farver og mål følger dashboard-skitsen. Lyst/mørkt tema følger macOS. */
:root {
    --bg: #F4F3EF;
    --surface: #FFFFFF;
    --ink: #1C1B19;
    --muted: #5E5B55;
    --line: #E2DFD8;
    --line-soft: #EEECE7;
    --accent: #2B55A6;
    --accent-ink: #FFFFFF;
    --side: #1C1B19;
    --side-ink: #CFCCC4;
    --side-active: #34322E;
    --ok-bg: #DFF0E8;   --ok-ink: #1F6B55;
    --warn-bg: #F3EBD6; --warn-ink: #6B4E10;
    --error-bg: #FBE3D3; --error-ink: #9A3412;
    --btn-bg: #E6ECF7;
    --btn-ink: #1D3E80;
    --btn-border: #C9D5EC;
    --btn-hover: #D8E2F4;
    --radius: 10px;
    --gap: 20px;
    --font: "Geist", -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
    --mono: "Geist Mono", "SF Mono", Menlo, monospace;
    color-scheme: light dark;
}
/* Lys / Mørk / Følg systemet pr. bruger (version 76): data-mode på <html> sættes kun for temaer, der følger systemet */
:root:where([data-mode="light"]) { color-scheme: light; }
:root:where([data-mode="dark"]) { color-scheme: dark; }

@media (prefers-color-scheme: dark) {
    :root:not(:where([data-mode="light"])) {
        --bg: #161614;
        --surface: #1F1E1B;
        --ink: #ECEAE4;
        --muted: #A29E95;
        --line: #33312D;
        --line-soft: #2A2825;
        --accent: #7A9BE0;
        --accent-ink: #10131A;
        --side: #0F0F0E;
        --side-active: #2A2825;
        --ok-bg: #173228;   --ok-ink: #8FD3B6;
        --warn-bg: #3A2F14; --warn-ink: #E8CB85;
        --error-bg: #3D1F12; --error-ink: #F4A77F;
        --btn-bg: #25324A;
        --btn-ink: #C9D8F7;
        --btn-border: #34496F;
        --btn-hover: #2F3F5E;
    }
}
/* Mørkt valgt pr. bruger (version 76) */
:root:where([data-mode="dark"]) {
        --bg: #161614;
        --surface: #1F1E1B;
        --ink: #ECEAE4;
        --muted: #A29E95;
        --line: #33312D;
        --line-soft: #2A2825;
        --accent: #7A9BE0;
        --accent-ink: #10131A;
        --side: #0F0F0E;
        --side-active: #2A2825;
        --ok-bg: #173228;   --ok-ink: #8FD3B6;
        --warn-bg: #3A2F14; --warn-ink: #E8CB85;
        --error-bg: #3D1F12; --error-ink: #F4A77F;
        --btn-bg: #25324A;
        --btn-ink: #C9D8F7;
        --btn-border: #34496F;
        --btn-hover: #2F3F5E;
    }


*, *::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); }
h1 { font-size: 26px; line-height: 1.2; font-weight: 600; letter-spacing: -0.3px; margin: 0 0 12px; }
h2 { font-size: 17px; font-weight: 600; margin: 0 0 10px; }
p { margin: 0 0 12px; }
a { color: var(--accent); }
code { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 13px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Ramme */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 232px; flex-shrink: 0; background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; padding: 28px 16px; gap: 24px; }
.brand { color: var(--brand, #FFFFFF); font-weight: 600; font-size: 16px; padding: 0 12px; margin: 0; }
.sidebar ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.sidebar a, .sidebar .soon { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 8px; text-decoration: none; color: var(--side-ink); }
.sidebar a:hover { background: var(--side-active); color: var(--side-active-ink, #FFFFFF); }
.sidebar a[aria-current="page"] { background: var(--side-active); color: var(--side-active-ink, #FFFFFF); font-weight: 600; }
.sidebar .soon { opacity: 0.45; cursor: default; }
.sidebar-foot { margin-top: auto; padding: 12px; border-top: 1px solid var(--side-line, #3A3834); display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.sidebar-foot .link { color: var(--side-ink); }
.main { flex: 1; min-width: 0; padding: 32px 40px 48px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px; }
.narrow { max-width: 640px; }

/* Formularer og knapper */
.stack { display: flex; flex-direction: column; gap: 14px; margin: 16px 0; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; }
input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="tel"], input[type="url"], select, textarea {
    font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-height: 44px; padding: 0 14px;
}
textarea { padding: 10px 14px; min-height: 96px; }
.code-input { font-family: var(--mono); font-size: 22px; letter-spacing: 4px; text-align: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border-radius: var(--radius); border: 1px solid var(--btn-border); background: var(--btn-bg); color: var(--btn-ink); font: inherit; font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--btn-hover); }
.btn-quiet { background: transparent; border-color: transparent; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn-primary:hover { background: var(--accent); filter: brightness(1.1); border-color: var(--accent); color: var(--accent-ink); }
.btn-small { min-height: 36px; padding: 0 12px; font-size: 13px; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; }

/* Beskeder */
.notice { padding: 10px 14px; border-radius: var(--radius); font-size: 14px; }
.notice-ok { background: var(--ok-bg); color: var(--ok-ink); }
.notice-warn { background: var(--warn-bg); color: var(--warn-ink); }
.notice-error { background: var(--error-bg); color: var(--error-ink); }

/* Login */
body.auth { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.auth-card { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 32px; }
.auth-brand { font-weight: 600; color: var(--muted); font-size: 14px; }
.steps { padding-left: 20px; margin: 0 0 16px; }
.steps li { margin-bottom: 6px; }
.secret { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px dashed var(--line); border-radius: var(--radius); margin-bottom: 12px; }
.secret code { font-size: 15px; word-break: break-all; }
details { margin-bottom: 12px; }
summary { cursor: pointer; color: var(--accent); }
.wrap { display: block; word-break: break-all; margin: 8px 0; font-size: 12px; }
.codes { list-style: none; padding: 0; margin: 16px 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; font-family: var(--mono); font-size: 16px; }
.codes li { padding: 8px 12px; background: var(--bg); border-radius: 8px; text-align: center; }

/* Sider */
.crumb { margin: 0 0 4px; font-size: 13px; }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--accent); }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.page-head { align-items: flex-start; }
.page-head h1 .muted { font-weight: 400; }
.panel + .panel, .panel + form, form + .panel { margin-top: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.panel-head h2 { margin: 0; }
.empty { text-align: left; }
.columns { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: var(--gap); align-items: start; }
.col-side .panel + .panel, .col-side .panel + form { margin-top: 20px; }
.form-panel { max-width: 760px; }
.section-gap { margin-top: 20px; }
.danger-zone { margin-top: 20px; max-width: 760px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Tabeller */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.panel .table-wrap { border: 0; border-radius: 0; background: none; margin: 0 -8px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: 13px; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
td a { font-weight: 500; text-decoration: none; }
td a:hover { text-decoration: underline; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.dim td { color: var(--muted); }

/* Lister */
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--line-soft); }
.rows li:first-child { border-top: 0; }
.rows li form { margin-left: auto; }
.rows li strong { margin-left: auto; font-variant-numeric: tabular-nums; }
.contacts { list-style: none; margin: 0 0 12px; padding: 0; }
.contacts li { padding: 10px 0; border-top: 1px solid var(--line-soft); }
.contacts li:first-child { border-top: 0; }
.log { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.log li { padding: 6px 0; border-top: 1px solid var(--line-soft); overflow-wrap: anywhere; }  /* lange ord som sha256 brydes, så siden ikke bliver bredere end mobilen (68.4) */
.log li:first-child { border-top: 0; }
.log time { color: var(--muted); font-variant-numeric: tabular-nums; margin-right: 8px; font-size: 13px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.facts-row { grid-template-columns: repeat(3, auto 1fr); }
.notes { white-space: normal; font-size: 14px; margin-top: 12px; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; background: var(--line-soft); color: var(--muted); vertical-align: middle; }
.badge-ext { background: var(--warn-bg); color: var(--warn-ink); }

/* Formularer */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.filters input[type="search"] { flex: 1 1 280px; order: -3; }
.filters > .filter-toggle { order: -2; }
.filters > button[type="submit"], .filters > a.btn-quiet { order: -1; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.span-2 { grid-column: 1 / -1; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
label.check input { width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--accent); }
input[type="number"], input[type="date"], input[type="time"], input[type="datetime-local"] { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-height: 44px; padding: 0 14px; }
.hint { font-size: 12px; font-weight: 400; color: var(--muted); }
.field-error { font-size: 13px; font-weight: 500; color: var(--error-ink); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
legend { font-weight: 600; padding: 0 6px; }
.input-num { width: 110px; text-align: right; }
.inline-form { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-top: 12px; }
/* Felt med enhed bagefter, fx "6 måneder" i årshjulet (version 61): enheden står ved siden af, så felterne flugter */
.input-unit { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.input-unit .input-num { width: 6em; }
.btn-danger { background: var(--error-bg); color: var(--error-ink); border-color: var(--error-bg); }
.btn-danger:hover { background: var(--error-bg); color: var(--error-ink); border-color: var(--error-ink); }

/* Nøgletal */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat { display: flex; flex-direction: column; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; color: var(--ink); text-decoration: none; }
a.stat:hover { border-color: var(--muted); }
.stat-value { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.3px; }
.stat-label { font-size: 13px; color: var(--muted); }

@media (max-width: 1100px) {
    .columns { grid-template-columns: minmax(0, 1fr); }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Telefon */
@media (max-width: 760px) {
    .shell { flex-direction: column; }
    .sidebar { width: 100%; padding: 16px; gap: 12px; }
    .sidebar ul { flex-direction: row; overflow-x: auto; overflow-y: hidden; }
    .sidebar a, .sidebar .soon { white-space: nowrap; }
    .sidebar-foot { margin-top: 0; }
    .main { padding: 20px 16px 40px; }
    .grid-2 { grid-template-columns: minmax(0, 1fr); }
    .facts-row { grid-template-columns: auto 1fr; }
    .page-head { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}

/* Hjælpetekster (kan slås fra under Indstillinger) */
.help { font-size: 13px; line-height: 1.5; color: var(--muted); border-left: 3px solid var(--line); padding: 2px 0 2px 12px; margin: 0 0 14px; max-width: 70ch; }

/* Produkttyper */
.type-list { list-style: none; margin: 0; padding: 0; }
.type-list li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line-soft); }
.type-list li:first-child { border-top: 0; }
.type-list input[type="text"] { flex: 1; min-width: 0; }
.type-move { display: flex; gap: 4px; }
.type-count { white-space: nowrap; }
.btn-icon { min-width: 36px; min-height: 36px; padding: 0; font-size: 15px; }
.btn[disabled] { opacity: 0.35; cursor: default; }

/* Rabatter */
.badge-on { background: var(--ok-bg); color: var(--ok-ink); }
.steps-table { margin: 16px 0 8px; }
.steps-table td, .steps-table th { padding: 6px 8px 6px 0; border: 0; }
.steps-table td:first-child { color: var(--muted); width: 40px; }
.discount-form .check { margin: 8px 0; }


/* Hovedknapper i toppen, der følger med ved scroll */
.page-head { position: sticky; top: 0; z-index: 10; background: var(--bg); margin: -12px -40px 20px; padding: 12px 40px 14px; border-bottom: 1px solid transparent; transition: border-color 0.15s, box-shadow 0.15s; }
body.is-scrolled .page-head { border-bottom-color: var(--line); box-shadow: 0 6px 16px -12px rgba(0, 0, 0, 0.35); }
.page-head h1 { margin-bottom: 4px; }
.page-head p { margin-bottom: 0; }
.head-actions { justify-content: flex-end; }

/* Lister */
.sort-link { color: inherit; text-decoration: none; }
.sort-link:hover { color: var(--accent); }
th[aria-sort] .sort-link { color: var(--ink); }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 14px 0; }
.pages { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pages .btn { min-width: 36px; padding: 0 10px; }

/* Prisfelter */
.price-field { display: flex; flex-direction: column; gap: 6px; }
.price-field > label { font-size: 14px; font-weight: 500; }
.price-row { display: flex; gap: 8px; }
.price-row input { flex: 1; min-width: 0; }
.price-row select { flex: 0 0 auto; }
.price-preview { font-size: 13px; color: var(--muted); min-height: 1em; }
.stack-tight { display: flex; flex-direction: column; gap: 6px; }

/* Beskrivelse i pop-up */
.info-btn { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; margin-left: 6px; border-radius: 50%; border: 1px solid var(--btn-border); background: var(--btn-bg); color: var(--btn-ink); font: italic 600 12px/1 Georgia, serif; cursor: pointer; vertical-align: middle; }
.info-btn:hover { background: var(--btn-hover); }
.dialog { max-width: 560px; width: calc(100% - 32px); border: 1px solid var(--line); border-radius: 16px; padding: 24px; background: var(--surface); color: var(--ink); }
.dialog::backdrop { background: rgba(0, 0, 0, 0.45); }
.dialog h2 { margin-bottom: 4px; }
.dialog-meta { margin-bottom: 14px; }
.dialog-body { font-size: 15px; line-height: 1.6; }

@media (max-width: 760px) {
    .page-head { position: static; margin: 0 0 16px; padding: 0; }
    .head-actions { justify-content: flex-start; }
    .price-row { flex-direction: column; }
}

/* Træk og slip */
.drag-handle { cursor: grab; color: var(--muted); font-size: 14px; letter-spacing: -2px; padding: 0 4px; user-select: none; }
[data-sortable] > .dragging { opacity: 0.4; }
[data-sortable] > .drop-before { box-shadow: inset 0 2px 0 var(--accent); }
[data-sortable] > .drop-after { box-shadow: inset 0 -2px 0 var(--accent); }
.sort-saved { color: var(--ok-ink); font-size: 13px; margin-left: 8px; }
@media (hover: none) { .drag-handle { display: none; } }

.contact-edit { margin-top: 6px; }
.contact-edit summary { display: inline-block; }
.contact-edit .actions { flex-wrap: wrap; }

/* Betegnelse under produktnavnet */
.agreement-label { display: block; font-size: 13px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.agreement-label-head { font-size: 15px; margin: -2px 0 4px; }

/* Telefon med landevælger */
.phone-field { display: flex; flex-direction: column; gap: 6px; }
.phone-field > label { font-size: 14px; font-weight: 500; }
.phone-row { display: flex; gap: 8px; }
.phone-row select { flex: 0 0 auto; width: auto; max-width: 48%; }
.phone-row input { flex: 1; min-width: 0; }

/* Adresseopslag */
.address-lookup { position: relative; display: flex; flex-direction: column; gap: 6px; }
.address-lookup > label { font-size: 14px; font-weight: 500; }
.address-suggestions { position: absolute; top: 72px; left: 0; right: 0; z-index: 20; list-style: none; margin: 0; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 28px -12px rgba(0, 0, 0, 0.4); max-height: 320px; overflow-y: auto; }
.address-suggestions li { padding: 10px 12px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.address-suggestions li[aria-selected="true"], .address-suggestions li:hover { background: var(--btn-bg); color: var(--btn-ink); }
.address-suggestions li.partial { color: var(--muted); }
.address-suggestions li.partial::after { content: " – vælg og skriv husnummer"; font-size: 12px; }

.badge-bundle { background: var(--btn-bg); color: var(--btn-ink); }
.flush { margin: 0; }

.input-small { min-height: 36px; padding: 0 10px; }
.row-actions { display: flex; gap: 10px; align-items: center; justify-content: flex-end; white-space: nowrap; }

.quiet-link { color: inherit; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 2px; }
.quiet-link:hover { color: var(--accent); text-decoration-color: currentColor; }
.value-cell { display: flex; gap: 6px; justify-content: flex-end; }

/* Hjælpeikoner */
.help-icon { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; margin-left: 8px; padding: 0; border-radius: 50%; border: 1px solid var(--btn-border); background: var(--btn-bg); color: var(--btn-ink); font: 600 12px/1 var(--font); cursor: pointer; vertical-align: middle; flex: 0 0 auto; }
.help-icon:hover { background: var(--btn-hover); }
label > .help-icon { margin-left: 6px; }
label { flex-direction: column; }
.label-text { display: inline-flex; align-items: center; }
.price-field > label, .phone-field > label, .address-lookup > label { display: inline-flex; align-items: center; }


/* ---------- Status-farver (bruges i gitter, lister og modaler) ---------- */
:root {
    --st-pending: #9C988F; --st-pending-bg: #ECEAE4;
    --st-sent: #2B55A6;    --st-sent-bg: #DCE5F6;
    --st-overdue: #C2410C; --st-overdue-bg: #FBE3D3;
    --st-paid: #1F6B55;    --st-paid-bg: #D7EDE3;
    --st-sponsored: #7A4FA0; --st-sponsored-bg: #EDE3F6;
    --st-void: #8A877F;    --st-void-bg: #F1F0EC;
}
@media (prefers-color-scheme: dark) {
    :root:not(:where([data-mode="light"])) {
        --st-pending: #A29E95; --st-pending-bg: #2E2C29;
        --st-sent: #7A9BE0;    --st-sent-bg: #22304A;
        --st-overdue: #F4A77F; --st-overdue-bg: #45261A;
        --st-paid: #8FD3B6;    --st-paid-bg: #1C3A2F;
        --st-sponsored: #C9A6EA; --st-sponsored-bg: #35284A;
        --st-void: #8A877F;    --st-void-bg: #262523;
    }
}
/* Mørkt valgt pr. bruger (version 76) */
:root:where([data-mode="dark"]) {
        --st-pending: #A29E95; --st-pending-bg: #2E2C29;
        --st-sent: #7A9BE0;    --st-sent-bg: #22304A;
        --st-overdue: #F4A77F; --st-overdue-bg: #45261A;
        --st-paid: #8FD3B6;    --st-paid-bg: #1C3A2F;
        --st-sponsored: #C9A6EA; --st-sponsored-bg: #35284A;
        --st-void: #8A877F;    --st-void-bg: #262523;
    }

.status-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.status-pill.status-pending { background: var(--st-pending-bg); color: var(--st-pending); }
.status-pill.status-sent { background: var(--st-sent-bg); color: var(--st-sent); }
.status-pill.status-overdue { background: var(--st-overdue-bg); color: var(--st-overdue); }
.status-pill.status-paid { background: var(--st-paid-bg); color: var(--st-paid); }
.status-pill.status-sponsored { background: var(--st-sponsored-bg); color: var(--st-sponsored); }
.status-pill.status-void { background: var(--st-void-bg); color: var(--st-void); text-decoration: line-through; }

/* ---------- Månedsgitter ---------- */
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin: 0 0 12px; font-size: 13px; color: var(--muted); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-swatch { width: 14px; height: 14px; border-radius: 4px; border: 2px solid; }
.grid-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.month-grid { min-width: 1080px; }
.mg-row { display: grid; grid-template-columns: 240px repeat(12, minmax(64px, 1fr)); align-items: stretch; border-top: 1px solid var(--line-soft); min-height: 48px; }
.mg-row > * { grid-row: 1; }
.mg-head { border-top: 0; min-height: 40px; }
.mg-label { grid-column: 1; padding: 8px 12px; font-size: 14px; position: sticky; left: 0; background: var(--surface); z-index: 2; border-right: 1px solid var(--line-soft); }
.mg-label a { font-weight: 500; text-decoration: none; }
.mg-month { display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; }
.mg-month.is-current { color: var(--accent); }
.mg-cell { border-left: 1px solid var(--line-soft); }
.mg-cell.is-current { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.mg-owner { min-height: 34px; background: var(--bg); }
.mg-owner-name { grid-column: 1 / -1; padding: 0; font-size: 13px; font-weight: 600; }
.mg-sticky { position: sticky; left: 0; display: inline-block; padding: 8px 12px; background: var(--bg); }
.mg-owner-name a { color: var(--ink); text-decoration: none; }
.mg-bar { z-index: 1; margin: 8px 3px; border-radius: 8px; border: 2px solid; display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 0 8px; font: 600 12px var(--font); cursor: pointer; min-width: 0; overflow: hidden; white-space: nowrap; }
.mg-bar:hover { filter: brightness(1.05); box-shadow: 0 2px 8px -4px rgba(0,0,0,0.4); }
.mg-bar.cut-left { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left-style: dashed; }
.mg-bar.cut-right { border-top-right-radius: 0; border-bottom-right-radius: 0; border-right-style: dashed; }
.mg-progress { font-weight: 500; opacity: 0.8; }
.mg-bar.status-pending, .legend-swatch.status-pending { background: var(--st-pending-bg); border-color: var(--st-pending); color: var(--ink); }
.mg-bar.status-sent, .legend-swatch.status-sent { background: var(--st-sent-bg); border-color: var(--st-sent); color: var(--st-sent); }
.mg-bar.status-overdue, .legend-swatch.status-overdue { background: var(--st-overdue-bg); border-color: var(--st-overdue); color: var(--st-overdue); }
.mg-bar.status-paid, .legend-swatch.status-paid { background: var(--st-paid-bg); border-color: var(--st-paid); color: var(--st-paid); }
.mg-bar.status-sponsored, .legend-swatch.status-sponsored { background: var(--st-sponsored-bg); border-color: var(--st-sponsored); color: var(--st-sponsored); }
.mg-bar.status-void { background: var(--st-void-bg); border-color: var(--st-void); color: var(--st-void); text-decoration: line-through; }
.mg-foot { background: var(--bg); min-height: 44px; }
.mg-total { display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 12px; font-variant-numeric: tabular-nums; border-left: 1px solid var(--line-soft); }
.mg-total.is-current { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.gc-2 { grid-column: 2; }
.gs-2 { grid-column-start: 2; }
.gc-3 { grid-column: 3; }
.gs-3 { grid-column-start: 3; }
.gc-4 { grid-column: 4; }
.gs-4 { grid-column-start: 4; }
.gc-5 { grid-column: 5; }
.gs-5 { grid-column-start: 5; }
.gc-6 { grid-column: 6; }
.gs-6 { grid-column-start: 6; }
.gc-7 { grid-column: 7; }
.gs-7 { grid-column-start: 7; }
.gc-8 { grid-column: 8; }
.gs-8 { grid-column-start: 8; }
.gc-9 { grid-column: 9; }
.gs-9 { grid-column-start: 9; }
.gc-10 { grid-column: 10; }
.gs-10 { grid-column-start: 10; }
.gc-11 { grid-column: 11; }
.gs-11 { grid-column-start: 11; }
.gc-12 { grid-column: 12; }
.gs-12 { grid-column-start: 12; }
.gc-13 { grid-column: 13; }
.gs-13 { grid-column-start: 13; }
.ge-3 { grid-column-end: 3; }
.ge-4 { grid-column-end: 4; }
.ge-5 { grid-column-end: 5; }
.ge-6 { grid-column-end: 6; }
.ge-7 { grid-column-end: 7; }
.ge-8 { grid-column-end: 8; }
.ge-9 { grid-column-end: 9; }
.ge-10 { grid-column-end: 10; }
.ge-11 { grid-column-end: 11; }
.ge-12 { grid-column-end: 12; }
.ge-13 { grid-column-end: 13; }
.ge-14 { grid-column-end: 14; }

/* ---------- Fakturering ---------- */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.tab { padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--ink); }
.tab[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.tab-count { display: inline-block; min-width: 22px; padding: 0 6px; border-radius: 999px; background: var(--line-soft); font-size: 12px; text-align: center; margin-left: 4px; }
.tab-forfaldne .tab-count { background: var(--st-overdue-bg); color: var(--st-overdue); }
.bulk-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.bulk-total { margin-left: auto; }
.nowrap { white-space: nowrap; }
.dialog-wide { max-width: 720px; }
.invoice-box { margin-bottom: 14px; border-left-width: 4px; }
.invoice-box.status-pending { border-left-color: var(--st-pending); }
.invoice-box.status-sent { border-left-color: var(--st-sent); }
.invoice-box.status-overdue { border-left-color: var(--st-overdue); }
.invoice-box.status-paid { border-left-color: var(--st-paid); }
.invoice-box.status-sponsored { border-left-color: var(--st-sponsored); }

/* ---------- Dashboard ---------- */
.stats .stat .stat-label:first-child { text-transform: uppercase; letter-spacing: 0.5px; font-weight: 500; }
.text-overdue { color: var(--st-overdue); }
.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; align-items: start; }
.dash-grid-wide { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.dash-grid .panel + .panel { margin-top: 0; }
.action-list { list-style: none; margin: 0; padding: 0; }
.action-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.action-list li:first-child { border-top: 0; }
.action-text { flex: 1; min-width: 0; }
.action-text a { font-weight: 500; text-decoration: none; }
.upcoming-date { width: 44px; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; }
.badge.upcoming-renewal { background: var(--st-sent-bg); color: var(--st-sent); }
.badge.upcoming-deadline { background: var(--warn-bg); color: var(--warn-ink); }
.badge.upcoming-discount { background: var(--st-sponsored-bg); color: var(--st-sponsored); }
.chart { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; height: 200px; align-items: end; }
.chart-col { display: flex; flex-direction: column; height: 100%; gap: 6px; }
.chart-bar-area { flex: 1; display: flex; align-items: flex-end; justify-content: center; }
.chart-bar { width: 100%; max-width: 36px; border-radius: 4px 4px 0 0; display: flex; align-items: flex-end; }
.chart-expected { background: var(--st-pending-bg); border: 1px solid var(--st-pending); border-bottom: 0; }
.chart-invoiced { background: var(--st-paid); max-width: none; border-radius: 3px 3px 0 0; }
.chart-label { text-align: center; font-size: 12px; color: var(--muted); }
.chart-label.is-current { color: var(--accent); font-weight: 600; }
.hbars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.hbar-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.hbar-head a { text-decoration: none; }
.hbar-track { display: block; height: 8px; border-radius: 4px; background: var(--line-soft); }
.hbar { display: block; height: 8px; border-radius: 4px; background: var(--accent); }
@media (max-width: 1100px) { .dash-grid, .dash-grid-wide { grid-template-columns: minmax(0, 1fr); } }
.h-0 { height: 0%; }
.w-0 { width: 0%; }
.h-5 { height: 5%; }
.w-5 { width: 5%; }
.h-10 { height: 10%; }
.w-10 { width: 10%; }
.h-15 { height: 15%; }
.w-15 { width: 15%; }
.h-20 { height: 20%; }
.w-20 { width: 20%; }
.h-25 { height: 25%; }
.w-25 { width: 25%; }
.h-30 { height: 30%; }
.w-30 { width: 30%; }
.h-35 { height: 35%; }
.w-35 { width: 35%; }
.h-40 { height: 40%; }
.w-40 { width: 40%; }
.h-45 { height: 45%; }
.w-45 { width: 45%; }
.h-50 { height: 50%; }
.w-50 { width: 50%; }
.h-55 { height: 55%; }
.w-55 { width: 55%; }
.h-60 { height: 60%; }
.w-60 { width: 60%; }
.h-65 { height: 65%; }
.w-65 { width: 65%; }
.h-70 { height: 70%; }
.w-70 { width: 70%; }
.h-75 { height: 75%; }
.w-75 { width: 75%; }
.h-80 { height: 80%; }
.w-80 { width: 80%; }
.h-85 { height: 85%; }
.w-85 { width: 85%; }
.h-90 { height: 90%; }
.w-90 { width: 90%; }
.h-95 { height: 95%; }
.w-95 { width: 95%; }
.h-100 { height: 100%; }
.w-100 { width: 100%; }
.chart-expected.h-0 { border: 0; }

.badge-sponsored { background: var(--st-sponsored-bg); color: var(--st-sponsored); }
.danger-zone { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }

/* Betegnelser med hjælpeikon står til venstre med ikonet lige efter */
.price-field > label, .phone-field > label, .address-lookup > label { display: inline-flex; flex-direction: row; align-items: center; align-self: flex-start; }
.label-text { flex-direction: row; }

/* Opsigelse og tjeklister */
.status-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.badge-cancelled { background: var(--warn-bg); color: var(--warn-ink); }
.task-list { list-style: none; margin: 0; padding: 0; }
.task-list li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line-soft); }
.task-list li:first-child { border-top: 0; }
.task-list li.is-done .task-text { text-decoration: line-through; color: var(--muted); }
.task-text { flex: 1; }
.task-check { width: 24px; height: 24px; border-radius: 6px; border: 2px solid var(--btn-border); background: var(--surface); color: var(--st-paid); font-weight: 700; cursor: pointer; padding: 0; }
.task-list li.is-done .task-check { background: var(--st-paid-bg); border-color: var(--st-paid); }
.checklist-editor { border-top: 1px solid var(--line-soft); padding: 10px 0; } .checklist-editor:first-of-type { border-top: 0; }
.badge.upcoming-ending { background: var(--error-bg); color: var(--error-ink); }

/* Prisregulering */
.product-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 16px; margin: 4px 0 8px 28px; }
.stats-compact { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 12px 0 20px; }
.stats-compact .stat-value { font-size: 20px; }
@media (max-width: 700px) { .stats-compact { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.letter { border-top: 1px solid var(--line-soft); padding: 10px 0; }
.letter-text { white-space: pre-wrap; font-family: var(--font); font-size: 14px; background: var(--bg); border-radius: var(--radius); padding: 14px; margin: 10px 0; }

/* Tooltips */
.tooltip { position: absolute; z-index: 1000; max-width: 280px; overflow-wrap: anywhere; padding: 8px 12px; border-radius: 8px; background: var(--ink); color: var(--bg); font-size: 13px; line-height: 1.45; box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.45); pointer-events: none; }
.tooltip-title { font-weight: 600; margin-bottom: 2px; }

/* Egne pile på dropdowns med luft til kanten */
select {
    -webkit-appearance: none;
    appearance: none;
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235E5B55' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 12px 8px;
}
select[multiple] { background-image: none; padding-right: 14px; }
@media (prefers-color-scheme: dark) {
    :where(:root:not([data-mode="light"])) select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23A29E95' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
}
/* Mørkt valgt pr. bruger (version 76) */
:where([data-mode="dark"]) select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23A29E95' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }

select.input-small { padding-right: 32px; background-position: right 10px center; }

.badge-update { background: var(--warn-bg); color: var(--warn-ink); text-decoration: none; }

/* Domæner */
.icon-link { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; margin-left: 4px; border-radius: 6px; color: var(--muted); vertical-align: middle; }
.icon-link:hover { background: var(--btn-bg); color: var(--btn-ink); }
.icon-link svg { width: 14px; height: 14px; }
.badge-dns-elsewhere, .badge-dns-none { background: var(--error-bg); color: var(--error-ink); }
.badge-dns-here { background: var(--st-sent-bg); color: var(--st-sent); }

/* Månedsgitter med 3, 6, 12 eller 24 måneder */
.mg-cols-3 .mg-row { grid-template-columns: 240px repeat(3, minmax(160px, 1fr)); }
.mg-cols-6 .mg-row { grid-template-columns: 240px repeat(6, minmax(110px, 1fr)); }
.mg-cols-12 .mg-row { grid-template-columns: 240px repeat(12, minmax(64px, 1fr)); }
.mg-cols-24 .mg-row { grid-template-columns: 240px repeat(24, minmax(44px, 1fr)); }
.mg-cols-3, .mg-cols-6 { min-width: 0; }
.mg-cols-24 { min-width: 1400px; }
.mg-cols-24 .mg-month { font-size: 10px; letter-spacing: 0; }
.mg-cols-24 .mg-amount { font-size: 11px; }
.inline-select { display: inline-flex; margin: 0; }
.gc-14 { grid-column: 14; }
.gs-14 { grid-column-start: 14; }
.gc-15 { grid-column: 15; }
.gs-15 { grid-column-start: 15; }
.gc-16 { grid-column: 16; }
.gs-16 { grid-column-start: 16; }
.gc-17 { grid-column: 17; }
.gs-17 { grid-column-start: 17; }
.gc-18 { grid-column: 18; }
.gs-18 { grid-column-start: 18; }
.gc-19 { grid-column: 19; }
.gs-19 { grid-column-start: 19; }
.gc-20 { grid-column: 20; }
.gs-20 { grid-column-start: 20; }
.gc-21 { grid-column: 21; }
.gs-21 { grid-column-start: 21; }
.gc-22 { grid-column: 22; }
.gs-22 { grid-column-start: 22; }
.gc-23 { grid-column: 23; }
.gs-23 { grid-column-start: 23; }
.gc-24 { grid-column: 24; }
.gs-24 { grid-column-start: 24; }
.gc-25 { grid-column: 25; }
.gs-25 { grid-column-start: 25; }
.gc-26 { grid-column: 26; }
.gs-26 { grid-column-start: 26; }
.ge-15 { grid-column-end: 15; }
.ge-16 { grid-column-end: 16; }
.ge-17 { grid-column-end: 17; }
.ge-18 { grid-column-end: 18; }
.ge-19 { grid-column-end: 19; }
.ge-20 { grid-column-end: 20; }
.ge-21 { grid-column-end: 21; }
.ge-22 { grid-column-end: 22; }
.ge-23 { grid-column-end: 23; }
.ge-24 { grid-column-end: 24; }
.ge-25 { grid-column-end: 25; }
.ge-26 { grid-column-end: 26; }
.ge-27 { grid-column-end: 27; }
[hidden] { display: none !important; }
.chart-bar-area { gap: 3px; }
.chart-expense { background: var(--st-overdue-bg); border: 1px solid var(--st-overdue); border-bottom: 0; max-width: 14px; }
.badge.upcoming-expense, .badge.upcoming-expense-deadline { background: var(--st-overdue-bg); color: var(--st-overdue); }

/* Dokumenter */
.doc { padding: 10px 0; border-top: 1px solid var(--line-soft); }
.doc:first-of-type { border-top: 0; }
.doc-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.doc-files { list-style: none; margin: 0 0 6px; padding: 0; font-size: 14px; }
.doc-files li { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; padding: 3px 0; }
.doc-files li form { margin-left: auto; }
.badge.doc-signed { background: var(--st-paid-bg); color: var(--st-paid); }
.badge.doc-sent { background: var(--st-sent-bg); color: var(--st-sent); }
.badge.doc-draft { background: var(--line-soft); color: var(--muted); }

/* Dansk datovælger */
.datepick { position: relative; display: flex; align-items: stretch; }
.datepick .date-text { flex: 1; min-width: 0; padding-right: 44px; font-variant-numeric: tabular-nums; }
.datepick .date-text.is-invalid { border-color: var(--error-ink); }
.date-button { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.date-button:hover { background: var(--btn-bg); color: var(--btn-ink); }
.date-button svg { width: 16px; height: 16px; }
.datepick-pop { position: fixed; top: 0; left: 0; z-index: 1000; width: 320px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; box-shadow: 0 16px 40px -16px rgba(0, 0, 0, 0.5); font-size: 14px; font-weight: 400; }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dp-title { font-weight: 600; }
.dp-nav { width: 32px; height: 32px; border: 1px solid var(--btn-border); border-radius: 8px; background: var(--btn-bg); color: var(--btn-ink); cursor: pointer; font-size: 18px; line-height: 1; }
.dp-grid { width: 100%; border-collapse: collapse; }
.dp-grid th { padding: 4px 0; text-align: center; font-size: 11px; font-weight: 600; color: var(--muted); border: 0; }
.dp-grid td { padding: 1px; border: 0; text-align: center; }
.dp-week { font-size: 11px; color: var(--muted); width: 32px; font-variant-numeric: tabular-nums; }
.dp-day { width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); cursor: pointer; font: inherit; font-variant-numeric: tabular-nums; }
.dp-day:hover { background: var(--btn-bg); color: var(--btn-ink); }
.dp-day.is-other { color: var(--muted); opacity: 0.55; }
.dp-day.is-weekend:not(.is-selected) { color: var(--muted); }
.dp-day.is-today { box-shadow: inset 0 0 0 1.5px var(--accent); }
.dp-day.is-selected { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.dp-foot { display: flex; justify-content: space-between; margin-top: 8px; }

/* Gitter: navn i bjælken og tydelig hover */
.mg-amount { flex: 0 0 auto; }
.mg-progress { flex: 0 0 auto; }
.mg-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; font-weight: 500; opacity: 0.8; }
.mg-bar { transition: background-color 0.12s, box-shadow 0.12s; }
.mg-bar:hover, .mg-bar:focus-visible { filter: none; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px currentColor; }
.mg-bar.status-pending:hover, .mg-bar.status-pending:focus-visible { background: color-mix(in srgb, var(--st-pending) 30%, var(--st-pending-bg)); }
.mg-bar.status-sent:hover, .mg-bar.status-sent:focus-visible { background: color-mix(in srgb, var(--st-sent) 30%, var(--st-sent-bg)); }
.mg-bar.status-overdue:hover, .mg-bar.status-overdue:focus-visible { background: color-mix(in srgb, var(--st-overdue) 30%, var(--st-overdue-bg)); }
.mg-bar.status-paid:hover, .mg-bar.status-paid:focus-visible { background: color-mix(in srgb, var(--st-paid) 30%, var(--st-paid-bg)); }
.mg-bar.status-sponsored:hover, .mg-bar.status-sponsored:focus-visible { background: color-mix(in srgb, var(--st-sponsored) 30%, var(--st-sponsored-bg)); }
.mg-cols-24 .mg-name { display: none; }

/* Drop-zone til filer */
.dropzone { position: relative; display: flex; align-items: center; justify-content: center; min-height: 72px; padding: 14px; border: 2px dashed var(--line); border-radius: var(--radius); background: var(--bg); text-align: center; cursor: pointer; transition: border-color 0.12s, background-color 0.12s; }
.dropzone input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone-text { font-size: 14px; font-weight: 400; color: var(--muted); pointer-events: none; }
.dropzone:hover, .dropzone.is-over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--bg)); }
.dropzone.has-file { border-style: solid; border-color: var(--st-paid); }
.dropzone.has-file .dropzone-text { color: var(--ink); font-weight: 500; }
.dropzone:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Menuen bliver stående ved scroll */
@media (min-width: 761px) {
    .sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; }
}

.cvr-status { font-size: 12px; font-weight: 400; min-height: 1em; }
.cvr-status.is-ok { color: var(--st-paid); }
.cvr-status.is-warn { color: var(--warn-ink); }
.cvr-status.is-bad { color: var(--error-ink); }

/* Dokumenter: titel, historik og preview */
.doc-title { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--accent); cursor: pointer; text-align: left; }
.doc-title:hover { text-decoration: underline; }
.doc-files .link { text-align: left; }
.file-actions { flex-basis: 100%; }
.file-actions summary { display: inline-block; }
.doc-history { margin: 4px 0 8px; }
.dialog-preview { max-width: 1100px; width: calc(100% - 32px); height: calc(100vh - 64px); padding: 16px; display: flex; flex-direction: column; }
.dialog-preview:not([open]) { display: none; }
.preview-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.preview-head h2 { margin: 0; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.preview-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.preview-body { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; background: var(--bg); border-radius: var(--radius); overflow: auto; }
.preview-body iframe { width: 100%; height: 100%; border: 0; border-radius: var(--radius); background: #fff; }
.preview-body img { max-width: 100%; max-height: 100%; object-fit: contain; }
.preview-note { color: var(--muted); padding: 24px; text-align: center; }

/* Datovælger: titel som knap og oversigt over måneder og år */
.dp-title { background: none; border: 0; padding: 4px 10px; border-radius: 8px; font: inherit; font-weight: 600; color: var(--ink); cursor: pointer; }
.dp-title:hover { background: var(--btn-bg); color: var(--btn-ink); }
.dp-title.is-static { cursor: default; }
.dp-title.is-static:hover { background: none; color: var(--ink); }
.dp-cells { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 4px 0; }
.dp-cell { height: 44px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); cursor: pointer; font: inherit; }
.dp-cell:hover { background: var(--btn-bg); color: var(--btn-ink); }
.dp-cell.is-selected { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.date-text { letter-spacing: 0.3px; }
.alias-arrow { color: var(--muted); margin: 0 4px; }
.columns > .col-main > .panel:first-child, .columns > .col-side > .panel:first-child { margin-top: 0; }

/* Kundens tilbudsside */
body.public { background: #f4f5f2; color: #1d2220; display: block; min-height: 100vh; }
.public-head { background: #00413A; padding: 18px 24px; }
.public-brand { color: #72C38E; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; font-size: 20px; }
.public-main { max-width: 860px; margin: 0 auto; padding: 24px 16px 48px; }
.public-card { background: #fff; border-radius: 16px; padding: 24px; margin-bottom: 20px; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.public-card h1 { margin: 4px 0 12px; }
.public-card .muted { color: #5f6660; }
.public-message { white-space: normal; background: #f4f5f2; border-radius: 12px; padding: 16px; margin-top: 12px; }
.public-pdf iframe { width: 100%; height: 75vh; border: 0; border-radius: 12px; background: #eee; }
.public-foot { text-align: center; color: #5f6660; font-size: 13px; padding: 16px 16px 32px; }
body.public .section-row th { background: #f4f5f2; font-size: 13px; }
.public-form input[type="text"], .public-form textarea { background: #fff; color: #1d2220; border-color: #cfd4cf; }
.code-input { font-size: 24px; letter-spacing: 6px; max-width: 220px; font-variant-numeric: tabular-nums; }
.signature { display: flex; flex-direction: column; gap: 6px; }
.signature-label { font-weight: 600; font-size: 14px; }
.signature canvas { width: 100%; max-width: 600px; height: auto; aspect-ratio: 600 / 180; border: 1px dashed #b9c0b9; border-radius: 12px; background: #fff; touch-action: none; cursor: crosshair; }
body.public .btn-primary { background: #00413A; color: #fff; border-color: #00413A; }
/* Kundens side er altid lys og i Thrane.nu's farver, uanset kundens mørke tema */
body.public {
    color-scheme: light;
    --bg: #f4f5f2; --surface: #ffffff; --ink: #1d2220; --muted: #5f6660;
    --line: #dfe3de; --line-soft: #eceee9;
    --btn-bg: #e8efe9; --btn-ink: #00413A; --btn-border: #cfdcd2; --btn-hover: #d3eadb;
    --accent: #00413A; --accent-ink: #ffffff;
    /* Også hover og beskeder, ellers slår administrationens mørke tema igennem (60.3) */
    --ok-bg: #DFF0E8; --ok-ink: #1F6B55;
    --warn-bg: #F3EBD6; --warn-ink: #6B4E10;
    --error-bg: #FBE3D3; --error-ink: #9A3412;
}

/* Tilbud i administrationen */
/* Startdato pr. linje under Opret aftaler: datoen først i en fast kolonne, så felterne står på linje (60.3) */
.line-starts li { display: grid; grid-template-columns: 210px 1fr; align-items: center; gap: 14px; }
.line-starts li > :first-child { width: 100%; min-width: 0; }
.badge.offer-draft { background: var(--line-soft); color: var(--muted); }
.badge.offer-sent { background: var(--st-sent-bg); color: var(--st-sent); }
.badge.offer-accepted { background: var(--st-paid-bg); color: var(--st-paid); }
.badge.offer-rejected, .badge.offer-expired { background: var(--error-bg); color: var(--error-ink); }
.lines-table td { vertical-align: top; }
.lines-table input[type="text"] { min-width: 0; }
.lines-table .line-note { margin-top: 4px; font-size: 13px; }
.lines-table .line-text { display: flex; gap: 4px; align-items: center; }
.lines-table .line-text input { flex: 1; }
.lines-table select.is-missing { border-color: var(--warn-ink); }
.lines-table .center { text-align: center; }
/* Rabat på tilbudslinjer (version 81): værdi og % / kr. på én række, varighed og pris efter rabat under */
.lines-table .line-discount { display: flex; gap: 4px; align-items: center; }
.lines-table .line-discount .input-num { width: 6em; }
.lines-table .line-discount select.input-small { min-width: 64px; width: auto; }
.lines-table .line-discount + select { margin-top: 4px; }
.offer-preview { width: 100%; height: 420px; border: 0; border-radius: var(--radius); background: #fff; }
.signature-image { display: block; max-width: 260px; margin-top: 8px; background: #fff; border-radius: 8px; padding: 4px; }

/* Tilbudslinjer: ingen afskårne dropdowns */
.lines-table { min-width: 900px; }
.lines-table select.input-small { min-width: 118px; width: 100%; }
.lines-table td:nth-child(3) { min-width: 210px; }
.lines-table td:nth-child(4) { min-width: 240px; }
.lines-table td:nth-child(3) .combo-input { min-width: 200px; }
.lines-table .new-line td { padding-top: 10px; }
.lines-table tr.new-line + tr.new-line td { border-top: 0; padding-top: 4px; }
.lines-table .new-line select.input-small:has(option[value=""]:checked) { color: var(--muted); }
.public-logo { display: block; height: 20px; }
.public-logo svg { display: block; height: 20px; width: auto; aspect-ratio: 800 / 89; }
.public-head { display: flex; align-items: center; min-height: 64px; }
.badge.offer-followup { background: var(--st-overdue-bg); color: var(--st-overdue); }

/* Mailhistorik */
.mail-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.mail-list li + li { border-top: 1px solid var(--line-soft); }
.mail-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; color: inherit; text-decoration: none; }
.mail-row:hover { background: var(--btn-bg); }
.mail-dir { flex: 0 0 26px; height: 26px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.mail-in { background: var(--st-sent-bg); color: var(--st-sent); }
.mail-out { background: var(--st-paid-bg); color: var(--st-paid); }
.mail-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mail-top { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.mail-subject { color: var(--accent); }
.mail-snippet, .mail-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-date { flex: 0 0 auto; }
.mail-body { white-space: normal; line-height: 1.6; overflow-wrap: anywhere; margin-top: 16px; }
.mail-quoted { margin-top: 16px; border-top: 1px solid var(--line-soft); padding-top: 10px; }
.mail-headers { margin-bottom: 8px; }
.mail-attachments { margin: 8px 0 0; }
.mail-list-compact { border: 0; border-radius: 0; background: none; margin: 0 -16px; }
form.filters.is-loading input[type="search"] { background-image: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 18%, transparent), transparent); background-size: 200% 100%; animation: search-loading 1s linear infinite; }
@keyframes search-loading { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.mail-star { color: #e0a93b; font-size: 15px; line-height: 1; }
.mail-note { color: var(--ink); background: color-mix(in srgb, #e0a93b 14%, transparent); border-radius: 6px; padding: 2px 8px; align-self: flex-start; }
.rate-source:empty { display: none; }
.mail-item { position: relative; display: flex; align-items: flex-start; }
.mail-item .mail-row { flex: 1; min-width: 0; }
.mail-mark { flex: 0 0 auto; margin: 12px 0 0 10px; width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 16px; cursor: pointer; opacity: 0.45; }
.mail-mark:hover, .mail-mark:focus-visible { background: var(--btn-bg); opacity: 1; }
.mail-mark.is-on { color: #e0a93b; opacity: 1; }
.brand.has-logo, .auth-brand.has-logo { line-height: 0; }
.brand-link { color: inherit; text-decoration: none; display: inline-block; max-width: 100%; }
.brand-link:hover, .brand-link:focus-visible { opacity: .85; }
.brand.has-logo img, .auth-brand.has-logo img { display: block; width: auto; max-width: 100%; }
.brand-preview { background: #111; border-radius: 10px; padding: 16px; display: inline-block; line-height: 0; }
.brand-preview img { width: auto; }


/* ---------- Farvetemaer (Indstillinger → Farvetema) ---------- */
/* Thrane grøn: lyst eller mørkt efter Mac'ens indstilling */
html[data-theme="thrane"] { color-scheme: light;
    --bg: #F3F5F2; --surface: #FFFFFF; --ink: #14231F; --muted: #5A6763; --line: #DCE3DF; --line-soft: #EAEFEC;
    --accent: #00413A; --accent-ink: #FFFFFF;
    --side: #00413A; --side-ink: #B9D6CC; --side-active: #0B544B; --side-active-ink: #FFFFFF; --side-line: #0B544B; --brand: #72C38E;
    --ok-bg: #DDF0E4; --ok-ink: #1C6B3F; --warn-bg: #FBEBD2; --warn-ink: #7A4A06; --error-bg: #FBE1DA; --error-ink: #A2331A;
    --btn-bg: #E3F2E8; --btn-ink: #00413A; --btn-border: #C4E3CF; --btn-hover: #D3EADB;
    --st-pending: #8A867E; --st-pending-bg: #ECEAE4; --st-sent: #2B55A6; --st-sent-bg: #DCE5F6; --st-overdue: #C2410C; --st-overdue-bg: #FBE3D3; --st-paid: #1F6B55; --st-paid-bg: #D7EDE3; --st-sponsored: #7A4FA0; --st-sponsored-bg: #EDE3F6; --st-void: #8A877F; --st-void-bg: #F1F0EC; --st-paid: #1C6B3F; --st-paid-bg: #DDF0E4; }
@media (prefers-color-scheme: dark) { html[data-theme="thrane"]:not(:where([data-mode="light"])) { color-scheme: dark;
    --bg: #0E1614; --surface: #15201D; --ink: #E4EEEA; --muted: #93A7A0; --line: #243330; --line-soft: #1C2926;
    --accent: #72C38E; --accent-ink: #06231E;
    --side: #00312C; --side-ink: #A9C9BE; --side-active: #0A4A42; --side-active-ink: #FFFFFF; --side-line: #0A4A42; --brand: #72C38E;
    --ok-bg: #17362A; --ok-ink: #8FD6A7; --warn-bg: #3A2F14; --warn-ink: #E8CB85; --error-bg: #3D1F16; --error-ink: #F4A98A;
    --btn-bg: #1C302A; --btn-ink: #BFE6CD; --btn-border: #2C4A40; --btn-hover: #243D35;
    --st-pending: #A29E95; --st-pending-bg: #2E2C29; --st-sent: #7A9BE0; --st-sent-bg: #22304A; --st-overdue: #F4A77F; --st-overdue-bg: #45261A; --st-paid: #8FD3B6; --st-paid-bg: #1C3A2F; --st-sponsored: #C9A6EA; --st-sponsored-bg: #35284A; --st-void: #8A877F; --st-void-bg: #262523; --st-paid: #8FD6A7; --st-paid-bg: #17362A; } }
/* Mørkt valgt pr. bruger (version 76) */
html[data-theme="thrane"]:where([data-mode="dark"]) { color-scheme: dark;
    --bg: #0E1614; --surface: #15201D; --ink: #E4EEEA; --muted: #93A7A0; --line: #243330; --line-soft: #1C2926;
    --accent: #72C38E; --accent-ink: #06231E;
    --side: #00312C; --side-ink: #A9C9BE; --side-active: #0A4A42; --side-active-ink: #FFFFFF; --side-line: #0A4A42; --brand: #72C38E;
    --ok-bg: #17362A; --ok-ink: #8FD6A7; --warn-bg: #3A2F14; --warn-ink: #E8CB85; --error-bg: #3D1F16; --error-ink: #F4A98A;
    --btn-bg: #1C302A; --btn-ink: #BFE6CD; --btn-border: #2C4A40; --btn-hover: #243D35;
    --st-pending: #A29E95; --st-pending-bg: #2E2C29; --st-sent: #7A9BE0; --st-sent-bg: #22304A; --st-overdue: #F4A77F; --st-overdue-bg: #45261A; --st-paid: #8FD3B6; --st-paid-bg: #1C3A2F; --st-sponsored: #C9A6EA; --st-sponsored-bg: #35284A; --st-void: #8A877F; --st-void-bg: #262523; --st-paid: #8FD6A7; --st-paid-bg: #17362A; }

html[data-theme="thrane-light"] { color-scheme: light;
    --bg: #F3F5F2; --surface: #FFFFFF; --ink: #14231F; --muted: #5A6763; --line: #DCE3DF; --line-soft: #EAEFEC;
    --accent: #00413A; --accent-ink: #FFFFFF;
    --side: #00413A; --side-ink: #B9D6CC; --side-active: #0B544B; --side-active-ink: #FFFFFF; --side-line: #0B544B; --brand: #72C38E;
    --ok-bg: #DDF0E4; --ok-ink: #1C6B3F; --warn-bg: #FBEBD2; --warn-ink: #7A4A06; --error-bg: #FBE1DA; --error-ink: #A2331A;
    --btn-bg: #E3F2E8; --btn-ink: #00413A; --btn-border: #C4E3CF; --btn-hover: #D3EADB;
    --st-pending: #8A867E; --st-pending-bg: #ECEAE4; --st-sent: #2B55A6; --st-sent-bg: #DCE5F6; --st-overdue: #C2410C; --st-overdue-bg: #FBE3D3; --st-paid: #1F6B55; --st-paid-bg: #D7EDE3; --st-sponsored: #7A4FA0; --st-sponsored-bg: #EDE3F6; --st-void: #8A877F; --st-void-bg: #F1F0EC; --st-paid: #1C6B3F; --st-paid-bg: #DDF0E4; }
html[data-theme="thrane-dark"] { color-scheme: dark;
    --bg: #0E1614; --surface: #15201D; --ink: #E4EEEA; --muted: #93A7A0; --line: #243330; --line-soft: #1C2926;
    --accent: #72C38E; --accent-ink: #06231E;
    --side: #00312C; --side-ink: #A9C9BE; --side-active: #0A4A42; --side-active-ink: #FFFFFF; --side-line: #0A4A42; --brand: #72C38E;
    --ok-bg: #17362A; --ok-ink: #8FD6A7; --warn-bg: #3A2F14; --warn-ink: #E8CB85; --error-bg: #3D1F16; --error-ink: #F4A98A;
    --btn-bg: #1C302A; --btn-ink: #BFE6CD; --btn-border: #2C4A40; --btn-hover: #243D35;
    --st-pending: #A29E95; --st-pending-bg: #2E2C29; --st-sent: #7A9BE0; --st-sent-bg: #22304A; --st-overdue: #F4A77F; --st-overdue-bg: #45261A; --st-paid: #8FD3B6; --st-paid-bg: #1C3A2F; --st-sponsored: #C9A6EA; --st-sponsored-bg: #35284A; --st-void: #8A877F; --st-void-bg: #262523; --st-paid: #8FD6A7; --st-paid-bg: #17362A; }
html[data-theme="nordic"] { color-scheme: light;
    --bg: #F5F7F9; --surface: #FFFFFF; --ink: #17212B; --muted: #5B6875; --line: #DDE3E9; --line-soft: #ECF0F3;
    --accent: #0F6E8C; --accent-ink: #FFFFFF;
    --side: #FFFFFF; --side-ink: #3E4A56; --side-active: #E6F0F4; --side-active-ink: #0C4A61; --side-line: #DDE3E9; --brand: #0C4A61;
    --ok-bg: #DDF1E6; --ok-ink: #1A6B45; --warn-bg: #FCEFD6; --warn-ink: #7A4E07; --error-bg: #FCE3DE; --error-ink: #A0301C;
    --btn-bg: #EEF3F6; --btn-ink: #17313F; --btn-border: #D3DDE4; --btn-hover: #E2EAEF;
    --st-pending: #8A867E; --st-pending-bg: #ECEAE4; --st-sent: #2B55A6; --st-sent-bg: #DCE5F6; --st-overdue: #C2410C; --st-overdue-bg: #FBE3D3; --st-paid: #1F6B55; --st-paid-bg: #D7EDE3; --st-sponsored: #7A4FA0; --st-sponsored-bg: #EDE3F6; --st-void: #8A877F; --st-void-bg: #F1F0EC; --st-sent: #0F6E8C; --st-sent-bg: #E0EEF5; }
html[data-theme="paper"] { color-scheme: light;
    --bg: #F6F1E8; --surface: #FFFCF6; --ink: #221E1A; --muted: #6B625A; --line: #E6DDCF; --line-soft: #EFE8DC;
    --accent: #B6452F; --accent-ink: #FFFFFF;
    --side: #1E2A44; --side-ink: #C4CCDD; --side-active: #2D3C5C; --side-active-ink: #FFFFFF; --side-line: #2D3C5C; --brand: #F2C9B8;
    --ok-bg: #E1EEDC; --ok-ink: #2E6230; --warn-bg: #F8E8C8; --warn-ink: #7A5206; --error-bg: #F6DAD2; --error-ink: #9C3A27;
    --btn-bg: #EFE6D8; --btn-ink: #3B2F25; --btn-border: #DDCFBC; --btn-hover: #E6DAC7;
    --st-pending: #8A867E; --st-pending-bg: #ECEAE4; --st-sent: #2B55A6; --st-sent-bg: #DCE5F6; --st-overdue: #C2410C; --st-overdue-bg: #FBE3D3; --st-paid: #1F6B55; --st-paid-bg: #D7EDE3; --st-sponsored: #7A4FA0; --st-sponsored-bg: #EDE3F6; --st-void: #8A877F; --st-void-bg: #F1F0EC; --st-sent: #1E2A44; --st-sent-bg: #E1E6F1; }
/* Temaer, der altid er lyse, beholder den mørke pil i dropdowns */
html[data-theme="thrane-light"] select, html[data-theme="nordic"] select, html[data-theme="paper"] select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235E5B55' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
html[data-theme="thrane-dark"] select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23A29E95' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.theme-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.theme-option { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 2px solid var(--line); border-radius: 12px; cursor: pointer; font-weight: 500; }
.theme-option:has(input:checked) { border-color: var(--accent); }
.theme-option input { position: absolute; opacity: 0; }
.theme-option:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-swatch { display: flex; height: 56px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.theme-swatch span { flex: 1; }
.theme-swatch span:first-child { flex: 0 0 34%; }
/* Farveprøver: menu, baggrund, flade, accent */
.sw-standard span:nth-child(1) { background: #1C1B19; } .sw-standard span:nth-child(2) { background: #F4F3EF; } .sw-standard span:nth-child(3) { background: #161614; } .sw-standard span:nth-child(4) { background: #2B55A6; }
.sw-thrane span:nth-child(1) { background: #00413A; } .sw-thrane span:nth-child(2) { background: #F3F5F2; } .sw-thrane span:nth-child(3) { background: #0E1614; } .sw-thrane span:nth-child(4) { background: #72C38E; }
.sw-thrane-light span:nth-child(1) { background: #00413A; } .sw-thrane-light span:nth-child(2) { background: #F3F5F2; } .sw-thrane-light span:nth-child(3) { background: #FFFFFF; } .sw-thrane-light span:nth-child(4) { background: #00413A; }
.sw-thrane-dark span:nth-child(1) { background: #00312C; } .sw-thrane-dark span:nth-child(2) { background: #0E1614; } .sw-thrane-dark span:nth-child(3) { background: #15201D; } .sw-thrane-dark span:nth-child(4) { background: #72C38E; }
.sw-nordic span:nth-child(1) { background: #FFFFFF; } .sw-nordic span:nth-child(2) { background: #F5F7F9; } .sw-nordic span:nth-child(3) { background: #E6F0F4; } .sw-nordic span:nth-child(4) { background: #0F6E8C; }
.sw-paper span:nth-child(1) { background: #1E2A44; } .sw-paper span:nth-child(2) { background: #F6F1E8; } .sw-paper span:nth-child(3) { background: #FFFCF6; } .sw-paper span:nth-child(4) { background: #B6452F; }

/* Noter */
.sidebar-note { margin-top: auto; font: inherit; font-weight: 600; text-align: left; min-height: 44px; padding: 0 12px; border-radius: 8px; border: 1px dashed var(--side-line, #3A3834); background: transparent; color: var(--side-ink); cursor: pointer; }
.sidebar-note:hover { background: var(--side-active); color: var(--side-active-ink, #FFFFFF); }
.sidebar-note + .sidebar-foot { margin-top: 0; }
.quick-dates { display: flex; gap: 6px; flex-wrap: wrap; }
kbd { font-family: var(--mono); font-size: 12px; padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); }
.note-list { list-style: none; margin: 0; padding: 0; }
.note-list > li { padding: 12px 0; border-top: 1px solid var(--line-soft); display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; }
.note-list > li > .note-edit { flex: 1 1 100%; margin-top: -6px; }   /* Ret under noten i fuld bredde (version 76) */
.note-list > li > .note-edit[open] { margin-top: 0; }
.note-edit .stack { max-width: 640px; }
.note-list > li:first-child { border-top: 0; }
.note-list .note-body { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.note-list .note-meta { display: block; margin-top: 4px; }
.note-list li.is-done .note-body { color: var(--muted); }
.note-actions { display: flex; gap: 6px; flex-shrink: 0; align-items: center; }
.head-actions form { display: inline-flex; margin: 0; }


/* ======================================================================
   Version 24
   ====================================================================== */

/* Ens afstand mellem alle bokse */
.panel + .panel, .panel + form, form + .panel, .panel + section, section + .panel { margin-top: var(--gap); }
.col-main > * + *, .col-side > * + * { margin-top: var(--gap); }
.col-main > [hidden] + *, .col-side > [hidden] + * { margin-top: var(--gap); }
.columns > .col-main > :first-child, .columns > .col-side > :first-child { margin-top: 0; }
.stats { gap: var(--gap); margin-bottom: var(--gap); }
.dash-grid { gap: var(--gap); margin-bottom: var(--gap); }
.danger-zone { margin-top: var(--gap); }
.main > .notice { margin-bottom: var(--gap); }
.columns.section-gap { margin-top: var(--gap); }
@media (max-width: 1280px) { .columns { grid-template-columns: minmax(0, 1fr) 320px; } }
@media (max-width: 1100px) { .columns { grid-template-columns: minmax(0, 1fr); } }

/* Ankre lander under den faste top */
:root { --head-h: 0px; }
[id] { scroll-margin-top: calc(var(--head-h) + 16px); }
.notice-inline { margin: 4px 0 14px; }

/* Menuen: navn som initialer/billede, tandhjul og log ud */
.sidebar-foot { gap: 8px; padding: 12px 4px 0; }
.sidebar-foot form { margin: 0; display: inline-flex; }
.sidebar-foot-actions { display: inline-flex; gap: 4px; align-items: center; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; overflow: hidden; flex: 0 0 auto; background: var(--side-active); color: var(--side-active-ink, #FFFFFF); font: 600 13px/1 var(--font); letter-spacing: 0.5px; text-decoration: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
a.avatar:hover { box-shadow: 0 0 0 2px var(--side-ink); }
.avatar-large { width: 64px; height: 64px; font-size: 20px; background: var(--btn-bg); color: var(--btn-ink); }
.avatar-edit { display: flex; gap: 16px; align-items: center; }
.sidebar-icon { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; min-height: 0; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--side-ink); cursor: pointer; }
.sidebar .sidebar-icon { min-height: 0; padding: 0; }
.sidebar-icon svg { width: 19px; height: 19px; }
.sidebar-icon:hover, .sidebar-icon[aria-current="page"] { background: var(--side-active); color: var(--side-active-ink, #FFFFFF); }
.sidebar-note { margin-top: auto; }
@media (max-width: 760px) { .sidebar-foot { justify-content: space-between; } }

/* Indstillinger: faner og to kolonner */
.settings-grid { column-count: 2; column-gap: var(--gap); }
.settings-grid > * { break-inside: avoid; margin: 0 0 var(--gap); display: block; width: 100%; }
.settings-grid > .panel + .panel { margin-top: 0; }
@media (max-width: 1100px) { .settings-grid { column-count: 1; } }
.settings-tabs { margin-bottom: var(--gap); }
.shortcut-list dt { white-space: nowrap; }

/* Blyant ved overskrifter */
.edit-icon { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; margin-left: 8px; border-radius: 8px; color: var(--muted); vertical-align: middle; text-decoration: none; }
.edit-icon svg { width: 16px; height: 16px; }
.edit-icon:hover, .edit-icon:focus-visible { background: var(--btn-bg); color: var(--btn-ink); }

/* Hostes hos Thrane.nu */
:root { --own-bg: #DDEFE3; --own-ink: #00413A; }
@media (prefers-color-scheme: dark) { :root:not(:where([data-mode="light"])) { --own-bg: #0F3A33; --own-ink: #8FD6A7; } }
/* Mørkt valgt pr. bruger (version 76) */
:root:where([data-mode="dark"]) { --own-bg: #0F3A33; --own-ink: #8FD6A7; }

html[data-theme="thrane-light"], html[data-theme="nordic"], html[data-theme="paper"] { --own-bg: #DDEFE3; --own-ink: #00413A; }
html[data-theme="thrane-dark"], html[data-theme="slate"], html[data-theme="moss"], html[data-theme="fjord"] { --own-bg: #0F3A33; --own-ink: #8FD6A7; }
.badge-own { background: var(--own-bg); color: var(--own-ink); }
.badge-dns-accepted { background: var(--line-soft); color: var(--muted); }

/* DNS-advarsel med "Det er i orden" */
.dns-warning { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 12px; }
.dns-warning p { margin: 0; }
.dns-accepted { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; margin-bottom: 10px; }
.dns-accepted p { margin: 0; }
.action-list li form { margin: 0; }

/* Dashboard: faste kolonner i "Kræver handling" og "Opfølgning" */
.action-table li { display: grid; grid-template-columns: 104px minmax(0, 1fr) 118px 64px; gap: 12px; align-items: center; }
.action-table .status-pill { justify-self: start; text-align: center; min-width: 76px; }
.action-table .num { text-align: right; }
.action-follow li { display: grid; grid-template-columns: 104px minmax(0, 1fr) 72px; gap: 12px; align-items: center; }
.action-follow li > .badge:first-child { justify-self: start; text-align: center; min-width: 76px; }
.action-follow li > form, .action-table li > button { justify-self: end; }
@media (max-width: 560px) {
    .action-table li { grid-template-columns: minmax(0, 1fr) auto; }
    .action-table .status-pill { grid-column: 1 / -1; }
    .action-follow li { grid-template-columns: minmax(0, 1fr) auto; }
    .action-follow li > .badge:first-child { grid-column: 1 / -1; }
}

/* Mails: én stjerne, emne afkortet og dato på samme linje */
.mail-top { flex-wrap: nowrap; min-width: 0; }
.mail-subject { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-top .badge, .mail-clip { flex: 0 0 auto; }
.mail-top .mail-date { margin-left: auto; padding-left: 8px; }
.mail-note { overflow-wrap: anywhere; }
.mail-item .mail-mark { margin-top: 10px; }

/* Datovælger lagt oven på alt */
.datepick-pop { max-width: calc(100vw - 16px); }

/* Dropdown med søgning */
.combo { position: relative; display: block; width: 100%; }
.combo-input { width: 100%; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23918D85' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; background-size: 12px 8px; text-overflow: ellipsis; }
.combo-input.input-small { min-height: 36px; padding-left: 10px; padding-right: 30px; background-position: right 10px center; min-width: 170px; }
.combo-input.is-missing { border-color: var(--warn-ink); }
.combo-input.is-invalid { border-color: var(--error-ink); }
.combo-native { position: absolute; left: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.combo-list { position: fixed; z-index: 1000; list-style: none; margin: 0; padding: 4px; max-width: min(560px, calc(100vw - 16px)); overflow-y: auto; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px -16px rgba(0, 0, 0, 0.5); font-size: 14px; font-weight: 400; }
.combo-group { padding: 8px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; color: var(--muted); }
.combo-option { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.combo-option.is-empty { color: var(--muted); }
.combo-option.is-active, .combo-option:hover { background: var(--btn-bg); color: var(--btn-ink); }
.combo-option[aria-selected="true"] { font-weight: 600; }
.combo-hint { color: var(--muted); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.combo-option.is-active .combo-hint { color: inherit; opacity: 0.8; }
.combo-none { padding: 10px; color: var(--muted); }
.lines-table .combo { min-width: 190px; }

/* Tekst med formatering */
.rich-editor { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; font-weight: 400; }
.rich-editor:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.rich-bar { display: flex; gap: 2px; padding: 4px; border-bottom: 1px solid var(--line-soft); background: var(--bg); }
.rich-btn { min-width: 32px; height: 30px; padding: 0 8px; border: 0; border-radius: 6px; background: transparent; color: var(--ink); font: 14px var(--font); cursor: pointer; }
.rich-btn:hover { background: var(--btn-bg); color: var(--btn-ink); }
.rich-area { padding: 10px 14px; outline: none; font-size: 15px; line-height: 1.55; overflow-wrap: anywhere; }
.rich-area.is-empty::before { content: attr(data-placeholder); color: var(--muted); pointer-events: none; }
.rich-area.is-invalid { box-shadow: inset 0 0 0 2px var(--error-ink); }
.rich-area p, .rich-text p { margin: 0 0 6px; }
.rich-area ul, .rich-area ol, .rich-text ul, .rich-text ol { margin: 4px 0 8px; padding-left: 22px; }
.rich-text > :last-child { margin-bottom: 0; }
.note-edit { margin-top: 6px; }
.note-edit[open] { margin-top: 10px; }

/* Leverandører */
.row-actions .icon-link { margin-left: 2px; }

/* ---------- Nye farvetemaer: medium mørke ---------- */
html[data-theme="slate"] { color-scheme: dark;
    --bg: #2B3238; --surface: #353D44; --ink: #E8ECEF; --muted: #A9B3BB; --line: #46505A; --line-soft: #3D464E;
    --accent: #6CC08B; --accent-ink: #10231A;
    --side: #22282D; --side-ink: #BCC6CE; --side-active: #353D44; --side-active-ink: #FFFFFF; --side-line: #3A434B; --brand: #6CC08B;
    --ok-bg: #28453A; --ok-ink: #9DDDB6; --warn-bg: #4A4128; --warn-ink: #EBD08F; --error-bg: #4E332C; --error-ink: #F4B29A;
    --btn-bg: #3F4850; --btn-ink: #E3EAEF; --btn-border: #535E68; --btn-hover: #48525B;
    --st-pending: #AEB6BD; --st-pending-bg: #3C444B; --st-sent: #8DB0EC; --st-sent-bg: #34425A; --st-overdue: #F4AE88; --st-overdue-bg: #553A2F;
    --st-paid: #8FD6A7; --st-paid-bg: #2C4A3C; --st-sponsored: #CFB0EE; --st-sponsored-bg: #45395A; --st-void: #98A0A7; --st-void-bg: #353C42; }
html[data-theme="moss"] { color-scheme: dark;
    --bg: #2E3A33; --surface: #37453C; --ink: #E7EEE9; --muted: #A8B8AD; --line: #4A5B50; --line-soft: #405047;
    --accent: #8FD19E; --accent-ink: #13261A;
    --side: #243029; --side-ink: #BACBBF; --side-active: #37453C; --side-active-ink: #FFFFFF; --side-line: #3C4A41; --brand: #8FD19E;
    --ok-bg: #2F4E3A; --ok-ink: #A6E2B8; --warn-bg: #4B4429; --warn-ink: #EBD38F; --error-bg: #50362D; --error-ink: #F4B39B;
    --btn-bg: #40503F; --btn-ink: #E4EFE6; --btn-border: #56685A; --btn-hover: #4A5B4B;
    --st-pending: #AFBDB3; --st-pending-bg: #3E4B42; --st-sent: #8FB3EA; --st-sent-bg: #354459; --st-overdue: #F4AE88; --st-overdue-bg: #573C30;
    --st-paid: #A6E2B8; --st-paid-bg: #2F4E3A; --st-sponsored: #D0B2EE; --st-sponsored-bg: #473B58; --st-void: #9AA69E; --st-void-bg: #37433B; }
html[data-theme="fjord"] { color-scheme: dark;
    --bg: #27313F; --surface: #313C4C; --ink: #E6ECF3; --muted: #A5B2C3; --line: #435163; --line-soft: #3A4757;
    --accent: #7FB7E6; --accent-ink: #0F2233;
    --side: #1F2833; --side-ink: #B8C6D6; --side-active: #313C4C; --side-active-ink: #FFFFFF; --side-line: #384556; --brand: #7FB7E6;
    --ok-bg: #2A4A42; --ok-ink: #9FDDC2; --warn-bg: #4A4229; --warn-ink: #EBD08F; --error-bg: #4F3432; --error-ink: #F4B2A0;
    --btn-bg: #3B4859; --btn-ink: #E1EAF4; --btn-border: #506076; --btn-hover: #445266;
    --st-pending: #AAB6C4; --st-pending-bg: #3A4555; --st-sent: #8FBEF0; --st-sent-bg: #34486A; --st-overdue: #F4AE88; --st-overdue-bg: #553B31;
    --st-paid: #9FDDC2; --st-paid-bg: #2A4A42; --st-sponsored: #CDB0EE; --st-sponsored-bg: #44395C; --st-void: #9AA5B1; --st-void-bg: #333E4C; }
html[data-theme="slate"] select, html[data-theme="moss"] select, html[data-theme="fjord"] select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23A9B3BB' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.sw-slate span:nth-child(1) { background: #22282D; } .sw-slate span:nth-child(2) { background: #2B3238; } .sw-slate span:nth-child(3) { background: #353D44; } .sw-slate span:nth-child(4) { background: #6CC08B; }
.sw-moss span:nth-child(1) { background: #243029; } .sw-moss span:nth-child(2) { background: #2E3A33; } .sw-moss span:nth-child(3) { background: #37453C; } .sw-moss span:nth-child(4) { background: #8FD19E; }
.sw-fjord span:nth-child(1) { background: #1F2833; } .sw-fjord span:nth-child(2) { background: #27313F; } .sw-fjord span:nth-child(3) { background: #313C4C; } .sw-fjord span:nth-child(4) { background: #7FB7E6; }
.action-table .status-pill, .action-follow li > .badge:first-child { white-space: nowrap; }
.mg-month { gap: 4px; }
.shortcut-list { margin-bottom: 12px; }

/* ======================================================================
   Version 26
   ====================================================================== */

/* Avatar: kvadratisk, hele billedet vises */
.avatar { border-radius: 8px; }
.avatar img { object-fit: contain; }
.avatar:has(img) { background: transparent; }

/* Tooltips i temaets farver, med titlen større */
.tooltip { background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: 0 12px 32px -12px rgba(0, 0, 0, 0.55); padding: 10px 14px; }
.tooltip-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.tooltip div + div { color: var(--muted); }
.tooltip div:nth-child(2) { color: var(--ink); }
.rich-btn { display: inline-flex; align-items: center; justify-content: center; }
.rich-btn svg { display: block; }

/* Underpunkter i menuen: vises ved hover eller fokus */
.sidebar [data-menu] > li { position: relative; }
.sidebar .submenu { display: none; position: fixed; left: 216px; z-index: 200; margin: 0; padding: 0 0 0 12px; list-style: none; }
.submenu::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 12px; }
.sidebar .submenu { flex-direction: column; gap: 0; }
.submenu > li { background: var(--side); }
.submenu > li:first-child { border-radius: 10px 10px 0 0; padding-top: 6px; }
.submenu > li:last-child { border-radius: 0 0 10px 10px; padding-bottom: 6px; }
.submenu > li:only-child { border-radius: 10px; }
.submenu > li { padding: 0 6px; }
.sidebar .submenu a { min-height: 38px; white-space: nowrap; font-size: 14px; padding: 0 14px; }
.sidebar [data-menu] > li.has-sub:hover > .submenu, .sidebar [data-menu] > li.has-sub:focus-within > .submenu { display: flex; }
.sidebar [data-menu] > li.has-sub > a::after { content: "›"; margin-left: auto; opacity: 0.45; font-size: 16px; }
@media (max-width: 760px), (hover: none) { .submenu { display: none !important; } .sidebar [data-menu] > li.has-sub > a::after { content: none; } }

/* Menuens rækkefølge med underpunkter */
.type-list li.menu-order-item { flex-direction: column; align-items: stretch; gap: 4px; }
.menu-order-row { display: flex; align-items: center; gap: 12px; }
.sub-list { margin: 0 0 4px 30px; }
.sub-list li { padding: 4px 0; font-size: 14px; }

/* Markering af mails: tydeligere */
.mail-note { display: inline-flex; align-items: center; gap: 6px; background: color-mix(in srgb, #e0a93b 24%, var(--surface)); border-left: 3px solid #e0a93b; border-radius: 4px 8px 8px 4px; padding: 3px 10px; font-weight: 500; color: var(--ink); }
.mail-note::before { content: "⚑"; color: #e0a93b; }
.mail-item:has(.mail-mark.is-on) .mail-row { background: color-mix(in srgb, #e0a93b 7%, transparent); }
.edit-icon.is-save { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.lines-panel { margin-top: var(--gap); }
.lines-panel .table-wrap { margin: 0 -8px; }
.lines-table { min-width: 900px; }
.check-col { width: 36px; }
.check-col input { width: 18px; height: 18px; accent-color: var(--accent); }
.notice-email { width: 100%; min-width: 220px; }
.bulk-bar .help-icon { margin-left: 0; }
.lines-table td:nth-child(4) { width: 38%; }
.lines-table td:nth-child(4) input { width: 100%; }
.lines-table td:nth-child(3) input { width: 100%; }

/* Databehandleraftaler online */
.doc-online { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin: 0 0 6px; }
.doc-online p { margin: 0; flex: 1 1 200px; }
.doc-online form { margin: 0; }
.receipt .facts { margin-top: 12px; }
.receipt .wrap { word-break: break-all; }
@media print {
    .no-print { display: none !important; }
    body.print-page { background: #fff; }
    .print-page .public-card { box-shadow: none; padding: 0; }
}

/* ======================================================================
   Version 28
   ====================================================================== */
/* Menuen (og dens underpunkter) ligger over sidens indhold */
.sidebar { z-index: 60; }
/* Avatar: kvadratisk, og billedet fylder hele boksen */
.avatar { width: 40px; height: 40px; border-radius: 6px; }
.avatar img { object-fit: cover; }
a.avatar:hover { box-shadow: 0 0 0 2px var(--side-ink); }
.avatar-large { width: 72px; height: 72px; border-radius: 10px; }
button.edit-icon { border: 0; background: transparent; cursor: pointer; padding: 0; font: inherit; }
button.edit-icon.is-save { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.bulk-assign { display: inline-flex; gap: 8px; align-items: center; }
.bulk-assign .combo { width: 280px; }

/* ======================================================================
   Version 29
   ====================================================================== */
.type-dpa { white-space: nowrap; margin: 0; }
/* Profil nederst i menuen: rundt billede, altid lige højt og bredt, og navnet ved siden af */
.side-user { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 auto; color: var(--side-ink); text-decoration: none; border-radius: 999px; padding: 2px 8px 2px 2px; }
.side-user:hover { background: var(--side-active); color: var(--side-active-ink, #FFFFFF); }
.side-user .avatar { width: 36px; height: 36px; flex: 0 0 36px; aspect-ratio: 1 / 1; border-radius: 50%; }
.side-user .avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.side-user-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.sidebar-foot-actions { flex: 0 0 auto; }
.avatar-large { border-radius: 50%; aspect-ratio: 1 / 1; }
.avatar-large img { border-radius: 50%; object-fit: cover; }
/* Tooltips: tydelig kant i temafarven og en baggrund, der skiller sig ud fra indholdet bagved */
.tooltip {
    background: color-mix(in srgb, var(--surface) 88%, var(--accent));
    border: 1.5px solid color-mix(in srgb, var(--accent) 70%, var(--ink));
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--bg) 70%, transparent), 0 16px 36px -10px rgba(0, 0, 0, 0.6);
}
.tooltip-title { color: var(--ink); }

/* ---------- Mobil: burgermenu, note fast i bunden, foldede filtre ---------- */
.sidebar-top { display: contents; }
.menu-toggle { display: none; }
.filter-toggle { display: none; }
@media (max-width: 760px) {
    .sidebar { position: sticky; top: 0; padding: 10px 16px; gap: 0; }
    .sidebar-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
    .sidebar-top .brand { padding: 0; }
    .sidebar-top .brand.has-logo img { max-height: 28px; }
    .menu-toggle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--side-ink); cursor: pointer; }
    .menu-toggle svg { width: 24px; height: 24px; }
    .menu-toggle[aria-expanded="true"] { background: var(--side-active); color: var(--side-active-ink, #FFFFFF); }
    .sidebar [data-menu], .sidebar .sidebar-foot { display: none; }
    .sidebar.menu-open { max-height: 100dvh; overflow-y: auto; }
    .sidebar.menu-open [data-menu] { display: flex; flex-direction: column; overflow: visible; padding: 8px 0; gap: 2px; }
    .sidebar.menu-open .sidebar-foot { display: flex; padding: 12px 0 8px; border-top: 1px solid var(--side-line, #3A3834); }
    .sidebar.menu-open [data-menu] .submenu { display: flex !important; position: static; flex-direction: column; box-shadow: none; background: transparent; border: 0; padding: 0 0 4px 16px; margin: 0; min-width: 0; }
    .sidebar.menu-open [data-menu] > li.has-sub { display: flex; flex-direction: column-reverse; }
    .sidebar.menu-open [data-menu] .submenu a { min-height: 38px; font-size: 14px; opacity: 0.85; }
    /* + Note ligger fast i bunden af skærmen */
    .sidebar-note { position: fixed; left: 16px; right: 16px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 70; margin: 0; text-align: center; border-style: solid; background: var(--side); color: var(--side-ink); box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.6); }
    .main { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
    /* Knapper i toppen af siden brydes på flere linjer i stedet for at rulle sidelæns */
    .head-actions { flex-wrap: wrap; overflow: visible; }
    .page-head { position: static; }
    /* Filtre foldes sammen bag én knap */
    .filter-toggle { display: inline-flex; }
    [data-filters]:not(.filters-open) > select, [data-filters]:not(.filters-open) > .combo, [data-filters]:not(.filters-open) > label:not(.filter-search) { display: none; }
    .bulk-bar { flex-wrap: wrap; }
    .bulk-assign { flex-wrap: wrap; width: 100%; }
    .bulk-assign .combo { width: 100%; flex: 1 1 200px; }
}
@media (max-width: 760px) {
    body.is-scrolled .page-head { border-bottom-color: transparent; box-shadow: none; }
}
th.center, td.center { text-align: center; }
@media (max-width: 760px) {
    .sidebar.menu-open [data-menu] > li.has-sub:not(.sub-open) .submenu { display: none !important; }
    .sidebar.menu-open ~ .main .sidebar-note, .sidebar.menu-open .sidebar-note { display: none; }
}
.side-user-name { white-space: normal; line-height: 1.15; font-size: 13px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sidebar-foot-actions { gap: 0; }
#dokumenttyper input[type="text"] { min-width: 150px; }
.side-user-name { overflow-wrap: normal; word-break: normal; }
.side-user { gap: 8px; padding-right: 4px; }
.sidebar-foot .sidebar-icon { width: 30px; }
.sidebar .side-user { padding: 2px 4px 2px 2px; min-height: 0; gap: 8px; }

.sub-toggle { display: none; }
@media (max-width: 760px) {
    .sidebar.menu-open [data-menu] > li.has-sub { display: grid; grid-template-columns: minmax(0, 1fr) 44px; }
    .sidebar.menu-open [data-menu] > li.has-sub > a { grid-column: 1; grid-row: 1; }
    .sidebar.menu-open [data-menu] > li.has-sub > .sub-toggle { grid-column: 2; grid-row: 1; }
    .sidebar.menu-open [data-menu] > li.has-sub > .submenu { grid-column: 1 / -1; grid-row: 2; }
    .sub-toggle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; border-radius: 8px; background: transparent; color: var(--side-ink); cursor: pointer; }
    .sub-toggle svg { width: 18px; height: 18px; transition: transform 0.15s; }
    .sub-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
}

/* ======================================================================
   Version 30
   ====================================================================== */
.email-fields { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.email-fields .label-text { font-weight: 500; font-size: 14px; }
.email-row { display: flex; gap: 6px; align-items: center; }
.email-row input { flex: 1 1 auto; min-width: 0; }
.email-row [data-email-remove] { flex: 0 0 auto; font-size: 18px; }
.email-fields [data-email-add] { align-self: flex-start; }
/* Filtre med mange valg bruger systemets liste: samme bredde som en almindelig rulleliste */
.filters > .combo { width: auto; flex: 0 1 220px; min-width: 170px; }
.filters .combo-input { min-height: 44px; }
.note-icon { display: inline-flex; align-items: center; gap: 2px; vertical-align: middle; margin-left: 6px; padding: 2px 4px; border: 0; border-radius: 6px; background: transparent; color: var(--accent); cursor: pointer; }
.note-icon:hover { background: var(--btn-bg); }
.note-icon svg { width: 16px; height: 16px; }
.note-icon-count { font-size: 11px; font-weight: 600; }
.note-read li { display: block; }
#agreement-notes-dialog h3 { margin: 16px 0 6px; text-transform: uppercase; letter-spacing: 0.4px; font-size: 12px; }
.choice-row { border: 0; padding: 0; margin: 0 0 12px; display: flex; gap: 8px 20px; flex-wrap: wrap; }
tr[hidden], th[hidden], td[hidden] { display: none; }
/* Markér-bjælken svæver i bunden af skærmen og glider op, når mindst én er markeret. Intet på siden flytter sig. */
.bulk-bar {
    position: fixed; z-index: 80; bottom: calc(20px + env(safe-area-inset-bottom));
    left: calc(232px + (100vw - 232px) / 2); transform: translate(-50%, 0);
    width: max-content; max-width: calc(100vw - 232px - 48px);
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin: 0;
    padding: 10px 14px; border-radius: 14px;
    background: color-mix(in srgb, var(--surface) 92%, var(--accent)); color: var(--ink);
    border: 1.5px solid color-mix(in srgb, var(--accent) 60%, var(--line));
    box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.55);
    transition: transform 0.18s ease, opacity 0.18s ease, visibility 0.18s;
}
.bulk-bar:not(.has-selection) { transform: translate(-50%, calc(100% + 40px)); opacity: 0; visibility: hidden; pointer-events: none; }
.bulk-bar [data-bulk-count] { font-weight: 600; color: var(--ink); }
@media (max-width: 760px) {
    .bulk-bar { left: 16px; right: 16px; width: auto; max-width: none; transform: none; bottom: calc(12px + env(safe-area-inset-bottom)); }
    .bulk-bar:not(.has-selection) { transform: translateY(calc(100% + 40px)); }
    body:has(.bulk-bar.has-selection) .sidebar-note { visibility: hidden; }
}
@media (prefers-reduced-motion: reduce) { .bulk-bar { transition: none; } }
@media (max-width: 760px) {
    /* v49.1: pile i rullelister og fold-ud større på telefonen */
    select, .combo-input { background-size: 16px 11px; }
    .log-details > summary::after { width: 10px; height: 10px; border-width: 0 2.5px 2.5px 0; }
    /* v49.1: med genveje dækker knappen + Note-bjælken, så den skjules (Ny note kan lægges i genvejene) */
    body:has(.quick) .sidebar-note { display: none; }
    body:has(.quick) .main { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
}
.domain-project { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); text-decoration: none; }
.domain-project:hover { color: var(--accent); text-decoration: underline; }
/* v49: med genveje står bjælken over genvejsknappen (18px + 52px + luft), så intet ligger oven på hinanden */
body:has(.quick) .bulk-bar { bottom: calc(84px + env(safe-area-inset-bottom)); }
body:has(.quick) .bulk-bar:not(.has-selection) { transform: translate(-50%, calc(100% + 120px)); }
@media (max-width: 760px) { body:has(.quick) .bulk-bar:not(.has-selection) { transform: translateY(calc(100% + 120px)); } }
/* Uden beregning: neutral, stiplet */
:root { --st-free: #5E6A66; --st-free-bg: #E8ECEA; }
@media (prefers-color-scheme: dark) { :root:not(:where([data-mode="light"])) { --st-free: #A9B6B1; --st-free-bg: #253230; } }
/* Mørkt valgt pr. bruger (version 76) */
:root:where([data-mode="dark"]) { --st-free: #A9B6B1; --st-free-bg: #253230; }

.status-pill.status-free, .badge-free { background: var(--st-free-bg); color: var(--st-free); }
.mg-bar.status-free, .legend-swatch.status-free { background: var(--st-free-bg); border-color: var(--st-free); border-style: dashed; color: var(--st-free); }
.invoice-box.status-free { border-left-color: var(--st-free); }
/* Faneblade til valg i formularer (fx fast rabat / rabattrappe) – samme udtryk som .tabs */
.tab-choice { display: flex; gap: 4px; border: 0; border-bottom: 1px solid var(--line); padding: 0; margin: 0 0 12px; }
.tab-choice label { flex-direction: row; padding: 10px 14px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; }
.tab-choice label:hover { color: var(--ink); }
.tab-choice label:has(input:checked) { color: var(--ink); border-bottom-color: var(--accent); }
.tab-choice label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.tab-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
@media (max-width: 760px) {
    /* Burgermenu: større punkter, hovedpunkter med fed, undermenuer uden boks og skygge */
    .sidebar.menu-open [data-menu] > li > a { min-height: 52px; font-size: 17px; font-weight: 700; }
    .sidebar.menu-open [data-menu] .submenu { box-shadow: none !important; background: transparent !important; border: 0 !important; backdrop-filter: none !important; }
    .sidebar.menu-open [data-menu] .submenu li, .sidebar.menu-open [data-menu] .submenu a { background: transparent; box-shadow: none; }
    .sidebar.menu-open [data-menu] .submenu a { min-height: 46px; font-size: 16px; font-weight: 500; opacity: 1; }
    .sidebar.menu-open [data-menu] .submenu a[aria-current="page"], .sidebar.menu-open [data-menu] .submenu a:hover { background: var(--side-active); }
    .sidebar.menu-open .sub-toggle { width: 52px; height: 52px; }
    .sidebar.menu-open [data-menu] > li.has-sub { grid-template-columns: minmax(0, 1fr) 52px; }
    .sidebar.menu-open .side-user-name { font-size: 15px; }
}
.note-delete { color: var(--error-ink); }
/* Mails på kunden */
.tabs-small { margin-bottom: 10px; }
.tabs-small .tab { background: transparent; border-top: 0; border-left: 0; border-right: 0; font: inherit; font-weight: 500; cursor: pointer; padding: 8px 12px; }
.tabs-small .tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.mail-item.has-check { display: flex; align-items: flex-start; gap: 8px; }
.mail-item.has-check .mail-row { flex: 1 1 auto; min-width: 0; }
.mail-check { margin-top: 12px; width: 18px; height: 18px; accent-color: var(--accent); flex: 0 0 auto; }
.mail-mute { margin: 6px 0 0; flex: 0 0 auto; }
/* Kundesiden med faneblade */
.customer-tab-bar { position: relative; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; flex-wrap: nowrap; scrollbar-width: none; }
.customer-tab-bar::-webkit-scrollbar { display: none; }
.customer-tab-bar .tab { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.tab-alert { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--st-overdue); margin-left: 2px; }
.tab-panel { display: flex; flex-direction: column; gap: 20px; }
.tab-panel[hidden] { display: none; }
.customer-tab-bar { margin-bottom: 0; }
.tab-panel { gap: var(--gap, 20px); }
.tab-panel > .panel { margin: 0; }
.side-toggle { display: none; }
@media (max-width: 1100px) {
    .customer-tabs .col-side { order: -1; }
}
@media (max-width: 760px) {
    .side-toggle { display: flex; width: 100%; justify-content: space-between; }
    /* v49.1: tegnet pil i stedet for ▾, stor nok at se og ramme på telefonen */
    .side-toggle::after { content: ""; flex: 0 0 auto; width: 11px; height: 11px; margin: 0 6px 6px 12px; border-right: 2.5px solid currentColor; border-bottom: 2.5px solid currentColor; transform: rotate(45deg); transition: transform .15s ease; }
    .side-collapsible:not(.is-collapsed) .side-toggle::after { margin-bottom: -4px; transform: rotate(-135deg); }
    .side-collapsible.is-collapsed > :not(.side-toggle) { display: none; }
}
.tab-choice { flex-direction: row; }
.tab-choice > label { display: inline-flex; flex-direction: row; align-items: center; }
@media (min-width: 761px) { .customer-tab-bar { flex-wrap: wrap; overflow: visible; } }
.customer-tab-bar .tab { padding: 10px 11px; }

/* Version 32: databeskyttelse */
.pre-line { white-space: pre-line; }
form.inline { display: inline; margin: 0; }
.check-row { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; margin-top: 12px; }
.check-row .check { margin: 0; }
textarea.code-area { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.55; tab-size: 4; }
.pdf-look-img { display: block; max-width: 240px; max-height: 70px; margin: 6px 0 10px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.type-dpa-scope { margin: 0; }
.type-dpa-scope select { min-width: 120px; }
.dpa-contact { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.dpa-contact summary { cursor: pointer; font-weight: 600; }
.dpa-contact .grid-2 { margin-top: 10px; }

/* Version 33: testkunder */
.badge-test { background: repeating-linear-gradient(135deg, var(--warn-bg) 0 6px, transparent 6px 12px), var(--line-soft); color: var(--warn-ink); border: 1px dashed currentColor; }
/* Telefonfelt: landevælgeren (søgbar) har fast bredde, nummeret får resten */
.phone-row > .combo { flex: 0 0 190px; width: 190px; }
.phone-row > input[type="tel"] { flex: 1 1 auto; min-width: 120px; }
@media (max-width: 560px) { .phone-row > .combo { flex-basis: 150px; width: 150px; } }
label.check > span { display: inline; }

/* ======================================================================
   Version 34 – manual
   ====================================================================== */
.manual-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: var(--gap, 20px); align-items: start; }
.manual-toc { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; padding: 16px; }
.manual-search input { width: 100%; }
.manual-chapters { list-style: none; margin: 12px 0 0; padding: 0; counter-reset: ch; }
.manual-chapters > li { counter-increment: ch; }
.manual-chapters > li > a { display: block; padding: 6px 8px; border-radius: 8px; text-decoration: none; color: var(--ink); }
.manual-chapters > li > a::before { content: counter(ch) ". "; color: var(--muted); }
.manual-chapters > li > a:hover, .manual-chapters > li > a[aria-current="page"] { background: var(--btn-bg); }
.manual-chapters > li > a[aria-current="page"] { font-weight: 600; }
.manual-sections { list-style: none; margin: 2px 0 8px 18px; padding: 0; font-size: 14px; }
.manual-sections a { display: block; padding: 3px 8px; color: var(--muted); text-decoration: none; border-left: 2px solid var(--line); }
.manual-sections a:hover { color: var(--ink); border-left-color: var(--accent); }
.manual-body { padding: 28px 36px; }
.manual-text { max-width: 72ch; line-height: 1.65; }
.manual-text h2 { margin: 32px 0 10px; font-size: 22px; scroll-margin-top: 16px; }
.manual-text h3 { margin: 22px 0 8px; font-size: 17px; scroll-margin-top: 16px; }
.manual-text h2:first-child { margin-top: 0; }
.manual-anchor { float: left; margin-left: -1.1em; width: 1em; color: var(--muted); text-decoration: none; opacity: 0; }
.manual-text h2:hover .manual-anchor, .manual-text h3:hover .manual-anchor { opacity: 1; }
.manual-text ul, .manual-text ol { padding-left: 1.3em; }
.manual-text li + li { margin-top: 4px; }
.manual-text code { background: var(--btn-bg); padding: 1px 5px; border-radius: 5px; font-size: 0.92em; }
.manual-figure { margin: 18px 0; }
.manual-figure img { max-width: 100%; border: 1px solid var(--line); border-radius: 10px; }
.manual-figure figcaption { font-size: 13px; color: var(--muted); margin-top: 6px; }
.manual-missing { border: 2px dashed var(--line); border-radius: 10px; padding: 26px; text-align: center; color: var(--muted); font-size: 14px; }
.manual-box { border-left: 4px solid var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); border-radius: 8px; padding: 10px 16px; margin: 16px 0; }
.manual-box p { margin: 6px 0; }
.manual-box-tip { border-left-color: var(--st-paid); background: color-mix(in srgb, var(--st-paid) 10%, transparent); }
.manual-box-warn { border-left-color: var(--st-overdue); background: color-mix(in srgb, var(--st-overdue) 10%, transparent); }
.manual-table th, .manual-table td { text-align: left; vertical-align: top; }
.manual-pager { display: flex; justify-content: space-between; gap: 10px; margin-top: 36px; flex-wrap: wrap; }
.manual-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.manual-card { display: flex; flex-direction: column; gap: 6px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); }
.manual-card:hover { border-color: var(--accent); }
.manual-results { padding-left: 1.2em; }
.manual-results li { margin-bottom: 14px; }
.manual-results p { margin: 4px 0 0; }
@media (max-width: 900px) {
    .manual-layout { grid-template-columns: minmax(0, 1fr); }
    .manual-toc { position: static; max-height: none; }
    .manual-body { padding: 20px; }
}
/* Udskrift */
.manual-print { background: #fff; color: #111; padding: 32px; max-width: 820px; margin: 0 auto; }
.manual-print .manual-text { max-width: none; }
.manual-print-bar { display: flex; gap: 10px; margin-bottom: 24px; }
.manual-print-head { border-bottom: 1px solid #ddd; margin-bottom: 24px; }
.manual-chapter + .manual-chapter { break-before: page; }
@media print {
    .manual-print { padding: 0; }
    .manual-anchor { display: none; }
    .manual-figure img { break-inside: avoid; }
    .manual-text a { color: inherit; text-decoration: none; }
}
#help-dialog .actions { justify-content: space-between; }
/* Menuens fod: profil på første linje, ikoner (manual, indstillinger, log ud) på linjen under */
@media (min-width: 761px) {
    .sidebar-foot { flex-wrap: wrap; row-gap: 6px; }
    .sidebar-foot .side-user { flex: 1 1 100%; }
    .sidebar-foot-actions { flex: 1 1 100%; justify-content: flex-start; gap: 4px; padding-left: 40px; }
    .side-user-name { -webkit-line-clamp: 1; white-space: nowrap; }
}
/* DBA-status på kunden */
.dpa-status { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; color: var(--muted); }
.dpa-status-current { color: var(--st-paid); }
.dpa-rule { margin-left: auto; font-size: 13px; white-space: nowrap; }
#dpa-mode:target, label:has(> #dpa-mode) { scroll-margin-top: 90px; }
/* Dokumenter som kort med miniaturer */
.doc-group-title { font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); margin: 18px 0 8px; }
.doc-card { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 14px; padding: 14px 0; border-top: 1px solid var(--line-soft); }
.doc-thumb { width: 88px; aspect-ratio: 1 / 1.414; border: 1px solid var(--line); border-radius: 6px; background: var(--btn-bg); padding: 0; overflow: hidden; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.doc-thumb canvas, .doc-thumb img, .file-thumb canvas, .file-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; background: #fff; }
.doc-thumb:hover, .file-thumb:hover { border-color: var(--accent); }
.doc-thumb-empty { cursor: default; }
.doc-thumb-ph { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: 0.5px; }
.doc-card-body { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.doc-card .doc-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.doc-card .doc-head .badge { margin-left: auto; }
.doc-card p { margin: 0; }
.doc-file-thumbs { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.doc-file-thumbs li { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; width: 64px; }
.file-thumb { width: 64px; aspect-ratio: 1 / 1.414; border: 1px solid var(--line); border-radius: 5px; background: var(--btn-bg); padding: 0; overflow: hidden; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.file-thumb-label { color: var(--muted); line-height: 1.2; font-size: 11px; }
.doc-menu { position: relative; }
.doc-menu > summary { list-style: none; cursor: pointer; padding: 0 8px; border-radius: 6px; font-weight: 700; line-height: 26px; color: var(--muted); }
.doc-menu > summary::-webkit-details-marker { display: none; }
.doc-menu > summary:hover, .doc-menu[open] > summary { background: var(--btn-bg); color: var(--ink); }
.doc-menu-list { position: absolute; right: 0; top: 30px; z-index: 30; min-width: 220px; width: max-content; max-width: min(360px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 2px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 16px 36px -12px rgba(0, 0, 0, 0.5); }
.doc-menu-list > a, .doc-menu-list > button { text-align: left; padding: 8px 10px; border-radius: 6px; border: 0; background: transparent; font: inherit; color: var(--ink); text-decoration: none; cursor: pointer; white-space: nowrap; }
.doc-menu-list > a:hover, .doc-menu-list > button:hover { background: var(--btn-bg); }
.doc-menu-list .danger { color: var(--error-ink); }
.doc-menu-list form { margin: 4px; }
.file-menu { position: absolute; top: 2px; right: -6px; }
.file-menu > summary { background: var(--surface); line-height: 20px; padding: 0 5px; font-size: 12px; }
.file-menu .doc-menu-list { left: 0; right: auto; }
.doc-edit { margin-top: 4px; }
@media (max-width: 560px) { .doc-card { grid-template-columns: 64px minmax(0, 1fr); } .doc-thumb { width: 64px; } }
.doc-thumb img, .file-thumb img { object-fit: contain; object-position: center; }
/* Kræver opmærksomhed */
.attention-box { border: 1.5px solid var(--st-overdue); background: color-mix(in srgb, var(--st-overdue) 10%, var(--surface)); border-radius: 14px; padding: 14px 18px; }
.attention-box.attention-wait { border-color: var(--line); background: var(--surface); }
.attention-title { font-size: 14px; margin: 0 0 8px; color: var(--st-overdue); text-transform: uppercase; letter-spacing: 0.5px; }
.attention-wait .attention-title { color: var(--muted); }
.attention-box ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.attention-box li { display: flex; align-items: center; gap: 12px; justify-content: space-between; flex-wrap: wrap; }
.attention-box li form { margin: 0; }
.tab-alert-wait { background: var(--muted); opacity: 0.7; }
.needs-attention.needs-act { box-shadow: inset 3px 0 0 var(--st-overdue); padding-left: 12px; border-radius: 6px; }
.needs-attention.needs-wait { box-shadow: inset 3px 0 0 var(--line); padding-left: 12px; }
/* Historik med detaljer */
.log-details { display: inline; }
.log-details > summary { cursor: pointer; display: inline; list-style: none; color: var(--accent); }
.log-details > summary::-webkit-details-marker { display: none; }
.log-details > summary::after { content: ""; display: inline-block; width: 7px; height: 7px; margin: 0 4px 2px 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s ease; vertical-align: middle; }
.log-details[open] > summary::after { transform: rotate(45deg); margin-bottom: 5px; }
.log-details[open] > summary { font-weight: 600; }
.log-changes { margin: 6px 0 4px; font-size: 13px; border-collapse: collapse; }
.log-changes th { text-align: left; color: var(--muted); font-weight: 500; padding: 2px 12px 2px 0; vertical-align: top; white-space: nowrap; }
.log-changes td { padding: 2px 0; }
.log-from { color: var(--muted); text-decoration: line-through; }
.log-to { font-weight: 500; }

/* v34: GDPR – kunder uden aktive aftaler */
#opbevaring .inline-form { margin-top: 0; gap: 6px; align-items: center; flex-wrap: nowrap; }
#opbevaring td .inline-form { justify-content: flex-end; }
.retention-setting label { display: flex; align-items: center; gap: 6px; margin: 0; }
.retention-setting input[type=number] { width: 70px; }
@media (max-width: 700px) { #opbevaring td .inline-form { flex-wrap: wrap; justify-content: flex-start; } }
.badge-reg-free, .badge-reg-expired { background: var(--error-bg); color: var(--error-ink); text-decoration: none; }
.badge-reg-expiring { background: var(--warn-bg, #fff4d6); color: var(--warn-ink, #7a5a00); text-decoration: none; }

/* v34: signatur-editor */
.sig-toolbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sig-toolbar .btn { min-width: 34px; }
.sig-color { margin: 0; padding: 0 9px; min-width: 34px; }
.sig-color input[type=color] { width: 20px; height: 20px; padding: 0; border: 0; border-radius: 4px; background: none; cursor: pointer; -webkit-appearance: none; appearance: none; }
.sig-color input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.sig-color input[type=color]::-webkit-color-swatch { border: 1px solid rgba(0,0,0,.25); border-radius: 4px; }
.sig-color input[type=color]::-moz-color-swatch { border: 1px solid rgba(0,0,0,.25); border-radius: 4px; }
.sig-editor { white-space: normal; min-height: 220px; resize: vertical; overflow: auto; border: 1px solid var(--line); background: #fff; color: #222; font-family: -apple-system, Helvetica, Arial, sans-serif; line-height: 1.45; outline: none; margin: 0; }
.sig-editor:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus, rgba(31,111,92,.2)); }
.sig-editor p { margin: 0 0 8px; }
.sig-editor a { color: var(--sig-link, #1a5fb4); text-decoration: underline; }
.sig-editor.sig-no-underline a { text-decoration: none; }
.sig-editor img { max-width: 100%; height: auto; }

/* v34: ikoner i menuen */
.sidebar a.has-icon { display: flex; align-items: center; gap: 10px; }
.menu-icon { width: 16px; height: 16px; flex-shrink: 0; opacity: .85; }
.icon-field { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; }
.icon-preview { width: 28px; height: 28px; margin-top: 30px; display: grid; place-items: center; color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); }
.icon-preview .menu-icon { width: 16px; height: 16px; }
.svg-input { width: 100%; max-width: none; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; letter-spacing: 0; text-align: left; line-height: 1.4; min-height: 44px; height: 52px; resize: vertical; }
.icon-field label { display: block; width: 100%; }
.log-pager { flex-wrap: wrap; gap: 10px; }
.log-per { display: inline-flex; gap: 8px; align-items: center; margin-left: auto; }
.type-description { background: var(--bg); border-left: 3px solid var(--accent); border-radius: var(--radius); padding: 10px 14px; margin: 0 0 14px; }
.type-description p { margin: 4px 0 0; }
dialog .type-description { margin: 10px 0; }
/* v34: Send tilbud med mere luft */
.send-form { display: flex; flex-direction: column; gap: 18px; }
.send-form > label { margin: 0; }
.send-options { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px 14px; margin: 4px 0 0; display: flex; flex-direction: column; gap: 12px; }
.send-options legend { padding: 0 6px; font-weight: 600; font-size: 13px; }
.send-options label.check { margin: 0; }
/* v35: produkttyper i faste kolonner, så intet rykker */
.types-panel { max-width: 1040px; }
.types-panel .type-list > li { display: grid; grid-template-columns: 16px auto 20px minmax(180px, 1fr) 130px 150px 100px 36px; align-items: center; gap: 10px 14px; padding: 12px 0; }
.types-panel .type-list input[type="text"] { width: 100%; min-width: 0; }
.types-panel .type-dpa-scope select { width: 100%; min-width: 0; }
.types-panel .type-count { text-align: right; }
.types-panel .type-delete { justify-self: end; }
@media (max-width: 900px) {
    .types-panel .type-list > li { grid-template-columns: 16px auto 20px 1fr; }
    .types-panel .type-dpa { grid-column: 2 / 3; }
    .types-panel .type-dpa-scope { grid-column: 3 / 5; }
    .types-panel .type-count { grid-column: 2 / 4; text-align: left; }
}
.danger-zone-stack { flex-direction: column; align-items: flex-start; gap: 8px; }
.danger-zone-stack p { margin: 0; }
.log-changes th, .log-changes td { border: 0; background: none; width: auto; }
.log-details[open] { display: block; margin-top: 2px; }
.log li > time + .log-details[open] { display: inline; }
.log-changes { width: auto; min-width: 0; }
.log-changes th { padding-right: 24px; }
/* v35: manualen – billeder i stort og ældre versioner foldet sammen */
.manual-figure img { cursor: zoom-in; }
.manual-older > summary { cursor: pointer; color: var(--muted); font-size: 13px; padding: 4px 0; }
.manual-older .manual-sections { margin-top: 2px; }
.image-dialog { padding: 0; max-width: min(1400px, 96vw); max-height: 94vh; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.image-dialog::backdrop { background: rgba(0, 0, 0, .7); }
.image-dialog img { display: block; max-width: 100%; max-height: calc(94vh - 56px); margin: 0 auto; cursor: zoom-out; }
.image-dialog figcaption { padding: 10px 16px; font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.sig-editor img { cursor: pointer; }
.sig-editor img.sig-selected { outline: 2px solid var(--accent); outline-offset: 2px; }
.sig-editor a img { border: 0; }
.sig-logo-current { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); }
/* Ternet baggrund, så man kan se, om logoet er gennemsigtigt */
.sig-logo-current img { max-width: 100%; height: auto; padding: 8px; border-radius: 6px; background-color: #fff; background-image: conic-gradient(#e3e3e3 25%, #fff 0 50%, #e3e3e3 0 75%, #fff 0); background-size: 16px 16px; }

.sig-link-settings { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; }
.sig-link-settings .sig-link-label { font-weight: 500; }
.sig-link-settings label.check { margin: 0 0 0 12px; display: inline-flex; align-items: center; }
.sig-logo-size { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.sig-logo-size label { margin: 0; }
.sig-editor img { vertical-align: middle; }
/* v36: smallere landefelt ved telefon */
.phone-row > .combo, .phone-row > select { flex: 0 0 150px; width: 150px; max-width: 150px; }
/* v36: "Påmind efter 24 måneder" på én linje */
#opbevaring .retention-setting label { display: flex; flex-direction: row; align-items: center; gap: 8px; margin: 0; white-space: nowrap; font-weight: 400; }
#opbevaring .retention-setting input[type=number] { width: 72px; margin: 0; }
#opbevaring .panel-head { align-items: center; }
.cron-cmd { font-size: 12px; word-break: break-all; }
.log-tail { max-height: 260px; overflow: auto; white-space: pre-wrap; word-break: break-word; background: var(--bg-soft, rgba(127,127,127,.08)); padding: 8px 10px; border-radius: 6px; margin: 8px 0 0; }

/* v36: databeskyttelse fase 2 */
.date-time { display: grid; grid-template-columns: 1fr 110px; gap: 10px; align-items: end; }
.date-time label { margin: 0; }
.incident-countdown strong { font-size: 16px; }
.measure-list > li { display: grid; grid-template-columns: 16px 210px minmax(0, 1fr) 170px auto auto; gap: 10px; align-items: start; }
.measure-list textarea { min-height: 42px; }
.measure-list .check { margin-top: 10px; }
@media (max-width: 900px) { .measure-list > li { grid-template-columns: 16px 1fr; } .measure-list > li > :not(.drag-handle) { grid-column: 2; } }
.deletion-case { border-top: 1px solid var(--line-soft); padding: 14px 0; }
.deletion-case:first-of-type { border-top: 0; }
.deletion-case .facts-inline { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--muted); margin: 4px 0 10px; }
.deletion-todo { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.calendar-url { font-size: 12px; word-break: break-all; }
.retention-setting label { flex-direction: row; white-space: nowrap; font-weight: 400; }

.col-side #incident-form .grid-2 { grid-template-columns: 1fr; }
.col-side .date-time { grid-template-columns: 1fr 120px; }

/* v37: tidsfelter som de andre felter, knapper uden understregning, luft under knaprækker */
input[type="time"], input[type="datetime-local"] { color-scheme: light dark; -webkit-appearance: none; appearance: none; }
input[type="time"]::-webkit-calendar-picker-indicator { opacity: .7; cursor: pointer; }
a.btn, a.btn:hover, a.btn:focus, td a.btn:hover, .btn:hover { text-decoration: none; }
.actions + p, .actions + .small, .actions + .muted, .inline-form + p { margin-top: 14px; }
.incident-alert { display: grid; gap: 4px; padding: 18px 22px; text-decoration: none; color: inherit; }
.incident-alert:hover { text-decoration: none; filter: brightness(1.08); }
.incident-alert-label { font-weight: 600; }
.incident-alert-count { font-size: 28px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.incident-alert-sub { font-size: 14px; opacity: .9; }
.incident-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
tr.row-missing td:first-child { box-shadow: inset 3px 0 0 var(--warn-ink); }
tr.row-missing input[type="email"] { border-color: var(--warn-ink); }
.notice-action { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.notice-action p { margin: 0; flex: 1 1 380px; }
.notice ol { margin: 8px 0 0; padding-left: 20px; }
.notice > p:first-child { margin-top: 0; }
.notice > p:last-child { margin-bottom: 0; }
.badge-ok { background: var(--ok-bg); color: var(--ok-ink); text-decoration: none; }
.request-item, .checkin-pending { padding: 14px 0; border-top: 1px solid var(--line-soft); }
.request-item:first-of-type, .checkin-pending:first-of-type { border-top: 0; }
.request-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.request-item p.pre-line { margin: 8px 0 0; }
.checkin-result .actions { margin-top: 10px; }
.facts-inline-dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; font-size: 14px; }
.cycle-task .panel-head .badge { margin-left: auto; }
.checkin-side dl { margin-bottom: 10px; }
.col-side select, .col-side textarea, .col-side input { max-width: 100%; box-sizing: border-box; }
.masonry-split { column-count: auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.masonry-split.masonry-measure > * { grid-column: auto; }
.masonry-col { min-width: 0; }
.masonry-col > * { margin: 0 0 var(--gap); display: block; width: 100%; }
.masonry-col > *:last-child { margin-bottom: 0; }
.sidebar .submenu a[aria-current="page"] { background: var(--side-active); color: var(--side-active-ink, #FFFFFF); font-weight: 600; }
.subtabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 var(--gap); }
.subtab { font: inherit; font-size: 14px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.subtab:hover { color: var(--ink); }
.subtab.is-active { background: var(--btn-bg); color: var(--ink); border-color: var(--btn-border); font-weight: 600; }
.kundedata-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.kundedata-grid > .panel { margin: 0; }
@media (max-width: 1100px) { .kundedata-grid { grid-template-columns: minmax(0, 1fr); } }
.badge-cvr { background: var(--btn-bg); color: var(--accent); font-size: 10px; letter-spacing: .04em; padding: 0 6px; margin-left: 6px; }
.cvr-table td { vertical-align: top; }
.cvr-hint { margin: 6px 0 0; }

.sig-hint { display: block; margin-top: 6px; font-weight: 400; }
.badge-novat { background: var(--warn-bg); color: var(--warn-ink); margin-left: 6px; }
.checkin-side select.checkin-interval { color: var(--ink); min-width: 190px; }
.input-with-button { display: flex; gap: 8px; align-items: stretch; }
.input-with-button > input { flex: 1 1 auto; min-width: 0; }
.input-with-button > .btn { flex: 0 0 auto; min-height: 0; }
[data-cvr-result]:not(:empty) { display: block; margin-top: 6px; }
.panel-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.panel + .panel-pair, form + .panel-pair, section + .panel-pair, .panel-pair + .panel, .panel-pair + section, .panel-pair + form { margin-top: var(--gap); }
.panel-pair > .panel { max-width: none; margin: 0; }
@media (max-width: 1100px) { .panel-pair { grid-template-columns: minmax(0, 1fr); } }
.marketing-choices { border: 0; padding: 12px 0 0; margin: 0; border-top: 1px solid #e3e6e3; display: grid; gap: 8px; }
.marketing-choices p { margin: 4px 0 0; }
.subtab-panel > #samtykke { margin-top: var(--gap); }
.marketing-people { list-style: none; margin: 0; padding: 0; }
.marketing-people > li { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(240px, 2fr) auto; gap: 8px 18px; align-items: start; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.marketing-people > li:first-child { border-top: 0; }
.marketing-state { display: grid; gap: 4px; }
.marketing-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.marketing-yes, .marketing-stats { grid-column: 1 / -1; }
@media (max-width: 900px) { .marketing-people > li { grid-template-columns: minmax(0, 1fr); } .marketing-actions { justify-content: flex-start; } }
.dns-table td { vertical-align: top; }
.dns-value { word-break: break-all; font-family: var(--mono); font-size: 13px; }
.dns-raw { white-space: pre-wrap; font-size: 13px; }
.head-buttons { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.plesk-access { flex-basis: 100%; margin: 2px 0 6px 28px; }
#servers-form .type-list li { flex-wrap: wrap; }
.cvr-missing { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft); display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.cvr-missing p { margin: 0; flex: 1 1 320px; }
.terms-table { width: auto; }
.terms-table th, .terms-table td { padding: 4px 8px 4px 0; border: 0; }
.terms-table .input-num { width: 100px; }
.offer-term-hint { display: block; color: var(--accent-text, inherit); font-size: 13px; margin-top: 2px; }

/* Handelsbetingelser og PrivacyKit-tekster */
.legal-body h1 { font-size: 26px; }
.legal-body h2 { font-size: 18px; margin-top: 26px; }
.legal-body p { max-width: 72ch; }
.public-card.legal-body { line-height: 1.6; }
/* Ændringer i hver version (68.2): /vejledning/{navn}/aendringer */
.changes-version { padding-top: 6px; border-top: 1px solid #e6e3dc; margin-top: 18px; scroll-margin-top: 16px; }
.changes-version:target h2 a { background: #f3ebd6; border-radius: 4px; }
.changes-version h2 { margin: 10px 0 2px; }
.changes-version h2 a { color: inherit; text-decoration: none; padding: 0 2px; }
.changes-meta { margin: 0 0 8px; }
.changes-list { margin: 0; padding-left: 0; list-style: none; }
.changes-list li { margin: 0 0 6px; padding-left: 86px; text-indent: -86px; }
.changes-tag { display: inline-block; width: 78px; text-indent: 0; font-size: 12px; font-weight: 600; text-align: center; border-radius: 6px; padding: 1px 0; background: #ecebe6; color: #4b4f4c; }
.changes-addition { background: #dcefe3; color: #1f5c38; }
.changes-fix { background: #e3ebf7; color: #24456f; }
.changes-security { background: #f7e0dc; color: #8a2b1d; }
.changes-remove { background: #f1e6d4; color: #6b4e10; }

/* Indsigt */
.access-section { font-size: 15px; margin: 18px 0 6px; }
.access-items { list-style: none; margin: 0; padding: 0; }
.access-items > li { padding: 6px 0; border-top: 1px solid var(--line-soft); }
.access-items details { margin: 4px 0 0 28px; }
.access-fields { display: grid; grid-template-columns: minmax(120px, 220px) minmax(0, 1fr); gap: 4px 14px; margin: 6px 0 12px; font-size: 13px; }
.access-fields dt { color: var(--muted); }
.access-fields dd { margin: 0; overflow-wrap: anywhere; }
.access-report h3 { margin-top: 24px; }
.access-report h4 { margin: 14px 0 4px; font-size: 14px; }
@media (max-width: 600px) { .access-fields { grid-template-columns: minmax(0, 1fr); } .access-fields dt { margin-top: 6px; } }
@media print { .public-head, .public-foot { display: none; } }
.key-code { font-size: 13px; overflow-wrap: anywhere; }
/* Extensions (version 55): linjerne til manifestet */
.ext-urls a { overflow-wrap: anywhere; }
/* Felter, der kan klappes sammen, og historik på extensionens side (68.3) */
.field-fold { border: 1px solid var(--line); border-radius: var(--radius); padding: 0; }
.field-fold > summary { cursor: pointer; padding: 10px 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-weight: 600; }
.field-fold[open] > summary { border-bottom: 1px solid var(--line); }
.field-fold-body { padding: 10px 12px 12px; display: grid; gap: 6px; }
.field-fold-body textarea { width: 100%; }
.ext-history > summary { cursor: pointer; list-style-position: inside; }
.ext-history > summary h2 { display: inline; margin: 0; }
/* Kladder fra GitHub (version 68) */
.draft-panel { border-left: 3px solid var(--warn-ink); }
.draft-card { padding: 12px 0; border-top: 1px solid var(--line); }
.draft-card:first-of-type { border-top: 0; padding-top: 4px; }
.draft-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; margin-bottom: 6px; }
.draft-head h3 { margin: 0; font-size: 16px; }
.draft-facts { margin: 0 0 8px; }
.draft-changelog { margin: 0 0 8px; padding: 6px 10px; border-left: 3px solid var(--line); }
.draft-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.draft-actions form { margin: 0; }
.code-snippet { font-family: var(--mono); font-size: 12px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--line-soft); border-radius: var(--radius); padding: 10px 12px; margin: 0 0 8px; }
#privacykit .actions form { display: inline; }
.host-line { display: block; margin-top: 3px; }
.mail-more { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.badge-sandbox { background: var(--st-sponsored-bg, #ece6fb); color: var(--st-sponsored, #5a3fa0); }
.marketing-who > * { display: block; } .marketing-who .marketing-role { margin-top: 1px; } .marketing-who .marketing-email { margin-top: 4px; }
.signature-tools { display: flex; gap: 16px; flex-wrap: wrap; } .signature-typed { margin: 6px 0; }

/* Segmenter (gemte søgninger) */
.segment-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -4px 0 14px; font-size: 13px; }
.segment-label { color: var(--muted); margin-right: 4px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 13px; line-height: 18px; text-decoration: none; }
.chip:hover { border-color: var(--accent); color: var(--ink); }
.chip-on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink, #fff); }
.chip-on:hover { color: var(--accent-ink, #fff); }
.chip-on::before { content: "✓"; font-size: 11px; }
.segment-save { display: flex; align-items: center; margin: 0; }
.segment-save > summary { display: block; margin: 0; }
.segment-tools { display: inline-flex; align-items: center; gap: 2px; margin-left: 4px; position: relative; }
.seg-tool { display: inline-block; padding: 3px 9px; border-radius: 999px; color: var(--muted); font-size: 13px; line-height: 18px; text-decoration: none; cursor: pointer; list-style: none; }
.seg-tool::-webkit-details-marker { display: none; }
.seg-tool:hover, .segment-save[open] > .seg-tool { background: var(--btn-bg); color: var(--ink); }
.segment-save-form { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; width: 300px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 8px 24px rgba(0,0,0,.18); display: grid; gap: 8px; }
.segment-save-form p { margin: 0; }
.segment-save-form .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.group-line { margin: 0 0 2px; color: var(--muted); }
.badge-bound { background: var(--btn-bg); color: var(--ink); }
.default-text { white-space: pre-wrap; font-size: 13px; line-height: 1.5; max-height: 420px; overflow: auto; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--line-soft); }
.pv-chip { font-variant-numeric: tabular-nums; border: 1px solid transparent; }
.version-table input[type="color"] { width: 36px; height: 30px; padding: 2px; border-radius: 6px; vertical-align: middle; }
.version-table label.check { display: inline-flex; margin-right: 6px; }
.version-table td { vertical-align: middle; }
.upd-pop { display: inline-block; position: relative; margin: 0; }
.upd-pop > summary { list-style: none; cursor: pointer; display: inline-block; }
.upd-pop > summary::-webkit-details-marker { display: none; }
.upd-pop > summary:hover { filter: brightness(1.08); }
.upd-pop-body { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; width: 260px; padding: 12px; display: grid; gap: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 8px 24px rgba(0,0,0,.18); white-space: normal; }
.upd-pop-body label { display: grid; gap: 4px; font-size: 13px; }
.bulk-edit { display: inline-block; position: relative; margin: 0; }
.bulk-edit > summary { list-style: none; }
.bulk-edit > summary::-webkit-details-marker { display: none; }
.bulk-edit-body { position: absolute; z-index: 30; bottom: calc(100% + 10px); left: 0; max-height: 70vh; overflow: auto; width: 300px; padding: 12px; display: grid; gap: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.bulk-edit-body label { display: grid; gap: 4px; font-size: 13px; }
.version-table input[type="text"] { width: 170px; min-width: 0; }
.public-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 20px; }
.public-link { display: grid; gap: 4px; padding: 18px 20px; border-radius: 16px; background: #fff; color: #1d2220; text-decoration: none; box-shadow: 0 1px 2px rgba(0,0,0,.05); border: 1px solid transparent; }
.public-link strong { color: #00413A; }
.public-link span { color: #5f6660; font-size: 14px; }
.public-link:hover { border-color: #72C38E; }
.public-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.public-home { display: inline-flex; align-items: center; text-decoration: none; }
.steps { margin: 8px 0 12px; padding-left: 20px; display: grid; gap: 6px; }

.field-static { display: grid; gap: 6px; align-content: start; }
.field-static .field-label { font-weight: 600; }
.domain-cell .badge { margin-right: 2px; }
.domain-cell > .nowrap { margin-right: 4px; }
.platform-cell .badge, .platform-cell .php-ver { white-space: nowrap; }
.copy-note { background: var(--line-soft); margin-bottom: 16px; } .copy-note p { margin: 0 0 6px; }
.copy-pop { position: relative; display: inline-block; margin: 0; }
.copy-pop > summary { list-style: none; }
.copy-pop > summary::-webkit-details-marker { display: none; }
.copy-pop-body { position: absolute; z-index: 30; top: calc(100% + 6px); right: 0; width: 320px; padding: 14px; display: grid; gap: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 8px 24px rgba(0,0,0,.18); text-align: left; }
.copy-pop-body label { display: grid; gap: 4px; font-size: 14px; }
.copy-pop-body p { margin: 0; }
.public-back { margin: 0 0 12px; font-size: 14px; }
.public-back a { color: #00413A; text-decoration: none; }
.public-back a:hover { text-decoration: underline; }
@media print { .public-back { display: none; } }
.funnel { width: 100%; border-collapse: collapse; }
.funnel th { text-align: left; font-weight: 500; padding: 8px 12px 8px 0; white-space: nowrap; }
.funnel td { padding: 8px 6px; }
.funnel-bar { width: 45%; }
.funnel-bar svg { display: block; width: 100%; height: 12px; border-radius: 6px; overflow: hidden; }
.bar-bg { fill: var(--line-soft); }
.bar-fg { fill: var(--accent); }
.day-chart { display: block; width: 100%; height: 140px; margin-top: 8px; }
.chart-axis { display: flex; justify-content: space-between; margin-top: 4px; }

.sidebar .submenu a.has-icon { gap: 8px; }
.sidebar .submenu .menu-icon { width: 14px; height: 14px; }
.icon-subs { margin: -4px 0 8px 38px; }
.icon-subs .icon-preview { margin-top: 24px; }
.icon-subs .svg-input { height: 40px; min-height: 36px; }
.sub-list-label { margin: 6px 0 2px 34px; }
.manual-back { margin: 28px 0 0; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.type-list .steps li { display: list-item; padding: 0; border: 0; gap: 0; }
.steps code.cron-cmd { word-break: break-all; }
.head-actions form.copy-pop-body { display: grid; align-items: stretch; }
.copy-pop-body .combo, .copy-pop-body select { width: 100%; }

/* Flere telefonnumre på en kontaktperson */
.phones-fields { display: flex; flex-direction: column; gap: 6px; }
.phones-row { display: flex; flex-direction: column; gap: 4px; padding-bottom: 6px; }
.phones-row + .phones-row { border-top: 1px dashed var(--line); padding-top: 8px; }
.phones-row .phone-row > select.phone-label { flex: 0 0 110px; width: 110px; max-width: 110px; }
.phones-row [data-phone-remove] { flex: 0 0 auto; font-size: 18px; }
.phone-primary { font-weight: 400; }
.phone-dup:empty { display: none; }
.phone-dup { color: var(--warn-ink, var(--ink)); background: var(--warn-bg, transparent); border-radius: 6px; padding: 4px 8px; }
@media (max-width: 560px) { .phones-row .phone-row { flex-wrap: wrap; } .phones-row .phone-row > input[type="tel"] { flex-basis: 100%; } }

/* Tilbudsbyggeren */
.offer-preview-page { max-width: 860px; background: #f4f5f2; color: #1d2220; border-radius: 16px; padding: 20px; }
.offer-preview-page .public-card { color: #1d2220; }
.offer-preview-page .section-row th { background: #f4f5f2; font-size: 13px; }
.offer-preview-page a { color: #00615a; }
.offer-section .rich-text { line-height: 1.6; }
.offer-section .rich-text p { margin: 0 0 .8em; }
.offer-section .rich-text ul, .offer-section .rich-text ol { margin: 0 0 .8em; padding-left: 1.4em; }
.offer-figure { margin: 16px 0 0; }
.offer-figure img { max-width: 100%; height: auto; border-radius: 10px; display: block; }
.offer-figure figcaption { margin-top: 6px; }
.offer-sections { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.offer-section-edit { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--surface); display: flex; flex-direction: column; gap: 8px; }
.offer-section-edit.dragging { opacity: .5; }
.offer-section-edit.drop-before { box-shadow: 0 -3px 0 var(--accent); }
.offer-section-edit.drop-after { box-shadow: 0 3px 0 var(--accent); }
.offer-section-head { display: flex; align-items: center; gap: 10px; }
.offer-section-head .drag-handle { cursor: grab; color: var(--muted); user-select: none; }
.offer-section-title { flex: 1 1 auto; font-weight: 600; }
.offer-section-image { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 16px; }
.offer-thumb { max-height: 80px; max-width: 160px; border-radius: 8px; border: 1px solid var(--line); }
.offer-section-add { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: flex-start; }
.block-list .block-edit { flex: 1 1 auto; min-width: 0; }
.block-list .block-edit summary { cursor: pointer; }
.block-list > li { align-items: flex-start; }
/* Beskeden efter Gem står over punktet i fuld bredde, ikke ved siden af */
.block-list > li { flex-wrap: wrap; }
.block-list > li > .notice-inline { flex: 1 0 100%; margin: 0 0 4px; }
.block-list .block-edit > summary { width: fit-content; max-width: 100%; border-radius: 6px; padding: 2px 6px; margin-left: -6px; }
.block-list .block-edit > summary:focus-visible { outline-width: 1px; outline-offset: 0; }

/* Kundens side: afkrydsningsfelter står øverst ud for teksten, også når den fylder flere linjer */
body.public label.check { align-items: flex-start; }
body.public label.check input { margin-top: 2px; }
.marketing-choices { border-top: 0; padding-top: 0; }
.accept-hint { margin: 4px 0 0; }
/* Forhåndsvisning af et tilbud: en bjælke øverst på kundens side */
.preview-bar { position: sticky; top: 0; z-index: 50; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; background: #fff4d6; color: #5a4300; border-bottom: 1px solid #ecd9a0; padding: 10px 24px; font-size: 14px; }
.preview-bar a { color: #00413A; font-weight: 600; }
/* Flere telefonnumre: knappen står til venstre, og nummerfeltet får pladsen */
.phones-fields [data-phone-add] { align-self: flex-start; }
.phones-row .phone-row > select.phone-label { flex: 0 0 120px; width: 120px; max-width: 120px; }
.phones-row .phone-row > .combo { flex: 0 0 170px; width: 170px; max-width: 170px; }
.phones-row .phone-row > input[type="tel"] { flex: 1 1 160px; min-width: 140px; }

/* Tilbudslinjer: alle felter samme højde og størrelse */
.lines-table input[type="text"], .lines-table select, .lines-table .combo-input { min-height: 36px; height: 36px; padding-top: 6px; padding-bottom: 6px; font-size: 14px; }
.lines-table input[type="text"] { padding-left: 10px; padding-right: 10px; }
.lines-table td { padding-left: 5px; padding-right: 5px; }
.lines-table td:nth-child(2) select { min-width: 104px; width: 104px; }
.lines-table td:nth-child(3) { min-width: 170px; }
.lines-table td:nth-child(3) .combo-input { min-width: 160px; }
.lines-table td:nth-child(4) { min-width: 170px; width: 30%; }
.lines-table td:nth-child(5) input { width: 110px; }
.lines-table td:nth-child(6) select, .lines-table td:nth-child(7) select { min-width: 104px; width: 104px; }
.lines-table .line-note { height: 32px; min-height: 32px; }
.lines-table td:nth-child(3) .combo { min-width: 160px; }
.lines-table td:nth-child(5) input { width: 96px; min-width: 96px; }
.lines-table td:nth-child(9), .lines-table td:nth-child(8) { padding-left: 2px; padding-right: 2px; }
/* Smal kolonne: betegnelse og land på første linje, nummeret på næste */
.phones-fields { container-type: inline-size; }
@container (max-width: 460px) {
    .phones-row .phone-row { flex-wrap: wrap; }
    .phones-row .phone-row > .combo { flex: 1 1 150px; width: auto; max-width: none; }
    .phones-row .phone-row > input[type="tel"] { flex: 1 1 calc(100% - 52px); }
}
.lines-table .line-extra { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 4px; }
.lines-table .line-extra .line-note { margin-top: 0; }
/* Fodnoter i prisoversigten */
.fn-mark { font-size: 0.75em; margin-left: 1px; }
.offer-prices .fn-row td { padding-top: 2px; font-size: 13px; color: var(--muted); border-top: 0; }
/* Rabat på linjer (version 81): normalprisen streget over, rabatten i grøn */
.offer-prices .price-before { text-decoration: line-through; color: var(--muted); }
.offer-prices .price-discount { color: var(--ok-ink); font-weight: 600; }
.offer-prices .price-mobile { display: none; }
@media (max-width: 640px) {
  .offer-prices.with-discount .col-before, .offer-prices.with-discount .col-discount { display: none; }
  .offer-prices .price-mobile { display: block; font-size: 13px; white-space: normal; margin-top: 2px; }
  .offer-prices .price-mobile > .price-before, .offer-prices .price-mobile > .price-discount { white-space: nowrap; }
}
.fn-note { display: block; }

/* v45: hovedmenuen kan klappes sammen til ikoner */
.menu-initial, .menu-fly, .submenu-title { display: none; }
.sidebar .submenu > .submenu-title + li { border-radius: 10px 10px 0 0; padding-top: 6px; }
.sidebar .submenu > .submenu-title + li:last-child { border-radius: 10px; }
.menu-collapse { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--side-ink); opacity: .7; cursor: pointer; }
.menu-collapse:hover { opacity: 1; background: var(--side-active); color: var(--side-active-ink, #FFFFFF); }
.menu-collapse svg { width: 19px; height: 19px; }
@media (min-width: 761px) {
    .sidebar-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
    .sidebar-top .brand { flex: 1 1 auto; min-width: 0; }
    .sidebar { transition: width .18s ease, padding .18s ease; }
    body.menu-mini .sidebar { width: 68px; padding-left: 10px; padding-right: 10px; }
    body.menu-mini .sidebar-top { justify-content: center; }
    body.menu-mini .sidebar-top .brand { display: none; }
    body.menu-mini .collapse-arrow { transform: rotate(180deg); transform-origin: 12.5px 10px; }
    body.menu-mini .menu-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    body.menu-mini .sidebar [data-menu] > li > a { justify-content: center; padding: 0; }
    body.menu-mini .sidebar [data-menu] > li.has-sub > a::after { content: none; }
    body.menu-mini .sidebar a .menu-icon { width: 19px; height: 19px; }
    body.menu-mini .menu-initial { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--side-line, #3A3834); font-size: 13px; font-weight: 700; }
    body.menu-mini .sidebar .submenu { left: 52px; }
    body.menu-mini .submenu-title { display: block; }
    body.menu-mini .sidebar .submenu > .submenu-title { border-radius: 10px 10px 0 0; padding-top: 6px; }
    body.menu-mini .sidebar .submenu > .submenu-title a { font-weight: 700; color: var(--side-active-ink, #FFFFFF); }
    body.menu-mini .sidebar .submenu > .submenu-title + li { border-radius: 0; padding-top: 0; }
    body.menu-mini .sidebar .submenu > .submenu-title + li:last-child { border-radius: 0 0 10px 10px; }
    body.menu-mini .sidebar [data-menu] > li:hover > .menu-fly { display: block; position: fixed; left: 62px; z-index: 200; margin-top: 7px; padding: 6px 12px; border-radius: 8px; background: var(--side); color: var(--side-active-ink, #FFFFFF); font-size: 14px; white-space: nowrap; box-shadow: 0 6px 20px -8px rgba(0,0,0,.5); pointer-events: none; }
    body.menu-mini .sidebar-note { padding: 0; text-align: center; font-size: 18px; }
    body.menu-mini .sidebar-foot { flex-direction: column; align-items: center; padding-left: 0; padding-right: 0; }
    body.menu-mini .side-user { flex: 0 0 auto; padding: 2px; }
    body.menu-mini .side-user-name { display: none; }
    body.menu-mini .sidebar-foot-actions { flex-direction: column; flex: 0 0 auto; padding-left: 0; align-items: center; }
    body.menu-mini .sidebar-foot .side-user { flex: 0 0 auto; }
    body.menu-mini .sidebar { gap: 14px; }
}
@media (max-width: 760px) { .menu-collapse { display: none; } }

/* v45: genveje nederst på midten */
.quick { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 150; display: flex; flex-direction: column; align-items: center; }
body.menu-mini .quick { left: calc(50% + 34px); }
@media (min-width: 761px) { body:not(.menu-mini) .quick { left: calc(50% + 116px); } }
.quick-btn { width: 52px; height: 52px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); box-shadow: 0 10px 28px -10px rgba(0,0,0,.55); cursor: pointer; transition: transform .15s ease; }
.quick-btn .menu-icon { width: 22px; height: 22px; opacity: 1; }
.quick-btn:hover, .quick.open .quick-btn { transform: scale(1.06); }
.quick-menu { list-style: none; margin: 0; padding: 6px; position: absolute; bottom: 100%; left: 50%; transform: translate(-50%, 8px); min-width: 220px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 16px 40px -16px rgba(0,0,0,.5); opacity: 0; visibility: hidden; transition: opacity .15s ease, transform .15s ease, visibility .15s; }
.quick::before { content: ""; position: absolute; bottom: 100%; left: 0; right: 0; height: 14px; }
.quick:hover .quick-menu, .quick.open .quick-menu, .quick:focus-within .quick-menu { opacity: 1; visibility: visible; transform: translate(-50%, -10px); }
.quick-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 9px; color: inherit; text-decoration: none; background: none; border: 0; font: inherit; text-align: left; cursor: pointer; white-space: nowrap; }
.quick-item:hover, .quick-item:focus-visible { background: var(--btn-bg); color: var(--btn-ink); }
.quick-item .menu-icon { width: 17px; height: 17px; }
.main { padding-bottom: 96px; }
@media print { .quick { display: none; } }
/* Indstillinger: rækker med genveje */
.quick-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.quick-row { display: grid; grid-template-columns: auto 1fr 1fr auto; gap: 8px; align-items: end; padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
.quick-row [data-quick-custom] { grid-column: 2 / 4; }
.quick-row .quick-icon-field { grid-column: 2 / 4; }
.quick-move { display: inline-flex; flex-direction: column; align-self: center; }
.quick-move .btn-icon { min-height: 24px; height: 24px; }
@media (max-width: 760px) { .quick-row { grid-template-columns: 1fr auto; } .quick-row > label { grid-column: 1 / -1 !important; } }

.lines-table .drag-col { width: 22px; padding-left: 0; padding-right: 0; vertical-align: middle; }
.lines-table td.drag-col { padding-top: 14px; vertical-align: top; }
.lines-table .drag-handle { cursor: grab; color: var(--muted); letter-spacing: -2px; user-select: none; }
.lines-table tr.dragging { opacity: .5; }
.lines-table tr.drop-before td { box-shadow: inset 0 2px 0 var(--accent); }
.lines-table tr.drop-after td { box-shadow: inset 0 -2px 0 var(--accent); }
/* Tilvalg: afkrydsningen midt ud for felterne */
.lines-table td.center { vertical-align: top; padding-top: 14px; }
.lines-table td.center input[type="checkbox"] { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.quick-row .quick-move { align-self: center; cursor: grab; color: var(--muted); letter-spacing: -2px; user-select: none; padding: 0 2px; }
.quick-row.dragging { opacity: .5; }
.quick-row.drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.quick-row.drop-after { box-shadow: inset 0 -2px 0 var(--accent); }
.lines-table td:nth-child(4) { width: 40%; min-width: 220px; }

/* v46: projekter */
.mg-row.mg-project { min-height: 30px; }
.mg-project .mg-owner-name { padding-left: 18px; font-size: 13px; font-weight: 600; }
.mg-project .mg-owner-name a { color: var(--muted); }
.project-row th { font-weight: 600; }
.project-row th a { color: var(--ink); }
.billing-group th { font-weight: 600; color: var(--ink); }
.billing-ref { color: var(--accent); }
.project-list li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.offer-project { margin-top: -6px; }
.offer-totals { text-align: right; }
/* Lister med flueben i tilbuddet */
.rich-text.list-check ul { list-style: none; padding-left: 0; }
.rich-text.list-check ul > li { position: relative; padding-left: 26px; }
.rich-text.list-check ul > li::before { content: ""; position: absolute; left: 4px; top: .35em; width: 6px; height: 11px; border: solid #00615a; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.offer-list-style { margin-top: 6px; }
.response-box .response-comment { margin-top: 6px; white-space: normal; }

/* ---- Kalender (version 47) ---- */
.cal-cats { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.cal-cat { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 13px; padding: 4px 10px 4px 6px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; min-height: 30px; }
.cal-cat .cal-icon { width: 18px; height: 18px; padding: 3px; border-radius: 50%; background: var(--cat, #888); color: var(--cat-ink, #fff); box-sizing: border-box; }
.cal-cat[aria-pressed="false"] { opacity: .45; text-decoration: line-through; }
.cal-cat[aria-pressed="false"] .cal-icon { background: var(--line); color: var(--muted); }
.cal-panel { padding: 16px 18px; overflow: hidden; }
.cal-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.cal-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cal-nav .btn { min-height: 36px; padding: 0 12px; }
.cal-label { margin: 0 0 0 8px; font-size: 19px; }
.cal-views { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.cal-viewbtn { padding: 6px 12px; font-size: 14px; color: var(--ink); text-decoration: none; border-left: 1px solid var(--line); }
.cal-viewbtn:first-child { border-left: 0; }
.cal-viewbtn[aria-current="page"] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.cal-body { transition: transform .22s ease, opacity .22s ease; }
.cal-body.slide-out-left { transform: translateX(-28px); opacity: 0; }
.cal-body.slide-out-right { transform: translateX(28px); opacity: 0; }
.cal-body.slide-in-left { transform: translateX(28px); opacity: 0; transition: none; }
.cal-body.slide-in-right { transform: translateX(-28px); opacity: 0; transition: none; }
.cal-wrap.is-loading .cal-body { opacity: .6; }
@media (prefers-reduced-motion: reduce) { .cal-body { transition: none; } }

.cal-row { display: flex; }
.cal-gutter { flex: 0 0 52px; font-size: 12px; color: var(--muted); }
.cal-col { flex: 1 1 0; min-width: 0; border-left: 1px solid var(--line-soft); }
.cal-col.is-today { flex-grow: 1.6; }
.cal-dayhead { display: block; padding: 6px 8px; text-decoration: none; color: var(--ink); border-radius: 8px 8px 0 0; }
.cal-dayhead:hover { background: var(--line-soft); }
.cal-dayname { text-transform: capitalize; color: var(--muted); font-size: 13px; }
.cal-daynum { font-weight: 600; font-size: 17px; }
.cal-dayhead.is-weekend .cal-daynum, .cal-dayhead.is-holiday .cal-daynum { color: var(--muted); }
.cal-dayhead.is-today { background: var(--accent); color: var(--accent-ink); }
.cal-dayhead.is-today .cal-dayname, .cal-dayhead.is-today .cal-daynum { color: var(--accent-ink); }
.cal-weekno { display: inline-block; padding: 6px 4px; font-size: 12px; color: var(--muted); text-decoration: none; }
.cal-heads { border-bottom: 1px solid var(--line); }
.cal-allday { border-bottom: 1px solid var(--line); }
.cal-allday .cal-gutter { padding: 6px 4px; }
.cal-cell { padding: 4px; min-height: 44px; display: flex; flex-direction: column; gap: 3px; cursor: cell; }
.cal-cell.is-today, .cal-slots.is-today { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.cal-cell.is-holiday { background: color-mix(in srgb, var(--muted) 6%, transparent); }
.cal-timed .cal-hours { display: flex; flex-direction: column; }
.cal-hour { flex: 1 0 0; min-height: 44px; padding: 0 6px; text-align: right; transform: translateY(-7px); }
.cal-hour:first-child { transform: none; }
.cal-slots { position: relative; display: flex; flex-direction: column; cursor: cell; }
.cal-slot { flex: 1 0 0; min-height: 44px; border-bottom: 1px solid var(--line-soft); }
.cal-now { position: absolute; left: 0; right: 0; height: 2px; background: #D93025; z-index: 3; pointer-events: none; }
.cal-now::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: #D93025; }

.cal-item { position: relative; display: flex; align-items: flex-start; gap: 5px; padding: 3px 6px 3px 4px; border-radius: 6px; font-size: 12.5px; line-height: 1.3;
    background: color-mix(in srgb, var(--cat, #888) 16%, var(--surface)); border-left: 3px solid var(--cat, #888); cursor: default; min-width: 0; }
.cal-item[draggable="true"] { cursor: grab; }
.cal-item.is-dragging { opacity: .4; }
.cal-item.is-continued { opacity: .75; border-left-style: dashed; }
.cal-item.is-late { border-left-color: #D93025; }
.cal-item.is-timed { position: absolute; left: 2px; right: 2px; overflow: hidden; z-index: 2; box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.cal-ico { flex: 0 0 auto; display: inline-flex; color: var(--cat, #888); padding-top: 1px; }
.cal-icon { width: 14px; height: 14px; }
.cal-link { flex: 1 1 auto; min-width: 0; color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; }
.cal-link:hover .cal-title { text-decoration: underline; }
.cal-week .cal-link, .cal-month .cal-link { white-space: nowrap; }
.cal-dag .cal-link { white-space: normal; }
.cal-time { font-weight: 600; margin-right: 4px; font-variant-numeric: tabular-nums; }
.cal-done { margin: 0; flex: 0 0 auto; }
.cal-done-btn { font: inherit; font-size: 12px; line-height: 1; border: 1px solid var(--line); background: var(--surface); color: var(--ok-ink); border-radius: 5px; padding: 2px 5px; cursor: pointer; opacity: 0; }
.cal-item:hover .cal-done-btn, .cal-done-btn:focus-visible { opacity: 1; }
@media (hover: none) { .cal-done-btn { opacity: 1; } }
.cal-late-head { margin: 0; font-size: 12px; font-weight: 600; color: #B3261E; text-decoration: none; }
.cal-drop { outline: 2px dashed var(--accent); outline-offset: -2px; }

.cal-month .cal-heads .cal-col { padding: 6px 8px; border-left-color: transparent; }
.cal-month .cal-col.is-today-col { flex-grow: 1.4; }
.cal-mweek { border-bottom: 1px solid var(--line-soft); }
.cal-mweek .cal-gutter { text-align: center; }
.cal-mday { min-height: 104px; }
.cal-mday.is-other { opacity: .45; }
.cal-mday.is-weekend { background: color-mix(in srgb, var(--muted) 4%, transparent); }
.cal-mnum { align-self: flex-start; font-weight: 600; font-size: 13px; color: var(--ink); text-decoration: none; padding: 1px 6px; border-radius: 999px; }
.cal-mday.is-today .cal-mnum { background: var(--accent); color: var(--accent-ink); }
.cal-mday.is-holiday .cal-mnum { color: var(--muted); }
.cal-more { color: var(--muted); }

.cal-list { display: flex; flex-direction: column; gap: 14px; max-width: 760px; }
.cal-listday { display: flex; flex-direction: column; gap: 5px; }
.cal-listday h3 { font-size: 15px; margin: 0 0 2px; }
.cal-listday h3 a { color: var(--ink); text-decoration: none; }
.cal-listday.is-today h3 a { color: var(--accent); }
.cal-listday.is-late-day h3 { color: #B3261E; }
.cal-list .cal-item { font-size: 14px; padding: 6px 8px; }
.cal-list .cal-link { white-space: normal; }

.cal-cat-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cal-cat-preview { display: inline-flex; padding: 5px; border-radius: 50%; background: var(--cat); color: var(--cat-ink); }
.cal-cat-preview .cal-icon { width: 16px; height: 16px; }

@media (max-width: 760px) {
    .cal-gutter { flex-basis: 34px; }
    .cal-week.cal-uge .cal-col:not(.is-today) .cal-title, .cal-week.cal-uge5 .cal-col:not(.is-today) .cal-title { display: none; }
    .cal-mday { min-height: 64px; }
    .cal-mday .cal-link { display: none; }
    .cal-label { font-size: 16px; margin-left: 0; width: 100%; }
}
.cal-late-group { display: flex; flex-direction: column; gap: 3px; padding-bottom: 5px; margin-bottom: 2px; border-bottom: 1px dashed color-mix(in srgb, #B3261E 45%, transparent); }

/* Klokkeslæt (version 48): samme felt som datoen, vælger med timer og minutter */
.timepick-pop { width: 220px; }
.tp-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tp-head { margin: 0 0 4px; font-size: 11px; font-weight: 600; color: var(--muted); text-align: center; text-transform: uppercase; letter-spacing: .04em; }
.tp-list { display: flex; flex-direction: column; gap: 2px; max-height: 236px; overflow-y: auto; padding-right: 2px; }
.tp-cell { border: 0; border-radius: 8px; background: transparent; color: var(--ink); font: inherit; font-variant-numeric: tabular-nums; padding: 6px 0; cursor: pointer; }
.tp-cell:hover { background: var(--btn-bg); color: var(--btn-ink); }
.tp-cell.is-selected { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.tp-hint { margin: 8px 0 0; }
.label-row { display: flex; align-items: center; gap: 6px; min-height: 22px; }
.label-row > .help-icon { margin-left: 0; }

/* Fanen Projekter på kunden (version 48.1) */
.project-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 12px; }
.project-card { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); text-decoration: none; transition: border-color .15s, background .15s; }
.project-card:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.project-card.is-closed { opacity: .7; }
.project-card-name { font-size: 16px; }
.project-card-stats { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; color: var(--muted); }
.project-start { margin: 4px 0 14px; }
.project-start > summary { color: var(--muted); cursor: pointer; }

/* Fakturering: Lav kladde i Dinero ved hver kunde (version 53) */
.billing-group-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; }
.billing-group .billing-owner { font-size: 15px; }
.billing-group .billing-dinero { font-weight: 500; flex: none; }

/* PrivacyKit → Sites: cookies og tjenester folder ud uden at flytte kolonnerne, og fokus står kun om teksten (53.1) */
.pk-status { width: 42%; }
.badge-danger { background: var(--error-bg); color: var(--error-ink); }
.pk-report > summary { width: fit-content; border-radius: 6px; padding: 0 4px; margin-left: -4px; }
.pk-report > summary:focus-visible { outline-width: 1px; outline-offset: 0; }
.pk-report > ul { margin: 4px 0 6px; padding-left: 18px; overflow-wrap: anywhere; }

/* Rapporter fra sites (version 56): extensions, der er bagud, og prikken i domænelisten */
.site-extensions tr.ext-behind td { background: var(--st-overdue-bg); }
.site-extensions tr.ext-behind td:first-child { box-shadow: inset 3px 0 0 var(--st-overdue); }
a.ext-coverage-behind { color: var(--st-overdue); font-weight: 600; }
.site-alert { margin-left: 6px; vertical-align: middle; }
#extensions .facts .inline-form { display: inline-flex; margin: 0 0 0 8px; }
#extensions .facts { margin-bottom: 12px; }
#extensions .attention-box { margin-bottom: 12px; }
.site-token-new { margin-bottom: 12px; }

/* Brugervejledning i Markdown på en extension (version 58.1) */
.guide-input { font-family: var(--mono); font-size: 13px; line-height: 1.55; min-height: 18rem; }
/* 67.1: felterne vokser med teksten, så tomme felter ikke fylder en hel skærm; den lange beskrivelse er kortere */
@supports (field-sizing: content) {
    .guide-input { field-sizing: content; min-height: 10rem; max-height: 40rem; }
    .guide-input.guide-input-short { min-height: 7rem; max-height: 30rem; }
}
.guide-input.guide-input-short { min-height: 7rem; }
/* Fluebenene på extensionens side står under hinanden ved siden af Noter */
.check-stack { display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.check-stack label.check { margin: 0; }
.check-stack .hint { margin: 0; }

/* Overvågning (version 59) */
.text-ok { color: var(--ok-ink); }
.monitor-checks { margin: 0 0 12px; padding: 0; list-style: none; }
.monitor-checks li { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.monitor-checks li:first-child { border-top: 0; }
.monitor-checks .small { grid-column: 1 / -1; }

/* Besked om ændring (version 61): "Hvad er ændret" pr. kunde på sin egen linje under kunden */
.notice-changes td { border-top: 0; padding-top: 0; }
.notice-changes textarea { width: 100%; }

/* Licenser på download-nøglen (version 62) */
/* Også download-nøgle ved site-tokenet (version 69) */
.site-token-form { display: inline-flex; align-items: center; gap: 10px; }
/* Ret står i højre side på licensens linje (version 69); formularen folder sig ud under linjen */
.license-rows li { display: block; position: relative; }
.license-rows li > div { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding-right: 64px; }
.license-rows li strong { margin-left: 0; }
.license-rows li form { margin-left: 0; }
.license-edit > summary { list-style: none; position: absolute; top: 6px; right: 0; }
.license-edit > summary::-webkit-details-marker { display: none; }
/* Datofeltet og aftalen står i en label.check, hvis input-stil ellers gør dem 18px brede */
.license-expiry label.check { margin: 6px 0; }
.license-expiry label.check .datepick { width: 170px; }
.license-expiry label.check .datepick input,
.license-expiry label.check input[type=date] { width: 100%; height: auto; }
.license-expiry label.check select { min-width: 0; max-width: 100%; }

/* Domænets side (62.1): formularen fylder kolonnen, og på brede skærme står felterne fire på række */
.form-panel.form-wide { max-width: none; container-type: inline-size; }
@container (min-width: 960px) {
    .form-wide .grid-2 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .form-wide .span-2 { grid-column: span 2; }
    .form-wide .span-full { grid-column: 1 / -1; }
}

/* Ekstra linjer på fakturaer (version 63) */
.badge-extra { background: var(--st-pending-bg); color: var(--st-pending); }
.form-panel > fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
/* 73.3: luft over grupperne (fx Løbetid og binding, Pris, Rabat) og overskriften på linje med felterne */
.form-panel > fieldset.section-gap { margin-top: 28px; }
.form-panel > fieldset > legend { padding: 0; margin-bottom: 2px; }
.extra-line-total { margin: 0; }
.extra-waiting { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.extra-waiting > span { flex: 1 1 260px; }

/* Bekræftelse på siden i stedet for browserens confirm() (version 63.1) */
.confirm-dialog { max-width: 440px; }
.confirm-text { margin: 0 0 20px; font-size: 15px; line-height: 1.5; white-space: pre-line; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

/* ---- Fakturering → Klar til afsendelse (version 64) ---- */
.tab-klar .tab-count { background: var(--st-pending-bg); color: var(--st-pending); }
.drafts-table tr.draft-held td:nth-child(8) { color: var(--warn-ink); }
.draft-warn { color: var(--warn-ink); font-weight: 500; }
.badge-auto { background: var(--st-paid-bg); color: var(--st-paid); }
.run-list { list-style: none; padding: 0; margin: 8px 0 0; }
.run-list li { border-top: 1px solid var(--line-soft); padding: 8px 0; }
.run-list summary { cursor: pointer; }
.run-list table { margin-top: 8px; }

/* ---- Handelsbetingelser m.fl.: udgivelsen som sin egen del under teksten (64.3) ---- */
.publish-box { display: flex; flex-direction: column; gap: 10px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.publish-box h2 { margin: 0; font-size: 16px; }
.publish-box > p { margin: 0; }

/* Indstillinger → Pocket: modtagne kald (version 69) */
.pocket-event { display: block; }
.pocket-event summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; cursor: pointer; }
.pocket-summary { margin: 8px 0; }
.pocket-raw { max-height: 320px; overflow: auto; white-space: pre-wrap; word-break: break-word; background: var(--bg-soft, rgba(127, 127, 127, .08)); padding: 8px; border-radius: 6px; }

/* Fakturering → Omsætning (version 69) */
.revenue-table .revenue-group th, .revenue-table .revenue-group td { font-weight: 600; border-top: 1px solid var(--line); }
.revenue-table .revenue-product td:first-child { padding-left: 20px; }
.revenue-table tfoot th, .revenue-table tfoot td { font-weight: 700; border-top: 2px solid var(--line); }
.revenue-months td, .revenue-months th { white-space: nowrap; }
.revenue-table tbody th, .revenue-table tfoot th { color: inherit; font-size: inherit; text-transform: none; letter-spacing: 0; text-align: left; border-bottom: 1px solid var(--line-soft); }

/* ---- MailKit: kortet Mail på domænet og oversigten (version 70) ---- */
.mk-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 8px 0 4px; }
.mk-tile { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.mk-num { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.1; }
.mk-label { font-size: 12px; color: var(--muted); }
.mk-tiles-small .mk-num { font-size: 17px; }
.mk-ok { background: var(--ok-bg); border-color: transparent; }
.mk-ok .mk-num { color: var(--ok-ink); }
.mk-warn { background: var(--warn-bg); border-color: transparent; }
.mk-warn .mk-num { color: var(--warn-ink); }
.mk-bad { background: var(--error-bg); border-color: transparent; }
.mk-bad .mk-num { color: var(--error-ink); }
.mk-zero .mk-num { color: var(--muted); }
@media (max-width: 640px) { .mk-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.mk-chart { display: flex; align-items: flex-end; gap: 2px; height: 90px; margin-top: 12px; padding-bottom: 2px; border-bottom: 1px solid var(--line); }
.mk-day { flex: 1; height: 100%; display: flex; align-items: flex-end; min-width: 0; }
.mk-bar { width: 100%; background: var(--st-paid); border-radius: 2px 2px 0 0; display: flex; align-items: flex-end; min-height: 1px; }
.mk-bar.h-0 { background: var(--line); height: 1px; }
.mk-bar-bad { width: 100%; background: var(--st-overdue); border-radius: 2px 2px 0 0; }
.mk-missing .mk-bar { background: transparent; border-top: 2px dotted var(--muted); height: 2px; }
.mk-legend { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 6px 0 0; }
.mk-legend span { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-left: 8px; }
.mk-legend span:first-child { margin-left: 0; }
.mk-key-ok { background: var(--st-paid); }
.mk-key-bad { background: var(--st-overdue); }
.mk-key-missing { border-top: 2px dotted var(--muted); height: 2px !important; }

.mk-reasons { list-style: none; margin: 6px 0 8px; padding: 0; display: grid; gap: 6px; }
.mk-reasons li { display: grid; grid-template-columns: minmax(0, 1fr) 80px auto; align-items: center; gap: 10px; font-size: 14px; }
.mk-reason-bar { height: 8px; background: var(--line-soft); border-radius: 4px; overflow: hidden; }
.mk-reason-bar span { display: block; height: 100%; background: var(--st-overdue); }

.mk-grade { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; vertical-align: middle; }
.mk-grade-ok { background: var(--ok-bg); color: var(--ok-ink); }
.mk-grade-warn { background: var(--warn-bg); color: var(--warn-ink); }
.mk-grade-bad { background: var(--error-bg); color: var(--error-ink); }
.mk-grade-unknown { background: var(--st-pending-bg); color: var(--st-pending); }
.mk-problems { margin: 6px 0 0; padding-left: 18px; }

.mk-checks { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; font-size: 14px; }
.mk-checks li { display: flex; align-items: baseline; gap: 8px; }
.mk-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--st-pending); }
.mk-yes .mk-dot { background: var(--st-paid); }
.mk-no .mk-dot { background: var(--st-overdue); }
.mk-no { color: var(--error-ink); }

.mk-overview td { vertical-align: top; }
.mk-overview .mk-problem-list { margin: 4px 0 0; padding-left: 16px; color: var(--error-ink); }
.mk-overview tr.mk-row-act td:first-child { box-shadow: inset 3px 0 0 var(--st-overdue); }
.mk-status { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--st-paid); }
.mk-status-act { background: var(--st-overdue); }
.mk-status-none { background: var(--st-pending); }
/* 70.2: nøglen med Kopiér og Spær på én linje, og luft under boksene */
#mail .mk-keyrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
#mail .mk-keyrow form { display: inline-flex; margin: 0; }
#mail > .attention-box, #mail > .notice { margin: 4px 0 16px; }
#mail .facts { align-items: center; }

/* Version 71: Indstillinger → Import */
.import-page, .import-run { display: grid; gap: 16px; min-width: 0; }
.import-page .panel { min-width: 0; }
.import-steps { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; padding: 0; margin: 12px 0 16px; counter-reset: step; font-size: 14px; }
.import-steps li { counter-increment: step; color: var(--muted); }
.import-steps li::before { content: counter(step) ". "; }
.import-steps li.done::before { content: "✓ "; }
.import-steps li[aria-current="step"] { color: var(--ink); font-weight: 600; }
.import-table td { vertical-align: top; }
.import-table select, .import-table input[type="text"] { min-width: 180px; max-width: 280px; }
.import-page .rows li strong { margin-left: 0; }
.import-blocks li, .import-doubts li { display: block; }
.import-blocks summary { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; cursor: pointer; }
.import-blocks details[open] summary { margin-bottom: 8px; }
.import-choices { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 6px; }
.import-batch { justify-content: space-between; }
.notice-text-warn { color: var(--warn-ink); }
.import-run > .actions { margin-bottom: 16px; }

/* Version 72: Betales udenom og rettelse af beløb fra importen */
.badge-cash { background: var(--st-sponsored-bg); color: var(--st-sponsored); }
.badge-arrears { background: var(--warn-bg); color: var(--warn-ink); }
.cash-list li { grid-template-columns: 104px minmax(0, 1fr) 118px auto; }
.cash-list .cash-paid { margin: 0; justify-self: end; }
@media (max-width: 560px) {
    .cash-list li { grid-template-columns: minmax(0, 1fr) auto; }
    .cash-list .cash-paid { grid-column: 1 / -1; justify-self: start; }
}
.period-fix { border-left-color: var(--st-pending); }

/* Version 73: Fakturaer fra Dinero at koble */
.foreign-list { list-style: none; margin: 0; padding: 0; }
.foreign-item { padding: 12px 0; border-top: 1px solid var(--line-soft); }
.foreign-item:first-child { border-top: 0; }
.foreign-invoice { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.foreign-customer { flex: 1; min-width: 160px; }
.foreign-periods { list-style: none; margin: 8px 0 0; padding: 0 0 0 14px; border-left: 3px solid var(--line-soft); }
.foreign-periods li { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 2px 0; }
.foreign-periods .num { margin-left: auto; }
.foreign-none { margin: 6px 0 0; }
.foreign-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.foreign-actions form { margin: 0; }

/* 73.3: uddybning på ekstra linjer med linjeskift */
.extra-line-notes { white-space: pre-line; }
.copy-customers { display: flex; flex-direction: column; gap: 4px; max-height: 420px; overflow-y: auto; padding: 4px 0; }
.copy-customers [hidden] { display: none; }

/* 73.9: total pr. betaler i en gruppe under Skal faktureres */
.payer-total td { font-weight: 600; background: var(--btn-bg); color: var(--btn-ink); border-bottom: 2px solid var(--line); }
.payer-total + tr td { padding-top: 14px; }

/* 73.10: ret uddybningen direkte i listen */
.inline-edit { cursor: text; border-radius: 4px; }
.inline-edit:hover, .inline-edit:focus-visible { background: var(--line-soft); outline: none; }
.inline-edit-box { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; max-width: 420px; }
.inline-edit-box textarea { font-size: 13px; }
.inline-edit-actions { display: flex; gap: 6px; }

/* Version 74: e-faktura i Peppol */
.peppol { font-size: .85em; font-weight: 500; white-space: nowrap; }
.peppol-yes { color: var(--st-paid); }
.peppol-no { color: var(--warn-ink); }
.peppol-row .inline-form { display: inline-flex; margin-left: 6px; }
.peppol-row .notice { margin: 6px 0 0; }

/* ---------- Version 75: lister på mobil, Opfølgning uden sideskift, logoet som link ---------- */
/* Lange ord (domæner, firmanavne) brydes i stedet for at løbe ind over teksten ved siden af */
.action-text { overflow-wrap: anywhere; }
.action-list .badge { white-space: nowrap; }
.attention-badges { display: contents; }
.head-links { display: inline-flex; align-items: center; gap: 14px; }
@media (max-width: 760px) {
    /* Almindelige rækker: tal og navn på første linje, den grå forklaring på sin egen linje under */
    .action-list li { flex-wrap: wrap; row-gap: 4px; }
    .action-list li > .action-text { flex: 1 1 150px; }
    .action-list li > .muted.small { flex-basis: 100%; order: 5; }
    .action-list li > .upcoming-date ~ .muted.small { padding-left: 56px; }
    .action-list li > form, .action-list li > .btn { margin-left: auto; }
    /* Domæner at kigge på: mærkerne øverst, så navnet og knappen, og IP-adressen under navnet */
    .attention-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; row-gap: 4px; align-items: center; }
    .attention-list .attention-badges { display: flex; flex-wrap: wrap; gap: 6px; grid-column: 1 / -1; }
    .attention-list .attention-badges:empty { display: none; }
    .attention-list li > .action-text { grid-column: 1; }
    .attention-list li > .muted.small { grid-column: 1; grid-row: auto; order: 0; }
    .attention-list li > form { grid-column: 2; grid-row: 2 / span 2; margin-left: 0; }
    /* Årshjulet: mærke og opgave på én linje, datoerne under */
    .cycle-list li > .muted.small { padding-left: 0; }
    .head-links { gap: 10px; }
}

/* Rækker, der forsvinder, når de er klaret (data-inline) */
.action-list li.inline-leaving { overflow: hidden; opacity: 0; padding-top: 0; padding-bottom: 0; border-top-color: transparent; transition: height .24s ease, opacity .18s ease, padding .24s ease; }
.inline-done { color: var(--muted); font-size: 13px; white-space: nowrap; justify-self: end; }
.inline-empty { margin: 0; }
@media (prefers-reduced-motion: reduce) { .action-list li.inline-leaving { transition: none; } }

/* Kort besked nederst på skærmen, evt. med Fortryd */
.inline-toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 90; display: flex; align-items: center; gap: 14px; max-width: calc(100vw - 32px); padding: 10px 12px 10px 16px; border-radius: 12px; background: var(--side, #00413A); color: var(--side-ink, #FFFFFF); font-size: 14px; box-shadow: 0 12px 32px -10px rgba(0, 0, 0, .55); transform: translate(-50%, 140%); opacity: 0; pointer-events: none; transition: transform .22s ease, opacity .22s ease; }
.inline-toast.is-shown { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.inline-toast.is-error { background: #8C1D18; color: #FFFFFF; }
.inline-toast-undo { border: 0; border-radius: 8px; padding: 6px 10px; background: rgba(255, 255, 255, .14); color: inherit; font: inherit; font-weight: 600; cursor: pointer; }
.inline-toast-undo:hover { background: rgba(255, 255, 255, .24); }
@media (max-width: 760px) { .inline-toast { bottom: calc(96px + env(safe-area-inset-bottom)); } }
@media (prefers-reduced-motion: reduce) { .inline-toast { transition: none; } }

/* Siden Opfølgning */
.followup-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 14px; }
.followup-stat { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); text-decoration: none; }
.followup-stat strong { font-size: 24px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.followup-stat span { font-size: 13px; color: var(--muted); }
.followup-stat:hover { border-color: var(--accent); }
.followup-stat.is-late strong { color: var(--st-overdue, #B3261E); }
.followup-stat.is-empty { opacity: .55; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.chip-on .muted { color: inherit; opacity: .8; }
@media (max-width: 560px) { .followup-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
    /* Omsætning: forklaringen på én linje under overskriften */
    .panel-head:has(> .legend) { flex-wrap: wrap; row-gap: 6px; }
    .panel-head > .legend { flex-basis: 100%; gap: 12px; margin-bottom: 4px; }
}
@media (max-width: 560px) {
    /* Åbn-knappen under beløbet i stedet for midt i rækken */
    .action-table li > button, .action-table li > form { grid-column: 2; }
}

/* Set af kunden på fakturaerne (version 76) */
.badge-seen { background: var(--ok-bg); color: var(--ok-ink); }
.badge-unseen { background: var(--line-soft); color: var(--muted); }
.badge-failed { background: var(--error-bg); color: var(--error-ink); }
.badge-einvoice { background: var(--st-sent-bg); color: var(--st-sent); }

/* Lys / Mørk / Følg systemet (version 76) */
.mode-toggle .mode-light, .mode-toggle .mode-dark { display: none; }
.mode-toggle[data-mode="light"] .mode-sys, .mode-toggle[data-mode="dark"] .mode-sys { display: none; }
.mode-toggle[data-mode="light"] .mode-light, .mode-toggle[data-mode="dark"] .mode-dark { display: inline; }
.mode-pick { border: 0; margin: 0; padding: 0; display: flex; flex-direction: row; flex-wrap: wrap; gap: 8px 20px; align-items: center; }
.mode-pick legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
.mode-pick p { flex-basis: 100%; margin: 0; }


/* ---------- Temaet Moderne (version 76): ikonskinne og panel efter Thomas' forlæg ---------- */
/* Lyst: hvidt og lysegråt. Mørkt: næsten sort. Følger Mac'en eller brugerens valg (data-mode), som Thrane grøn. */
html[data-theme="moderne"] { color-scheme: light;
    --bg: #F7F7F7; --surface: #FFFFFF; --ink: #171717; --muted: #7A7A7A; --line: #E3E3E3; --line-soft: #EDEDED;
    --accent: #00413A; --accent-ink: #FFFFFF; --link: #171717;
    --side: #EDEDED; --side-ink: #3A3A3A; --side-active: #E0E0E0; --side-active-ink: #171717; --side-line: #DEDEDE; --brand: #171717;
    --rail: #F4F4F4; --rail-ink: #7A7A7A; --area-muted: #7A7A7A; --rail-new-bg: #171717; --rail-new-ink: #FFFFFF; --rail-mark: #171717; --pop: #FFFFFF;
    --btn-bg: #FFFFFF; --btn-ink: #171717; --btn-border: #DEDEDE; --btn-hover: #F0F0F0;
    --ok-bg: #DDEFE3; --ok-ink: #1C6B3F; --radius: 12px;
    --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif; }
@media (prefers-color-scheme: dark) { html[data-theme="moderne"]:not(:where([data-mode="light"])) { color-scheme: dark;
    --bg: #0D0E10; --surface: #17181B; --ink: #ECEDEF; --muted: #8B8E94; --line: #26282C; --line-soft: #1E2023;
    --accent: #72C38E; --accent-ink: #06231E; --link: #ECEDEF;
    --side: #121316; --side-ink: #CDCFD3; --side-active: #23252A; --side-active-ink: #FFFFFF; --side-line: #1F2124; --brand: #ECEDEF;
    --rail: #121316; --rail-ink: #8B8E94; --area-muted: #8B8E94; --rail-new-bg: transparent; --rail-new-ink: #ECEDEF; --rail-mark: transparent; --pop: #1B1C20;
    --btn-bg: #1B1C20; --btn-ink: #ECEDEF; --btn-border: #2B2D32; --btn-hover: #23252A;
    --ok-bg: #16302A; --ok-ink: #8FD6A7; --warn-bg: #302A1C; --warn-ink: #E8CB85; --error-bg: #36211C; --error-ink: #F4A77F;
    --st-sent: #9AB4E8; --st-sent-bg: #1D2533; --st-overdue: #F4A77F; --st-overdue-bg: #36211C; --st-paid: #8FD6A7; --st-paid-bg: #16302A;
    --st-pending: #A4A7AD; --st-pending-bg: #23252A; --st-void: #8B8E94; --st-void-bg: #1B1C20; --st-free: #A4A7AD; --st-free-bg: #23252A;
    --own-bg: #16302A; --own-ink: #8FD6A7; } }
/* Mørkt valgt pr. bruger (version 76) */
html[data-theme="moderne"]:where([data-mode="dark"]) { color-scheme: dark;
    --bg: #0D0E10; --surface: #17181B; --ink: #ECEDEF; --muted: #8B8E94; --line: #26282C; --line-soft: #1E2023;
    --accent: #72C38E; --accent-ink: #06231E; --link: #ECEDEF;
    --side: #121316; --side-ink: #CDCFD3; --side-active: #23252A; --side-active-ink: #FFFFFF; --side-line: #1F2124; --brand: #ECEDEF;
    --rail: #121316; --rail-ink: #8B8E94; --area-muted: #8B8E94; --rail-new-bg: transparent; --rail-new-ink: #ECEDEF; --rail-mark: transparent; --pop: #1B1C20;
    --btn-bg: #1B1C20; --btn-ink: #ECEDEF; --btn-border: #2B2D32; --btn-hover: #23252A;
    --ok-bg: #16302A; --ok-ink: #8FD6A7; --warn-bg: #302A1C; --warn-ink: #E8CB85; --error-bg: #36211C; --error-ink: #F4A77F;
    --st-sent: #9AB4E8; --st-sent-bg: #1D2533; --st-overdue: #F4A77F; --st-overdue-bg: #36211C; --st-paid: #8FD6A7; --st-paid-bg: #16302A;
    --st-pending: #A4A7AD; --st-pending-bg: #23252A; --st-void: #8B8E94; --st-void-bg: #1B1C20; --st-free: #A4A7AD; --st-free-bg: #23252A;
    --own-bg: #16302A; --own-ink: #8FD6A7; }
.sw-moderne span:nth-child(1) { background: #EDEDED; } .sw-moderne span:nth-child(2) { background: #F7F7F7; } .sw-moderne span:nth-child(3) { background: #0D0E10; } .sw-moderne span:nth-child(4) { background: #00413A; }

/* Flader, knapper og links */
html[data-theme="moderne"] body { background: var(--bg); letter-spacing: -0.005em; }
html[data-theme="moderne"] .main a:not([class]) { color: var(--link); text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 28%, transparent); text-underline-offset: 3px; }
html[data-theme="moderne"] .main a:not([class]):hover { text-decoration-color: currentColor; }
/* Kun almindelige tekstlinks (uden klasse); knapper, faner og mærker, der er links, beholder deres egne farver.
   I lister og tabeller står links uden streg, til musen er over dem */
html[data-theme="moderne"] .main :is(td, th, li, dt, dd, h2, h3, .action-text, .crumb) a:not([class]) { text-decoration-color: transparent; }
html[data-theme="moderne"] .main :is(td, th, li, dt, dd, h2, h3, .action-text, .crumb) a:not([class]):hover { text-decoration-color: currentColor; }
html[data-theme="moderne"] .panel { border-radius: 18px; box-shadow: none; }
html[data-theme="moderne"] .btn { border-radius: 999px; box-shadow: none; }
html[data-theme="moderne"] .btn:hover { background: var(--btn-hover); }
html[data-theme="moderne"] .btn-primary, html[data-theme="moderne"] .btn-primary:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
html[data-theme="moderne"] .tab[aria-current="page"] { border-bottom-color: var(--ink); }
html[data-theme="moderne"] h1 { font-weight: 700; letter-spacing: -0.02em; font-size: 30px; }
html[data-theme="moderne"] .crumb { font-size: 14px; margin-bottom: 8px; }
html[data-theme="moderne"] input:not([type="checkbox"]):not([type="radio"]), html[data-theme="moderne"] select, html[data-theme="moderne"] textarea { background-color: var(--surface); border-color: var(--line); border-radius: 10px; }
html[data-theme="moderne"] .dialog { border-radius: 18px; }
/* Grøn kun på knapper og status: fold-ud-links (Rediger …) står i tekstfarven */
:where(html[data-theme="moderne"] .main) summary { color: var(--ink); }
html[data-theme="moderne"] .area-new { background: var(--btn-bg); color: var(--ink); }   /* :where, så summary med egen klasse beholder sin farve */

/* Rammen: skinne, panel og indhold i en ramme med runde hjørner. Reservefarverne gælder, når et andet tema vises
   som forhåndsvisning under Farvetema, før siden er genindlæst. */
/* Den runde ramme med luft omkring (Thomas' forlæg) kun i Moderne; i de andre temaer går skinnen ud til kanten som menuen */
.rail-shell { padding: 0; min-height: 100vh; }
.frame { display: flex; flex: 1; min-width: 0; min-height: 100vh; background: var(--bg); }   /* ingen overflow: clip; Safari lader så ikke skinnen og panelet hænge fast (sticky) */
html[data-theme="moderne"] .rail-shell { padding: 10px; }
html[data-theme="moderne"] .frame { min-height: calc(100vh - 20px); }
.rail-shell .main { padding: 26px 40px 48px; }
.rail, .area { position: sticky; top: 0; align-self: flex-start; height: 100vh; overflow-y: auto; }
html[data-theme="moderne"] :is(.rail, .area) { top: 10px; height: calc(100vh - 20px); }
/* Rammen er en fast kant ovenpå (::before), der står stille, mens siden ruller; dens skygge i baggrundsfarven dækker
   luften uden for rammen. Sidens overskrift hænger fast samme sted som skinnen og panelet */
html[data-theme="moderne"] .rail-shell .page-head { top: 10px; }
html[data-theme="moderne"] .rail-shell::before { content: ""; position: fixed; inset: 10px; border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 0 0 24px var(--bg); pointer-events: none; z-index: 200; }
.rail { z-index: 20; width: 64px; flex: 0 0 64px; background: var(--rail, var(--side)); border-right: 1px solid var(--side-line); display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 0; }
.rail-areas { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.rail-btn, .rail-pop > summary { position: relative; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; border: 0; background: transparent; color: var(--rail-ink, var(--side-ink)); cursor: pointer; list-style: none; }
.rail-pop > summary::-webkit-details-marker { display: none; }
.rail .rail-icon, .rail .menu-icon, .rail svg { width: 21px; height: 21px; }
.rail-btn:hover, .rail-btn[aria-current="page"], .rail-pop > summary:hover { background: var(--side-active); color: var(--side-active-ink, #FFFFFF); }
.rail-btn[aria-current="page"]::before { content: ""; position: absolute; left: -11px; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: var(--rail-mark, var(--side-active-ink, #FFFFFF)); }
.rail-btn[aria-pressed="true"] { color: var(--side-active-ink, #FFFFFF); }
.rail .rail-new { width: 40px; height: 40px; border-radius: 50%; background: var(--rail-new-bg, var(--side-active-ink, #FFFFFF)); color: var(--rail-new-ink, var(--side)); margin-bottom: 6px; }
.rail .rail-new:hover { background: var(--rail-new-bg, var(--side-active-ink, #FFFFFF)); filter: brightness(1.25); color: var(--rail-new-ink, var(--side)); }
.rail-sep { height: 10px; flex: 0 0 auto; }
.rail-user-menu { margin-top: auto; }
.rail-user { padding: 0; }
.rail-pop > summary.rail-user { width: 40px; height: 40px; border-radius: 50%; }
.rail-user .avatar { width: 40px; height: 40px; border-radius: 50%; }
.rail-pop { position: relative; }
.rail-pop-menu { position: fixed; left: 72px; z-index: 300; min-width: 220px; padding: 6px; background: var(--pop, var(--surface)); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 32px -16px rgba(0,0,0,.35); display: flex; flex-direction: column; gap: 1px; margin-top: -40px; }
.rail-pop-up { bottom: 16px; margin-top: 0; }
.rail-pop-menu a, .rail-pop-menu button { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 10px; border: 0; border-radius: 9px; background: transparent; color: var(--ink); font: inherit; font-size: 14px; text-decoration: none; text-align: left; cursor: pointer; width: 100%; }
.rail-pop-menu a:hover, .rail-pop-menu button:hover, .rail-pop-menu a[aria-current="page"] { background: var(--side-active); }
.rail-pop-menu svg { width: 18px; height: 18px; color: var(--muted); flex: 0 0 auto; }
.rail-pop-menu kbd { margin-left: auto; }
.rail-pop-menu form { margin: 0; }
.rail-pop-head { margin: 4px 10px 6px; font-weight: 600; font-size: 14px; }
.area { width: 284px; flex: 0 0 284px; background: var(--side); border-right: 1px solid var(--side-line); padding: 0 14px 24px; }
.area-head { display: flex; align-items: center; height: 64px; margin: 0 -14px 14px; padding: 0 22px; border-bottom: 1px solid var(--side-line); }
.area-head h2 { margin: 0; font-size: 17px; font-weight: 700; }
.area-head h2 a { color: var(--side-active-ink, #FFFFFF); text-decoration: none; }
.area-new { display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 16px; border: 1px solid var(--side-line); border-radius: 999px; background: var(--side-active); color: var(--side-active-ink, #FFFFFF); text-decoration: none; font-weight: 500; margin-bottom: 14px; }
.area-new:hover { filter: brightness(1.08); }
.area-new svg { width: 16px; height: 16px; }
.area h3 { font-size: 13px; font-weight: 500; color: var(--area-muted, color-mix(in srgb, var(--side-ink) 70%, var(--side))); margin: 16px 10px 6px; }
.area ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.area li a { display: flex; align-items: center; gap: 12px; min-height: 38px; padding: 0 10px; border-radius: 10px; color: var(--side-ink); text-decoration: none; }
.area li a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.area li a svg { width: 17px; height: 17px; color: var(--area-muted, color-mix(in srgb, var(--side-ink) 70%, var(--side))); flex: 0 0 auto; }
.area li a:hover { background: var(--side-active); }
.area li a[aria-current="page"] { background: var(--side-active); color: var(--side-active-ink, #FFFFFF); }
.area-empty { margin: 0 10px; }
body.menu-mini .area { display: none; }
.rail-shell .quick { right: 26px; bottom: 26px; }

/* Søgning på tværs */
.search-dialog { max-width: 640px; padding: 0; margin-top: 12vh; overflow: hidden; }
.search-dialog::backdrop { background: rgba(0,0,0,.25); }
.search-form { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.search-form svg { width: 20px; height: 20px; color: var(--muted); flex: 0 0 auto; }
.search-form input::-webkit-search-cancel-button { display: none; }
.search-form input { flex: 1; border: 0 !important; background: transparent !important; font-size: 17px; padding: 6px 0; min-height: 0; box-shadow: none; outline: none; }
.search-live { max-height: 60vh; overflow-y: auto; padding: 6px 8px 10px; }
.search-live:empty { display: none; }
.search-live h3 { font-size: 12px; font-weight: 500; color: var(--muted); margin: 10px 10px 4px; }
.search-live ul, .search-results { list-style: none; margin: 0; padding: 0; }
.search-live a, .search-results a { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; color: var(--ink); text-decoration: none !important; }
.search-live a > span, .search-results a > span { display: flex; flex-direction: column; min-width: 0; }
.search-live a strong, .search-results a strong { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-live svg, .search-results svg { width: 18px; height: 18px; color: var(--muted); flex: 0 0 auto; }
.search-live a:hover, .search-live a.is-selected, .search-results a:hover { background: var(--side-active); }
.search-none { margin: 10px; }

@media (max-width: 1100px) {
    .area { width: 240px; flex-basis: 240px; }
    .rail-shell .main { padding: 22px 24px 40px; }
}
@media (max-width: 760px) {
    .rail-shell, html[data-theme="moderne"] .rail-shell { padding: 0; }
    html[data-theme="moderne"] .rail-shell::before { display: none; }
    .frame, html[data-theme="moderne"] .frame { flex-direction: column; border: 0; border-radius: 0; min-height: 100vh; overflow: visible; }
    .rail, html[data-theme="moderne"] .rail { position: sticky; top: 0; z-index: 250; width: 100%; height: 56px; flex: 0 0 auto; flex-direction: row; padding: 0 8px; border-right: 0; border-bottom: 1px solid var(--side-line); overflow-x: auto; overflow-y: hidden; }
    .rail-areas { flex-direction: row; }
    .rail-sep { display: none; }
    .rail .rail-new { margin: 0 4px 0 0; flex: 0 0 auto; }
    .rail-btn { flex: 0 0 auto; }
    .rail-btn[aria-current="page"]::before { display: none; }
    .rail-user-menu { margin: 0 0 0 auto; }
    .rail-pop-menu { left: 8px; right: 8px; top: 60px; bottom: auto; margin: 0; }
    .area, html[data-theme="moderne"] .area { display: none; position: fixed; top: 56px; left: 0; bottom: 0; z-index: 240; height: auto; width: min(300px, 86vw); box-shadow: 0 20px 40px -20px rgba(0,0,0,.5); }
    body.area-open .area, body.menu-mini.area-open .area { display: block; }
    body.menu-mini .area { display: none; }
    .rail-shell .main { padding: 20px 16px 40px; }
}

/* Tekst under ikonerne i skinnen (version 76) */
.rail-label { display: none; }
.rail-pop-menu .rail-check { margin-left: auto; color: var(--ink); visibility: hidden; }
.rail-pop-menu [aria-checked="true"] .rail-check { visibility: visible; }
body.rail-labels .rail { width: 92px; flex-basis: 92px; }
body.rail-labels .rail-btn { width: 84px; text-decoration: none; height: auto; min-height: 50px; padding: 7px 2px 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; }
body.rail-labels .rail-label { display: block; max-width: 82px; font-size: 10.5px; letter-spacing: -0.01em; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.rail-labels .rail-btn[aria-current="page"]::before { left: -4px; }
.rail-btn { text-decoration: none; }
body.rail-labels .rail-pop-menu { left: 100px; }
@media (max-width: 760px) {
    body.rail-labels .rail { width: 100%; }
    body.rail-labels .rail-btn { width: 42px; min-height: 42px; padding: 0; }
    body.rail-labels .rail-label { display: none; }
    body.rail-labels .rail-pop-menu { left: 8px; }
}

/* Version 77: produktark og vedhæftede filer */
.sheet-links li { align-items: center; }
.sheet-links li > .actions, .sheet-links li > form { margin-left: auto; }
.sheet-name { font-weight: 600; }
.sheet-current { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sheet-current .actions { margin: 0 0 0 auto; }
.send-options .sheet-check-name { font-weight: 600; }

/* Klippekort (version 79) */
.punch-minus { color: var(--error-ink); }
.punch-balance { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; }
.punch-balance strong { font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.punch-rate { flex: 1 1 100%; max-width: 240px; }
.punch-plus { color: var(--ok-ink); }
.punch-ledger td.num { font-variant-numeric: tabular-nums; }

/* Version 82: databehandleraftalens flueben på Send tilbud, rykket ind under fluebenet "Send databehandleraftalen med" */
.dpa-send-flags { margin: 2px 0 6px 32px; }
.dpa-send-flags > p { margin: 0; }
.dpa-send-flags .check-row { margin: 8px 0; }
.sp-check { margin: 4px 0 0; }
