/* =====================================================================
   BogKeeper designsystem v2 – lyst, hypermoderne, stilrent
   Kølige hvide flader, sort som primær handling, én varm ember-accent brugt
   sparsomt (logo, fokus, aktiv-markør, nøgletal), Geist med tabulære tal,
   hårfine kanter, store bløde radier, glas-topbar og rolig bevægelse.
   Lyst tema er standard; mørkt kan vælges i brugermenuen.
   Bevidst langt fra Dineros blå/navy/teal og Lexend.
   ===================================================================== */

@font-face { font-family: "Geist"; src: url("/fonts/Geist-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/fonts/GeistMono-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #F6F7F9;              /* lærred – kølig, næsten hvid */
  --surface: #FFFFFF;
  --surface-2: #F3F4F6;       /* hover, indlejrede flader */
  --surface-3: #ECEDF1;       /* aktiv, chips */
  --border: #E8E9ED;          /* hårfin */
  --border-strong: #D9DBE1;
  --text: #0B0C0F;
  --text-2: #565B66;
  --text-3: #8A8F9A;
  --ink: #0B0C0F;             /* primær knap */
  --ink-text: #FFFFFF;
  --accent: #FF5A1F;          /* ember */
  --accent-2: #FF8A3D;
  --accent-text: #C2410C;     /* ember som tekst (AA på hvid) */
  --accent-soft: #FFF1EA;
  --pos: #0F7B45; --pos-soft: #E7F6EE;
  --neg: #D1281B; --neg-soft: #FDECEA;
  --warn: #A35A00; --warn-soft: #FFF4E0;
  --info: #4B5565; --info-soft: #EFF1F5;
  --ai: #7C3AED; --ai-soft: #F3EEFF;
  --focus: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent);
  --shadow-xs: 0 1px 1px rgb(16 18 24 / .03);
  --shadow-sm: 0 1px 2px rgb(16 18 24 / .04), 0 1px 1px rgb(16 18 24 / .02);
  --shadow: 0 1px 2px rgb(16 18 24 / .04), 0 8px 24px -8px rgb(16 18 24 / .08);
  --shadow-lg: 0 24px 64px -12px rgb(16 18 24 / .22), 0 4px 12px rgb(16 18 24 / .06);
  --r-sm: 9px; --r: 12px; --r-lg: 16px; --r-xl: 22px;
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --sidebar-w: 256px;
  --topbar-h: 60px;
  --ease: cubic-bezier(.22, .8, .24, 1);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0A0B0D; --surface: #121317; --surface-2: #17191E; --surface-3: #1F2127;
  --border: #23252C; --border-strong: #30333B; --text: #EEF0F3; --text-2: #A9AEB8; --text-3: #737985;
  --ink: #F2F3F5; --ink-text: #0A0B0D; --accent: #FF6A33; --accent-2: #FF9550; --accent-text: #FF8A5C; --accent-soft: #2A160D;
  --pos: #3DDC84; --pos-soft: #0E2419; --neg: #FF6B60; --neg-soft: #2C1513; --warn: #F5B74A; --warn-soft: #2A2111;
  --info: #A7B2C2; --info-soft: #1A1F27; --ai: #B794F6; --ai-soft: #211A33;
  --shadow-xs: none; --shadow-sm: 0 1px 2px rgb(0 0 0 / .5); --shadow: 0 1px 2px rgb(0 0 0 / .5), 0 8px 24px rgb(0 0 0 / .4);
  --shadow-lg: 0 24px 64px rgb(0 0 0 / .7); color-scheme: dark;
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 14px/1.55 var(--font); letter-spacing: -0.006em;
  font-feature-settings: "tnum" 1, "cv11" 1, "ss01" 1; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
a.link { color: var(--accent-text); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent-text) 35%, transparent); text-underline-offset: 3px; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.028em; }
h1 { font-size: 30px; line-height: 1.12; letter-spacing: -0.035em; }
h2 { font-size: 16px; line-height: 1.3; letter-spacing: -0.018em; }
h3 { font-size: 14px; letter-spacing: -0.01em; }
p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: 0.9em; letter-spacing: 0; }
::selection { background: color-mix(in srgb, var(--accent) 20%, transparent); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }
.muted { color: var(--text-2); }
.subtle { color: var(--text-3); }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { display: inline-flex; width: 16px; height: 16px; flex: none; }
.icon svg { width: 100%; height: 100%; }
.icon.lg { width: 20px; height: 20px; }
.row { display: flex; align-items: center; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.spacer { flex: 1; }
.grow { flex: 1; min-width: 0; }
.stack.tight { gap: 8px; }
.stack.loose { gap: 20px; }
.mt-8 { margin-top: 8px; }
.small { font-size: 12.5px; }
.pointer { cursor: pointer; }
.h-180 { height: 180px; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }

/* ------------------------------------------------------------------ knapper */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px;
  border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: 500 13.5px/1 var(--font); letter-spacing: -0.01em; cursor: pointer; white-space: nowrap; user-select: none;
  box-shadow: var(--shadow-xs); transition: background .16s var(--ease), border-color .16s var(--ease), box-shadow .16s var(--ease), transform .08s;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary {
  background: var(--ink); color: var(--ink-text); border-color: var(--ink);
  box-shadow: 0 1px 2px rgb(16 18 24 / .18), inset 0 1px 0 rgb(255 255 255 / .08);
}
.btn.primary:hover { background: color-mix(in srgb, var(--ink) 84%, var(--bg)); }
.btn.accent { background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: #fff; border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.danger { color: var(--neg); }
.btn.danger:hover { background: var(--neg-soft); border-color: color-mix(in srgb, var(--neg) 28%, transparent); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn.lg { height: 46px; padding: 0 20px; font-size: 15px; border-radius: var(--r); }
.btn.block { width: 100%; }
.btn.icon-only { width: 36px; padding: 0; }
.btn.sm.icon-only { width: 30px; }
.kbd { font: 500 11px/1 var(--mono); padding: 3px 6px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-3); }

/* ------------------------------------------------------------------ felter */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label { font-size: 12.5px; font-weight: 550; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--text-3); }
.field .error { font-size: 12.5px; color: var(--neg); }
.input, select.input, textarea.input {
  height: 40px; width: 100%; padding: 0 13px; border-radius: var(--r-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: 400 14px var(--font); box-shadow: var(--shadow-xs);
  transition: border-color .16s, box-shadow .16s;
}
textarea.input { height: auto; padding: 10px 13px; resize: vertical; }
select.input {
  appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238A8F9A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; background-size: 15px;
}
.input::placeholder { color: var(--text-3); }
.input:hover { border-color: var(--border-strong); }
.input:focus { outline: none; border-color: color-mix(in srgb, var(--accent) 70%, var(--border)); box-shadow: var(--focus); }
.input.code { font: 500 24px/1 var(--mono); letter-spacing: .45em; text-align: center; height: 56px; }
.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13.5px; }
.check input { width: 16px; height: 16px; accent-color: var(--ink); }

/* ------------------------------------------------------------------ kort, chips, tabeller */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.card.pad { padding: 22px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.card-head > .icon { color: var(--text-3); }
.card-head h2 { font-size: 15px; }
.card-body { padding: 22px; }
.stat { padding: 20px 22px; display: flex; flex-direction: column; gap: 8px; position: relative; overflow: hidden; }
.stat .label { font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: 7px; font-weight: 500; }
.stat .label .icon { color: var(--text-3); }
.stat .value { font-size: 30px; font-weight: 600; letter-spacing: -0.04em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.stat .delta { font-size: 12.5px; }
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px;
  font: 550 11.5px/1 var(--font); letter-spacing: -0.005em; background: var(--surface-3); color: var(--text-2); white-space: nowrap;
}
.badge.pos { background: var(--pos-soft); color: var(--pos); }
.badge.neg { background: var(--neg-soft); color: var(--neg); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.ai { background: var(--ai-soft); color: var(--ai); }
.badge.accent { background: var(--accent-soft); color: var(--accent-text); }
.badge .icon { width: 12px; height: 12px; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.table th {
  text-align: left; font-weight: 550; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3);
  padding: 11px 18px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface);
  position: sticky; top: 0; z-index: 1;
}
.table td { padding: 14px 18px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.table .actions { text-align: right; white-space: nowrap; }
.table th.num { text-align: right; }
.table select.input { width: auto; min-width: 170px; max-width: 100%; height: 34px; }
.table select.input.add-member { width: 100%; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  background: var(--surface-3); color: var(--text-2); font: 600 11.5px/1 var(--font); text-transform: uppercase;
}
.avatar.org { border-radius: 9px; background: linear-gradient(135deg, #17181C, #3A3D46); color: #fff; }
.empty {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 56px 24px; color: var(--text-2);
}
.empty .icon { width: 44px; height: 44px; padding: 11px; border-radius: 14px; background: var(--surface); color: var(--text-3); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.empty h3 { color: var(--text); font-size: 15.5px; letter-spacing: -0.02em; }
.empty p { max-width: 46ch; }
.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface-2); font-size: 13.5px; }
.callout.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 18%, transparent); }
.callout.neg { background: var(--neg-soft); border-color: color-mix(in srgb, var(--neg) 18%, transparent); }
.callout.pos { background: var(--pos-soft); border-color: color-mix(in srgb, var(--pos) 18%, transparent); }
.callout.ai { background: var(--ai-soft); border-color: color-mix(in srgb, var(--ai) 18%, transparent); }
.callout > .icon { margin-top: 2px; }
.divider { height: 1px; background: var(--border); margin: 4px 0; }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; border-radius: 8px; min-height: 14px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.phase-list .badge { min-width: 50px; justify-content: center; }

/* ------------------------------------------------------------------ app-skal */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 2px; padding: 14px 12px;
  background: var(--surface); border-right: 1px solid var(--border); overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 14px; font-weight: 650; letter-spacing: -0.03em; font-size: 16px; }
.logo {
  width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; position: relative; overflow: hidden;
  background: linear-gradient(135deg, #17181C, #3A3D46); box-shadow: inset 0 1px 0 rgb(255 255 255 / .12), 0 1px 2px rgb(16 18 24 / .2);
}
.logo::before { content: ""; width: 12px; height: 12px; border-radius: 4px; background: linear-gradient(135deg, var(--accent-2), var(--accent)); transform: rotate(12deg); }
.org-switch {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: var(--r); border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; text-align: left; font: inherit; color: inherit; box-shadow: var(--shadow-xs);
  transition: border-color .15s, background .15s;
}
.org-switch:hover { border-color: var(--border-strong); background: var(--surface-2); }
.org-switch .meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.org-switch .name { font-weight: 600; font-size: 13.5px; letter-spacing: -0.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.org-switch .sub { font-size: 12px; color: var(--text-3); }
.nav-group { font-size: 10.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--text-3); padding: 18px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 11px; height: 36px; padding: 0 10px; border-radius: 10px;
  color: var(--text-2); font-weight: 500; font-size: 13.5px; letter-spacing: -0.01em; position: relative; transition: background .14s, color .14s;
}
.nav a .icon { color: var(--text-3); transition: color .14s; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a:hover .icon { color: var(--text-2); }
.nav a.active { background: var(--surface-3); color: var(--text); font-weight: 600; }
.nav a.active .icon { color: var(--text); }
.nav a.active::after { content: ""; position: absolute; right: 10px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.nav a .badge { margin-left: auto; height: 19px; font-size: 10.5px; padding: 0 7px; background: transparent; border: 1px solid var(--border); color: var(--text-3); }
.nav a.active .badge { display: none; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; padding-top: 12px; border-top: 1px solid var(--border); }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--topbar-h); display: flex; align-items: center; gap: 12px; padding: 0 28px;
  background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--text-3); font-size: 13.5px; min-width: 0; }
.crumbs b { color: var(--text); font-weight: 600; letter-spacing: -0.015em; }
.search-btn {
  display: flex; align-items: center; gap: 9px; height: 36px; width: min(360px, 40vw); padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-3); font: inherit; font-size: 13.5px; cursor: pointer; box-shadow: var(--shadow-xs);
  transition: border-color .15s, box-shadow .15s;
}
.search-btn:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.search-btn .kbd { margin-left: auto; }
.content { padding: 36px 40px 72px; width: 100%; max-width: 1320px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding-bottom: 4px; }
.page-head .titles { display: flex; flex-direction: column; gap: 6px; }
.page-head .titles > p { font-size: 14.5px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; }
.tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 11px; background: var(--surface-3); }
.tabs a { padding: 6px 12px; font-size: 13px; font-weight: 500; color: var(--text-2); border-radius: 8px; }
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--text); background: var(--surface); box-shadow: var(--shadow-sm); }

/* ------------------------------------------------------------------ menu, dialog, palet, toast */
.menu {
  position: absolute; z-index: 60; min-width: 220px; padding: 6px; border-radius: var(--r); border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(20px); box-shadow: var(--shadow-lg); animation: pop .16s var(--ease);
}
.menu button, .menu a {
  display: flex; align-items: center; gap: 9px; width: 100%; height: 34px; padding: 0 10px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text); font: 450 13.5px var(--font); cursor: pointer; text-align: left;
}
.menu button:hover, .menu a:hover, .menu .on { background: var(--surface-2); }
.menu .label { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); padding: 8px 10px 4px; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.985); } }
.overlay { position: fixed; inset: 0; z-index: 80; background: rgb(15 17 22 / .28); backdrop-filter: blur(6px); display: grid; place-items: start center; padding: 12vh 16px 16px; animation: fade .18s; }
@keyframes fade { from { opacity: 0; } }
.dialog { width: min(520px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); animation: pop .18s var(--ease); }
.dialog header { padding: 24px 26px 6px; display: flex; flex-direction: column; gap: 6px; }
.dialog header h2 { font-size: 18px; }
.dialog .body { padding: 16px 26px; display: flex; flex-direction: column; gap: 16px; }
.dialog footer { padding: 16px 26px 24px; display: flex; gap: 8px; justify-content: flex-end; }
.palette { width: min(640px, 100%); overflow: hidden; }
.palette .search { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.palette .search input { flex: 1; border: 0; background: transparent; font: 400 16px var(--font); color: var(--text); outline: none; letter-spacing: -0.01em; }
.palette .results { max-height: 52vh; overflow-y: auto; padding: 8px; }
.palette .item { display: flex; align-items: center; gap: 11px; height: 40px; padding: 0 12px; border-radius: 10px; cursor: pointer; color: var(--text-2); }
.palette .item.on { background: var(--surface-2); color: var(--text); }
.palette .item .kbd { margin-left: auto; }
.toasts { position: fixed; right: 24px; bottom: 24px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast {
  display: flex; align-items: center; gap: 10px; min-width: 260px; max-width: 440px; padding: 12px 16px; border-radius: 14px;
  background: #0B0C0F; color: #F4F5F7; box-shadow: var(--shadow-lg); font-size: 13.5px; animation: pop .2s var(--ease);
}
.toast.neg .icon { color: #FF7A70; }
.toast.pos .icon { color: #3DDC84; }

/* ------------------------------------------------------------------ login (lyst) */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); background: var(--surface); }
.auth-panel { display: flex; flex-direction: column; justify-content: center; padding: 56px clamp(24px, 7vw, 112px); }
.auth-form { width: min(380px, 100%); display: flex; flex-direction: column; gap: 20px; }
.auth-form h1 { font-size: 32px; }
.auth-art {
  position: relative; overflow: hidden; margin: 14px; border-radius: 28px; padding: 56px; display: flex; flex-direction: column; justify-content: flex-end;
  background:
    radial-gradient(60% 55% at 78% 18%, rgb(255 138 61 / .55), transparent 70%),
    radial-gradient(55% 50% at 18% 78%, rgb(255 90 31 / .28), transparent 70%),
    radial-gradient(70% 60% at 60% 70%, rgb(255 214 190 / .9), transparent 75%),
    linear-gradient(160deg, #FFF8F3, #FDEEE5);
  color: var(--text); border: 1px solid #F6E3D8;
}
.auth-art::before { content: none; }
.auth-art .ledger {
  position: absolute; inset: 0; background-image: linear-gradient(rgb(11 12 15 / .05) 1px, transparent 1px);
  background-size: 100% 34px; mask-image: linear-gradient(to bottom, transparent 5%, black 45%, black 70%, transparent 95%);
}
.auth-art blockquote { position: relative; margin: 0; font-size: 30px; line-height: 1.15; letter-spacing: -0.035em; font-weight: 600; max-width: 18ch; }
.auth-art .meta { position: relative; margin-top: 18px; font-size: 13.5px; color: var(--text-2); }
.qr { width: 204px; height: 204px; padding: 12px; border-radius: var(--r-lg); background: #fff; border: 1px solid var(--border); align-self: center; box-shadow: var(--shadow-sm); }
.qr svg { width: 100%; height: 100%; }
.secret { font: 500 13px var(--mono); letter-spacing: .08em; padding: 9px 11px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px dashed var(--border-strong); word-break: break-all; text-align: center; }
.steps { display: flex; gap: 6px; }
.steps i { flex: 1; height: 4px; border-radius: 4px; background: var(--surface-3); }
.steps i.on { background: linear-gradient(90deg, var(--accent-2), var(--accent)); }

/* ------------------------------------------------------------------ bank */
button.card.acct { text-align: left; font: inherit; color: inherit; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
button.card.acct:hover { border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-1px); }
button.card.acct.selected { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink), var(--shadow); }
td.neg, .num.neg { color: var(--neg); }
td.pos, .num.pos { color: var(--pos); }

/* ------------------------------------------------------------------ bogføring og rapporter */
.tabs { flex-wrap: wrap; align-self: flex-start; max-width: 100%; }
.tabs a { display: inline-flex; align-items: center; gap: 7px; }
.tabs a .icon { width: 15px; height: 15px; color: var(--text-3); }
.tabs a.active .icon { color: var(--text); }
.row.wrap, .card-head.wrap { flex-wrap: wrap; }
.center { display: flex; justify-content: center; }
.nowrap { white-space: nowrap; }
.clip { display: inline-block; max-width: 46ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.w-auto { width: auto !important; }
.h-32 { height: 32px; margin-top: 6px; }
.input.sm { height: 32px; font-size: 13px; padding: 0 10px; border-radius: 8px; }
select.input.sm { padding-right: 30px; background-position: right 9px center; }
.filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filters .input[type=date] { width: 150px; }
.search-field { position: relative; display: flex; align-items: center; }
.search-field > .icon { position: absolute; left: 10px; color: var(--text-3); pointer-events: none; width: 15px; height: 15px; }
.search-field .input { padding-left: 32px; min-width: 220px; }
.table.compact td, .table.compact th { padding: 8px 12px; }
.table.clickable tbody tr { cursor: pointer; }
.table tfoot td { padding: 12px 18px; border-top: 1px solid var(--border-strong); background: var(--surface-2); }
.table.compact tfoot td { padding: 9px 12px; }
.vat-line td { color: var(--text-2); }
.vat-line td:first-child { padding-left: 26px; }
.link-card { display: flex; color: inherit; transition: border-color .15s, box-shadow .15s, transform .15s; }
a.callout.link-card { align-items: center; }
.link-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-1px); }
.badge .icon { margin-left: -2px; }

/* kassekladde: regneark med celler der først viser kant ved hover/fokus */
.kladde.drop { outline: 2px dashed color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: -6px; }
.kladde-table { min-width: 1080px; }
.kladde-table th { padding: 10px 8px; }
.kladde-table th:first-child { padding-left: 18px; }
.kladde-table td { padding: 4px 4px; border-bottom: 0; vertical-align: top; }
.kladde-table td:first-child { padding-left: 18px; }
.kladde-table tbody tr:hover td { background: transparent; }
.c-no { width: 44px; }
.c-date { width: 150px; }
.c-acc { width: 150px; }
.c-vat { width: 92px; }
.c-amt { width: 140px; }
.c-att { width: 70px; }
.c-act { width: 40px; }
.cell {
  width: 100%; height: 34px; padding: 0 9px; border-radius: 8px; border: 1px solid transparent; background: transparent;
  color: var(--text); font: 400 13.5px var(--font); transition: border-color .12s, background .12s, box-shadow .12s;
}
.cell.mono { font-family: var(--mono); font-size: 13px; }
.cell.num { text-align: right; font-variant-numeric: tabular-nums; }
.cell::placeholder { color: var(--text-3); }
.cell:hover:not(:disabled) { border-color: var(--border); background: var(--surface); }
.cell:focus { outline: none; border-color: color-mix(in srgb, var(--accent) 70%, var(--border)); background: var(--surface); box-shadow: var(--focus); }
select.cell {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 22px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238A8F9A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 6px center; background-size: 13px;
}
.cell:disabled { cursor: default; }
input[type=date].cell { padding-right: 4px; }
.cell-sub { display: block; padding: 0 10px 2px; font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; min-height: 2px; }
.cell-sub.neg { color: var(--neg); }
tbody.jv > tr:first-child > td { padding-top: 10px; }
tbody.jv.drop > tr > td { background: var(--accent-soft) !important; }
tbody.jv + tbody.jv > tr:first-child > td { border-top: 1px solid var(--border); }
.jv-no {
  display: inline-grid; place-items: center; min-width: 26px; height: 26px; margin-top: 4px; padding: 0 6px; border-radius: 8px;
  background: var(--surface-3); color: var(--text-2); font: 600 12px var(--mono);
}
tbody.jv.ok .jv-no { background: var(--pos-soft); color: var(--pos); }
.jv-foot td { padding: 2px 8px 12px 4px !important; }
.jv-foot .row { gap: 6px; min-height: 30px; padding-left: 6px; }
.jv-err { font-size: 12.5px; color: var(--text-2); }
.jv-preview { margin: 8px 0 2px 6px; padding: 8px; border-radius: var(--r); background: var(--surface-2); max-width: 760px; }
.jv-preview .table td { border-bottom-color: var(--border); background: transparent; }
.jv-errors { margin: 2px 0 8px; padding-left: 20px; color: var(--warn); font-size: 12.5px; }
.btn.att { gap: 4px; padding: 0 8px; color: var(--text-3); margin-top: 2px; }
.btn.att.has { color: var(--pos); background: var(--pos-soft); }
.btn.att.internal { color: var(--info); background: var(--info-soft); }
.kladde-hint { display: flex; align-items: center; gap: 8px; padding: 12px 22px 16px; border-top: 1px solid var(--border); }

/* bilagsfiler */
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.att-card { display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface); color: inherit; }
a.att-card:hover { border-color: var(--border-strong); }
.att-link { display: flex; flex-direction: column; gap: 6px; color: inherit; }
.att-card img { width: 100%; height: 110px; object-fit: cover; border-radius: 8px; background: var(--surface-2); }
.att-icon { display: grid; place-items: center; height: 110px; border-radius: 8px; background: var(--surface-2); color: var(--text-3); }
.att-icon .icon { width: 28px; height: 28px; }
.att-name { font-size: 12.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dialog.wide { width: min(880px, 100%); }
.overlay { overflow-y: auto; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; font-size: 13px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; }
.dialog footer { align-items: center; flex-wrap: wrap; }
.dialog footer .spacer { flex: 1; }

/* kontoplan og rapporter */
.c-num { width: 82px; }
.chart tr.h td, .stmt tr.h td {
  padding-top: 22px; padding-bottom: 8px; font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--text-3);
  background: transparent !important;
}
.chart tr.s td { color: var(--text-2); font-style: italic; background: transparent !important; }
.chart tr.is-hidden td { opacity: .55; }
.chart td.actions { white-space: nowrap; width: 1%; }
.stmt td { padding-top: 9px; padding-bottom: 9px; }
.stmt tr.acc td:nth-child(2) a { color: var(--text); }
.stmt tr.acc td:nth-child(2) a:hover { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }
.stmt tr.virtual td { color: var(--text-2); }
.stmt tr.s td { font-weight: 600; border-top: 1px solid var(--border-strong); background: var(--surface-2); }
.stmt tr.s.total td { font-size: 15px; border-top: 2px solid var(--text); background: var(--surface); padding-top: 14px; padding-bottom: 14px; }
.stmt tbody tr.acc:hover td { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.stmt-note { display: flex; align-items: center; gap: 8px; padding: 14px 22px; }
.report-filters { padding: 14px 18px; border-bottom: 1px solid var(--border); }
.report.busy .table-wrap { opacity: .55; transition: opacity .2s; }
.acct-pick { width: 150px; }
tr.primo td { background: var(--surface-2); }
.stat-inline { display: flex; flex-direction: column; gap: 2px; }
.stat-inline .big { font-size: 26px; letter-spacing: -0.03em; }
.guide { white-space: pre-wrap; line-height: 1.7; color: var(--text); max-width: 80ch; font-size: 14.5px; }
.guide-edit { min-height: 420px; font: 400 14px/1.6 var(--mono); }

@media print {
  .sidebar, .topbar, .page-head .actions, .tabs, .filters, .toasts, .kladde-hint, .stmt-note { display: none !important; }
  .shell { display: block; }
  body { background: #fff; }
  .content { padding: 0; max-width: none; }
  .card { border: 0; box-shadow: none; }
  .table th { position: static; }
}

/* ------------------------------------------------------------------ offentlige sider (privatliv, vilkår) */
.legal { max-width: 720px; gap: 14px; padding-top: 56px; }
.legal h2 { margin-top: 14px; }
.legal p, .legal li { color: var(--text-2); line-height: 1.7; }
.legal .brand { padding: 0 0 24px; }

/* ------------------------------------------------------------------ responsivt */
@media (max-width: 960px) {
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; z-index: 70; inset: 0 auto 0 0; width: min(300px, 86vw); transform: translateX(-102%); transition: transform .24s var(--ease); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .topbar { padding: 0 16px; }
  .content { padding: 22px 16px 56px; }
  .search-btn { width: auto; }
  .search-btn .label, .search-btn .kbd { display: none; }
  .crumbs > span:first-child, .crumbs > .icon { display: none; }
  .crumbs b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  h1 { font-size: 26px; }
}
@media (max-width: 600px) {
  .card-head { flex-wrap: wrap; padding: 14px 16px; }
  .card-head .subtle.small { white-space: nowrap; }
  .stmt th, .stmt td { padding-left: 12px; padding-right: 12px; }
  .stmt th { white-space: normal; }
  .stmt td:first-child, .stmt th:first-child { display: none; }
  .report-filters { padding: 12px 14px; }
  .filters .input[type=date] { width: 138px; }
  .search-field .input { min-width: 0; width: 100%; }
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 15px; }
  .stat .value { font-size: 22px; }
  h1 { font-size: 24px; }
}
@media (min-width: 961px) { .only-mobile { display: none !important; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.plan-h { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13.5px; }
.plan-list { max-height: 260px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--r); }
.warn-text { color: var(--warn); }
