/* ==========================================================================
   ClearShare design system – light & dark, Schibsted Grotesk (som clearshare.dk), Lucide icons
   ========================================================================== */
@font-face { font-family: "Schibsted Grotesk"; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url("/fonts/schibsted-grotesk-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Schibsted Grotesk"; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url("/fonts/schibsted-grotesk-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  color-scheme: light;
  --bg: #f2f7f5;
  --surface: #ffffff;
  --surface-2: #f3f5f8;
  --surface-3: #eaeef3;
  --border: #dde7e4;
  --border-strong: #cbdad6;
  --text: #0e2a33;
  --text-2: #3f5961;
  --muted: #5f777e;
  --primary: #127a6b;
  --primary-hover: #0b5c50;
  --primary-soft: rgba(18, 122, 107, .10);
  --primary-ink: #ffffff;
  --ring: rgba(18, 122, 107, .35);
  /* clearshare.dk brand */
  --ink: #0e2a33;
  --marker: #ffe45c;
  --mist: #eaf1ef;
  --crit: #dc2626; --crit-soft: rgba(220, 38, 38, .10);
  --high: #ea580c; --high-soft: rgba(234, 88, 12, .11);
  --med: #ca8a04;  --med-soft: rgba(202, 138, 4, .13);
  --low: #64748b;  --low-soft: rgba(100, 116, 139, .12);
  --ok: #059669;   --ok-soft: rgba(5, 150, 105, .11);
  --info: #2563eb; --info-soft: rgba(37, 99, 235, .10);
  --violet: #7c3aed; --violet-soft: rgba(124, 58, 237, .10);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 4px 12px rgba(16, 24, 40, .04);
  --shadow-lg: 0 20px 50px -12px rgba(16, 24, 40, .25);
  --radius: 12px;
  --radius-sm: 8px;
  --sb-w: 252px;
  --font: "Schibsted Grotesk", "Helvetica Neue", "Segoe UI", Arial, sans-serif;
  --mono: "Cascadia Mono", Consolas, ui-monospace, monospace;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0d12;
  --surface: #10151c;
  --surface-2: #151b23;
  --surface-3: #1c2430;
  --border: #212a36;
  --border-strong: #2e3a4a;
  --text: #e7edf4;
  --text-2: #c3cdd9;
  --muted: #8a97a8;
  --primary: #3fbfa9;
  --primary-hover: #6fd6c4;
  --primary-soft: rgba(63, 191, 169, .12);
  --primary-ink: #04201c;
  --ring: rgba(63, 191, 169, .35);
  --ink: #e7edf4;
  --mist: #0a0d12;
  --crit: #f87171; --crit-soft: rgba(248, 113, 113, .13);
  --high: #fb923c; --high-soft: rgba(251, 146, 60, .13);
  --med: #facc15;  --med-soft: rgba(250, 204, 21, .12);
  --low: #94a3b8;  --low-soft: rgba(148, 163, 184, .12);
  --ok: #34d399;   --ok-soft: rgba(52, 211, 153, .12);
  --info: #60a5fa; --info-soft: rgba(96, 165, 250, .12);
  --violet: #a78bfa; --violet-soft: rgba(167, 139, 250, .13);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px rgba(0, 0, 0, .25);
  --shadow-lg: 0 24px 60px -12px rgba(0, 0, 0, .7);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14.5px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.015em; color: var(--text); }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 16px; font-weight: 650; }
h3 { font-size: 14px; font-weight: 600; }
p { margin: 0 0 10px; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
::selection { background: var(--primary-soft); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.xs { font-size: 11.5px; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.hidden { display: none !important; }
.ic { width: 18px; height: 18px; flex: 0 0 auto; vertical-align: -3px; }
.ic.sm { width: 15px; height: 15px; vertical-align: -2px; }
.ic.lg { width: 22px; height: 22px; }
.ic.xl { width: 40px; height: 40px; stroke-width: 1.5; }

/* ---------- App shell ---------- */
.shell { display: grid; grid-template-columns: var(--sb-w) minmax(0, 1fr); min-height: 100vh; }
.sb { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--border); padding: 14px 12px; z-index: 30; }
.sb-brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 18px; color: var(--text); font-weight: 750; font-size: 17px; letter-spacing: -0.02em; }
.sb-brand:hover { color: var(--text); }
/* Logo som på clearshare.dk: mørk firkant med gul markeringsstreg */
.logo-mark { width: 30px; height: 30px; flex: none; border-radius: 7px; display: grid; place-items: center; background: #0e2a33; }
.logo-mark > span { display: block; width: 17px; height: 7px; border-radius: 2px; background: #ffe45c; }
:root[data-theme="dark"] .logo-mark { box-shadow: 0 0 0 1px #2c4a52; }
.wordmark { font-weight: 800; letter-spacing: -.02em; }
.sb-org { margin: 0 4px 14px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); display: flex; align-items: center; gap: 10px; }
.sb-org .name { font-weight: 600; font-size: 13px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-org .sub { font-size: 11.5px; color: var(--muted); }
.sb nav { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 16px 12px 6px; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px; color: var(--text-2); font-weight: 500; position: relative; }
.nav-link .ic { color: var(--muted); }
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav-link.active .ic { color: var(--primary); }
.nav-link .count { margin-left: auto; font-size: 11.5px; font-weight: 600; padding: 1px 7px; border-radius: 99px; background: var(--surface-3); color: var(--text-2); }
.nav-link.active .count { background: var(--primary); color: var(--primary-ink); }
.sb-foot { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.me { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; }
.me .who { min-width: 0; flex: 1; }
.me .who strong { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me .who span { font-size: 11.5px; color: var(--muted); }
.sb-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.sb-actions form { display: contents; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; height: 60px; display: flex; align-items: center; gap: 12px; padding: 0 28px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(180%) blur(10px); border-bottom: 1px solid var(--border); }
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; min-width: 0; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.crumbs .cur { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .grow { flex: 1; }
.search-btn { display: flex; align-items: center; gap: 8px; height: 36px; min-width: 260px; padding: 0 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--muted); cursor: pointer; font: inherit; box-shadow: var(--shadow-sm); }
.search-btn:hover { border-color: var(--border-strong); color: var(--text-2); }
.search-btn kbd, kbd { margin-left: auto; font: 600 11px var(--font); padding: 2px 6px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.icon-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 9px; border: 1px solid transparent; background: transparent; color: var(--text-2); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.menu-btn { display: none; }
.page { padding: 28px; max-width: 1480px; width: 100%; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head .lead { color: var(--muted); margin: 4px 0 0; max-width: 760px; }
.page-head .eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--primary); margin-bottom: 6px; }

/* ---------- Layout helpers ---------- */
.grid { display: grid; gap: 16px; }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-main-r { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.span-2 { grid-column: span 2; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.mt { margin-top: 16px; } .mt-lg { margin-top: 24px; } .mb { margin-bottom: 16px; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad, .card > .body { padding: 18px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 0; }
.card-head .sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.card-head + .body { padding-top: 14px; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.card.flush > .table-scroll { border-radius: 0 0 var(--radius) var(--radius); }

.kpi { padding: 18px 20px; position: relative; overflow: hidden; }
.kpi .top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.kpi .label { color: var(--muted); font-size: 13px; font-weight: 500; }
.kpi .bubble { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.kpi .bubble.crit { background: var(--crit-soft); color: var(--crit); }
.kpi .bubble.warn { background: var(--high-soft); color: var(--high); }
.kpi .bubble.ok { background: var(--ok-soft); color: var(--ok); }
.kpi .bubble.violet { background: var(--violet-soft); color: var(--violet); }
.kpi .bubble.info { background: var(--info-soft); color: var(--info); }
.kpi .value { font-size: 30px; font-weight: 700; letter-spacing: -0.03em; margin-top: 8px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .foot { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.delta { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; font-size: 12px; padding: 1px 6px; border-radius: 99px; }
.delta.up { color: var(--ok); background: var(--ok-soft); }
.delta.down { color: var(--crit); background: var(--crit-soft); }
.delta.flat { color: var(--muted); background: var(--surface-2); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid transparent; font: 600 13.5px var(--font); cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, box-shadow .12s, transform .05s; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .icon-btn:focus-visible, .search-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.btn-primary { background: var(--ink); color: #fff; box-shadow: 0 1px 2px rgba(14,42,51,.25); }
.btn-primary:hover { background: var(--primary-hover); color: #fff; }
:root[data-theme="dark"] .btn-primary { background: var(--primary); color: var(--primary-ink); }
:root[data-theme="dark"] .btn-primary:hover { background: var(--primary-hover); color: var(--primary-ink); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background: var(--surface-2); border-color: var(--border-strong); color: var(--text); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--crit); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); color: #fff; }
.btn-danger-soft { background: var(--crit-soft); color: var(--crit); }
.btn-danger-soft:hover { background: var(--crit); color: #fff; }
.btn-warn-soft { background: var(--high-soft); color: var(--high); }
.btn-warn-soft:hover { background: var(--high); color: #fff; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; gap: 5px; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 15px; border-radius: 11px; }
.btn[disabled], .btn.disabled { opacity: .45; pointer-events: none; }
.btn-link { background: none; border: 0; padding: 0; height: auto; color: var(--primary); font: inherit; font-weight: 500; cursor: pointer; }
.btn-link:hover { color: var(--primary-hover); text-decoration: underline; }
.btn-group { display: inline-flex; gap: 8px; flex-wrap: wrap; align-items: center; }
form.inline { display: inline; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--surface-3); color: var(--text-2); }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.sev-critical { background: var(--crit-soft); color: var(--crit); }
.badge.sev-high { background: var(--high-soft); color: var(--high); }
.badge.sev-medium { background: var(--med-soft); color: var(--med); }
.badge.sev-low { background: var(--low-soft); color: var(--low); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.danger { background: var(--crit-soft); color: var(--crit); }
.badge.warn { background: var(--med-soft); color: var(--med); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.brand { background: var(--primary-soft); color: var(--primary); }
.badge.violet { background: var(--violet-soft); color: var(--violet); }
.badge.outline { background: transparent; border: 1px solid var(--border); color: var(--text-2); }
.risk { display: inline-grid; place-items: center; min-width: 36px; height: 26px; padding: 0 6px; border-radius: 7px; font-weight: 700; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.risk.sev-critical { background: var(--crit); color: #fff; }
.risk.sev-high { background: var(--high-soft); color: var(--high); }
.risk.sev-medium { background: var(--med-soft); color: var(--med); }
.risk.sev-low { background: var(--low-soft); color: var(--low); }
.tag { white-space: nowrap; display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; font-size: 11.5px; font-weight: 500; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); margin: 1px 2px 1px 0; }

/* ---------- Avatars ---------- */
.avatar { --h: 200; width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11.5px; font-weight: 700; flex: 0 0 auto;
  background: hsl(var(--h) 70% 92%); color: hsl(var(--h) 55% 32%); }
:root[data-theme="dark"] .avatar { background: hsl(var(--h) 40% 22%); color: hsl(var(--h) 70% 80%); }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.avatar.lg { width: 40px; height: 40px; font-size: 14px; }
.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person .t { min-width: 0; }
.person .t > strong { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person .t > span { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Tables ---------- */
.table-scroll { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; }
.tbl th { position: sticky; top: 0; text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tbody tr { transition: background .1s; }
.tbl tbody tr:hover td { background: var(--surface-2); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .chk { width: 40px; }
.tbl.compact td { padding: 9px 14px; }
.cell-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.file-ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); flex: 0 0 auto; }
.file-ic.onedrive { color: #0f6cbd; background: rgba(15,108,189,.08); }
.file-ic.sharepoint { color: #038387; background: rgba(3,131,135,.08); }
.file-ic.exchange { color: #7a5af8; background: rgba(122,90,248,.08); }
:root[data-theme="dark"] .file-ic.onedrive { color: #6cb6ff; }
:root[data-theme="dark"] .file-ic.sharepoint { color: #4fd1c5; }
:root[data-theme="dark"] .file-ic.exchange { color: #b4a2ff; }
.cell-title .t { min-width: 0; }
.cell-title .name { display: block; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 340px; }
.cell-title a.name:hover { color: var(--primary); }
.cell-title .path { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 340px; }
.masked { color: var(--muted); font-style: italic; font-weight: 500 !important; display: inline-flex !important; align-items: center; gap: 5px; }

/* ---------- Forms ---------- */
label, .label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.input, input[type=text], input[type=search], input[type=number], input[type=email], input[type=password], input[type=date], input[type=tel], select, textarea {
  width: 100%; height: 38px; padding: 0 12px; font: 14px var(--font); color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 9px; box-shadow: var(--shadow-sm); transition: border-color .12s, box-shadow .12s; }
textarea { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; }
select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
input[readonly] { background: var(--surface-2); }
.help { font-size: 12px; color: var(--muted); margin-top: 5px; }
.field-validation-error, .text-danger { color: var(--crit); font-size: 12px; margin-top: 4px; display: block; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.form-grid .full { grid-column: 1 / -1; }
.input-icon { position: relative; }
.input-icon .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon input { padding-left: 36px; }
.section { padding: 20px; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; }
.section:last-child { border-bottom: 0; }
.section .desc h3 { margin-bottom: 4px; }
.section .desc p { color: var(--muted); font-size: 13px; margin: 0; }
/* switch */
.switch { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; margin: 0 0 12px; font-weight: 500; color: var(--text); font-size: 14px; }
.switch input[type=checkbox] { appearance: none; width: 36px; height: 20px; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--border-strong); position: relative; flex: 0 0 auto; cursor: pointer; transition: background .15s; margin: 1px 0 0; box-shadow: none; padding: 0; }
.switch input[type=checkbox]::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.switch input[type=checkbox]:checked { background: var(--primary); border-color: var(--primary); }
.switch input[type=checkbox]:checked::after { transform: translateX(16px); }
.switch input[type=checkbox]:disabled { opacity: .5; cursor: not-allowed; }
.switch .sub { display: block; font-size: 12.5px; color: var(--muted); font-weight: 400; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); font-weight: 500; margin: 0; cursor: pointer; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.checks .check { padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); }
.checks .check:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }

/* ---------- Filter bar ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.toolbar .input-icon { flex: 1 1 260px; max-width: 360px; }
.toolbar select { width: auto; min-width: 140px; height: 34px; font-size: 13px; }
.toolbar input[type=search] { height: 34px; font-size: 13px; }
.seg { display: inline-flex; padding: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; gap: 2px; }
.seg a, .seg button { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 7px; color: var(--text-2); font: 500 13px var(--font); border: 0; background: transparent; cursor: pointer; }
.seg a:hover, .seg button:hover { color: var(--text); }
.seg .on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow-sm); }
.seg .n { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 99px; border: 1px dashed var(--border-strong); color: var(--text-2); font-size: 12.5px; font-weight: 500; background: transparent; }
.chip.on { border-style: solid; border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.chip a { color: inherit; display: inline-flex; }

/* bulk bar */
.bulkbar { position: sticky; bottom: 16px; z-index: 15; margin: 14px auto 0; width: fit-content; max-width: 100%; display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 16px; border-radius: 14px; background: var(--text); color: var(--bg); box-shadow: var(--shadow-lg); transform: translateY(10px); opacity: 0; pointer-events: none; transition: all .18s; flex-wrap: wrap; }
.bulkbar.show { transform: none; opacity: 1; pointer-events: auto; }
.bulkbar .count { font-weight: 600; margin-right: 6px; }
.bulkbar .btn-ghost { color: var(--bg); }
.bulkbar .btn-ghost:hover { background: color-mix(in srgb, var(--bg) 14%, transparent); color: var(--bg); }
.bulkbar input[type=text] { height: 30px; width: 240px; background: color-mix(in srgb, var(--bg) 12%, transparent); border-color: transparent; color: var(--bg); box-shadow: none; font-size: 13px; }
.bulkbar input::placeholder { color: color-mix(in srgb, var(--bg) 60%, transparent); }

/* ---------- Alerts / banners / toasts ---------- */
.alert { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: 10px; border: 1px solid; margin-bottom: 16px; font-size: 13.5px; }
.alert .ic { margin-top: 1px; }
.alert .grow { flex: 1; }
.alert.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, transparent); color: var(--text); }
.alert.ok .ic { color: var(--ok); }
.alert.error { background: var(--crit-soft); border-color: color-mix(in srgb, var(--crit) 30%, transparent); color: var(--text); }
.alert.error .ic { color: var(--crit); }
.alert.warn { background: var(--med-soft); border-color: color-mix(in srgb, var(--med) 35%, transparent); color: var(--text); }
.alert.warn .ic { color: var(--med); }
.alert.info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 30%, transparent); color: var(--text); }
.alert.info .ic { color: var(--info); }
.banner { display: flex; align-items: center; gap: 12px; padding: 10px 28px; font-size: 13.5px; border-bottom: 1px solid var(--border); }
.banner .grow { flex: 1; }
.banner.support { background: linear-gradient(90deg, var(--med-soft), transparent); }
.banner.support .ic { color: var(--med); }
.banner.viewas { background: linear-gradient(90deg, var(--info-soft), transparent); }
.banner.viewas .ic { color: var(--info); }
.banner.trial { background: linear-gradient(90deg, var(--primary-soft), transparent); }
.banner.trial .ic { color: var(--primary); }
.banner.danger { background: linear-gradient(90deg, var(--crit-soft), transparent); }
.banner.danger .ic { color: var(--crit); }
#toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 10px; }
.toast { display: flex; align-items: flex-start; gap: 10px; min-width: 300px; max-width: 440px; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); animation: toast-in .25s ease-out; font-size: 13.5px; }
.toast .ic { margin-top: 1px; }
.toast.ok .ic { color: var(--ok); } .toast.error .ic { color: var(--crit); } .toast.warn .ic { color: var(--med); } .toast.info .ic { color: var(--info); }
.toast .x { margin-left: auto; color: var(--muted); background: none; border: 0; cursor: pointer; padding: 0; }
.toast.out { animation: toast-out .2s ease-in forwards; }
@keyframes toast-in { from { transform: translateY(12px); opacity: 0; } }
@keyframes toast-out { to { transform: translateY(8px); opacity: 0; } }

/* ---------- Data viz ---------- */
.chart-box { position: relative; height: 260px; }
.chart-box.sm { height: 200px; }
.chart-box.xs { height: 160px; }
.legend { display: flex; flex-direction: column; gap: 8px; }
.legend-row { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 10px; font-size: 13px; }
.legend-row .sw { width: 10px; height: 10px; border-radius: 3px; }
.legend-row .v { font-weight: 600; font-variant-numeric: tabular-nums; }
.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row .meta { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; }
.bar-row .meta .v { font-weight: 600; font-variant-numeric: tabular-nums; }
.bar { height: 7px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 99px; background: var(--primary); }
.bar.crit > span { background: var(--crit); } .bar.high > span { background: var(--high); } .bar.violet > span { background: var(--violet); } .bar.info > span { background: var(--info); }
.gauge { --v: 50; --c: var(--primary); width: 132px; height: 132px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto;
  background: radial-gradient(closest-side, var(--surface) 78%, transparent 79% 100%), conic-gradient(var(--c) calc(var(--v) * 1%), var(--surface-3) 0); }
.gauge .inner { text-align: center; line-height: 1.1; }
.gauge .v { font-size: 32px; font-weight: 750; letter-spacing: -0.03em; }
.gauge .l { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.gauge.sm { width: 96px; height: 96px; } .gauge.sm .v { font-size: 24px; }
.gauge.good { --c: var(--ok); } .gauge.mid { --c: var(--med); } .gauge.bad { --c: var(--crit); }
.progress { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; width: 35%; border-radius: 99px; background: var(--primary); animation: indet 1.3s ease-in-out infinite; }
@keyframes indet { 0% { margin-left: -35%; } 100% { margin-left: 100%; } }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 var(--ok); animation: pulse 1.8s infinite; display: inline-block; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ---------- Lists & misc ---------- */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--border); }
.list-item:first-child { border-top: 0; }
.list-item:hover { background: var(--surface-2); }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; color: var(--text); }
.list-item .meta { font-size: 12px; color: var(--muted); }
.dl { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px 16px; margin: 0; font-size: 13.5px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; word-break: break-word; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .ic { color: var(--border-strong); margin-bottom: 10px; }
.empty h3 { color: var(--text); margin-bottom: 4px; }
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding: 0 0 16px; }
.tl-item::before { content: ""; position: absolute; left: -20px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--primary); }
.tl-item .when { font-size: 12px; color: var(--muted); }
.steps-v { counter-reset: s; display: flex; flex-direction: column; gap: 14px; }
.step { counter-increment: s; display: grid; grid-template-columns: 30px 1fr; gap: 12px; }
.step::before { content: counter(s); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-weight: 700; font-size: 13px; }
.copy-field { display: flex; gap: 8px; }
.copy-field input { font-family: var(--mono); font-size: 12.5px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tabs a { padding: 10px 12px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; gap: 6px; align-items: center; }
.tabs a:hover { color: var(--text); }
.tabs a.on { color: var(--text); border-color: var(--primary); font-weight: 600; }
details.more > summary { cursor: pointer; list-style: none; color: var(--muted); font-size: 12.5px; display: inline-flex; align-items: center; gap: 4px; }
details.more > summary::-webkit-details-marker { display: none; }
details.more[open] > summary { color: var(--text); margin-bottom: 8px; }
.mail-frame { width: 100%; min-height: 620px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
pre.log { white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font: 12px/1.5 var(--mono); margin: 8px 0 0; color: var(--text-2); }

/* ---------- Command palette ---------- */
dialog.cmdk { padding: 0; border: 1px solid var(--border); border-radius: 16px; width: min(640px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); margin-top: 12vh; }
dialog.cmdk::backdrop { background: rgba(10, 13, 18, .45); backdrop-filter: blur(3px); }
.cmdk-input { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--border); }
.cmdk-input input { border: 0; box-shadow: none; height: 54px; font-size: 15px; padding: 0; background: transparent; }
.cmdk-input input:focus { box-shadow: none; }
.cmdk-list { max-height: 400px; overflow-y: auto; padding: 8px; }
.cmdk-group { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 10px 10px 4px; }
.cmdk-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; color: var(--text); cursor: pointer; }
.cmdk-item .ic { color: var(--muted); }
.cmdk-item .sub { margin-left: auto; font-size: 12px; color: var(--muted); }
.cmdk-item.sel, .cmdk-item:hover { background: var(--primary-soft); color: var(--text); }
.cmdk-item.sel .ic { color: var(--primary); }
.cmdk-empty { padding: 26px; text-align: center; color: var(--muted); }
.cmdk-foot { display: flex; gap: 14px; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }

/* ---------- Public pages ---------- */
.public-top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 14px; padding: 14px 32px; background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.public-main { max-width: 1160px; margin: 0 auto; padding: 32px 24px 60px; }
.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; padding: 40px 0 56px; }
.hero h1 { font-size: 50px; line-height: 1.05; letter-spacing: -0.04em; margin: 14px 0 18px; font-weight: 800; }
.hero h1 .grad { background: linear-gradient(120deg, #0d9488, #2dd4bf 60%, #60a5fa); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { font-size: 17px; color: var(--text-2); margin-bottom: 26px; }
.hero-visual { position: relative; }
.hero-visual .card { box-shadow: var(--shadow-lg); }
.hero-visual::before { content: ""; position: absolute; inset: -40px -20px; background: radial-gradient(closest-side, var(--primary-soft), transparent); z-index: -1; }
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.feature { padding: 22px; }
.feature .bubble { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); margin-bottom: 14px; }
.feature p { color: var(--muted); margin: 6px 0 0; font-size: 13.5px; }
.footer { text-align: center; color: var(--muted); font-size: 12.5px; padding: 28px; }
.center-card { max-width: 560px; margin: 40px auto; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) { .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-main, .g-main-r { grid-template-columns: 1fr; } }
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .sb { position: fixed; left: 0; top: 0; bottom: 0; width: var(--sb-w); transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .sb.open { transform: none; }
  .menu-btn { display: inline-grid; }
  .search-btn { min-width: 0; } .search-btn .lbl, .search-btn kbd { display: none; }
  .g-3, .g-2, .form-grid, .hero, .features { grid-template-columns: 1fr; }
  .section { grid-template-columns: 1fr; gap: 12px; }
  .page, .topbar { padding-left: 16px; padding-right: 16px; }
  .hero h1 { font-size: 36px; }
}
@media print {
  .sb, .topbar, .banner, .bulkbar, .no-print, #toasts { display: none !important; }
  .shell { display: block; } .page { padding: 0; } .card { break-inside: avoid; box-shadow: none; }
}
.tags { display: flex; flex-wrap: wrap; gap: 3px; max-width: 220px; }
.tags .tag { margin: 0; }
.validation-summary-valid { display: none !important; }
.validation-summary-errors ul { margin: 0; padding-left: 18px; }

/* Fund-tabel: undgå klippet datokolonne på 13-15" skærme */
@media (max-width: 1600px) {
  .cell-title .name, .cell-title .path { max-width: 280px; }
  .tbl .tags .tag { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: middle; }
}

/* ── v5: detektorer, regler, indsigt, rapport, medarbejderscanning ── */
.tile-link { display: block; color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s; }
.tile-link:hover { border-color: var(--primary); box-shadow: var(--shadow-md, 0 6px 20px rgba(0,0,0,.08)); transform: translateY(-1px); }
.tile-link h3 { margin-top: 12px; }
.tile-link p { margin: 6px 0 10px; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.opt-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 6px; }
.opt-cards.col { grid-template-columns: 1fr; }
.opt { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; background: var(--surface); transition: border-color .15s, background .15s; font-weight: 400; margin: 0; }
.opt:hover { border-color: var(--border-strong); }
.opt input { margin-top: 3px; accent-color: var(--primary); flex: 0 0 auto; }
.opt:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 1px var(--primary) inset; }
.opt strong { display: block; color: var(--text); font-size: 14px; }
.opt .xs { display: block; margin-top: 2px; }
.test-result { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.test-result > .ic { flex: 0 0 auto; margin-top: 2px; color: var(--muted); }
.test-result.ok { background: var(--ok-soft); border-color: transparent; }
.test-result.ok > .ic { color: var(--ok); }
.test-result .tag { margin-top: 4px; }
.selfscan { display: flex; align-items: center; gap: 14px; padding: 16px 18px; background: linear-gradient(120deg, var(--primary-soft), var(--surface) 70%); }
.selfscan .ss-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); flex: 0 0 auto; }
.selfscan.compact { padding: 12px 14px; margin-bottom: 16px; }
.selfscan form { flex: 0 0 auto; }
.ic.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.rule-card { display: flex; gap: 16px; align-items: flex-start; padding: 18px 20px; }
.rule-card.off { opacity: .65; }
.rule-card h3 { margin: 0; }
.rule-sentence { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; font-size: 13px; }
.rule-sentence .pill { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); font-weight: 500; color: var(--text); }
.rule-sentence .pill.strong { background: var(--primary-soft); border-color: transparent; color: var(--primary); }
.steps-list { padding-left: 18px; margin: 10px 0 0; display: grid; gap: 8px; }
.conclusion { padding-left: 18px; margin: 8px 0 0; display: grid; gap: 6px; }
.report-head { display: none; }
@media print {
  .report-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 14px; margin-bottom: 18px; border-bottom: 2px solid var(--text); }
  .report .grid.g-4 { grid-template-columns: repeat(4, 1fr); }
  .report .grid.g-3 { grid-template-columns: repeat(3, 1fr); }
  .report .grid.g-2, .report .grid.g-main { grid-template-columns: 1fr 1fr; }
  body { background: #fff !important; }
}
@media (max-width: 900px) { .opt-cards { grid-template-columns: 1fr; } .rule-card { flex-wrap: wrap; } }
.rule-card > .btn-group { flex: 0 0 auto; flex-wrap: nowrap; }
.switch.mt { margin-top: 16px; }
.grow { flex: 1 1 auto; }
.selfscan { margin-bottom: 16px; }
.perm-box { padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.perm-box strong { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.perm-box p { margin: 6px 0 0; }
.opt.disabled { opacity: .55; cursor: not-allowed; }

/* Login (forsiden) */
.login-wrap { background: var(--mist); min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px 16px; }
.login-card { width: 100%; max-width: 400px; padding: 32px 28px 22px; }
.login-card h1 { font-size: 22px; margin: 22px 0 6px; }
.login-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.login-foot { margin-top: 26px; padding-top: 14px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 6px; }
.login-dev { max-width: 400px; width: 100%; }
.login-theme { position: fixed; top: 14px; right: 16px; }
.btn-block { width: 100%; justify-content: center; }
.login-card .btn-lg { border-radius: 999px; height: 50px; font-size: 15.5px; }
.login-card h1 { letter-spacing: -.03em; font-weight: 800; }
.login-brand { font-size: 20px; }
