:root {
  --bg: #f1f4f8;
  --surface: #ffffff;
  --surface-2: #f6f8fb;
  --line: #e0e6ed;
  --line-2: #cbd4de;
  --ink: #16202b;
  --muted: #65758a;
  --accent: #1f6f6b;
  --accent-hover: #185a57;
  --accent-ink: #ffffff;
  --accent-soft: #e1f0ee;
  --danger: #c0392b;
  --warn: #b7791f;
  --ok: #2f8f5b;
  --side: #14202b;
  --side-ink: #c5d1de;
  --side-line: #243546;
  --col-bg: #e6ecf2;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e151c;
    --surface: #16212b;
    --surface-2: #1b2833;
    --line: #26343f;
    --line-2: #34454f;
    --ink: #e4eaf0;
    --muted: #94a4b6;
    --accent: #3aa59f;
    --accent-hover: #4bb8b2;
    --accent-ink: #06201e;
    --accent-soft: #163130;
    --danger: #ea6b5b;
    --col-bg: #111a22;
    --side: #0a1117;
    --side-line: #1d2b38;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 14px/1.5 var(--font);
  background: var(--bg);
  color: var(--ink);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 22px; }
h2 { font-size: 16px; margin-bottom: 10px; }
h3 { font-size: 13px; }
p { margin: 0 0 10px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.err { color: var(--danger); }
small { font-size: 12px; }

/* ---------- Skal ---------- */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.topbar { display: none; }
.side {
  background: var(--side);
  color: var(--side-ink);
  display: flex;
  flex-direction: column;
  padding: 18px 12px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.side .brand { color: #fff; font-weight: 700; font-size: 17px; padding: 0 10px 16px; letter-spacing: .2px; }
.side nav { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px; border-radius: 7px;
  color: var(--side-ink); text-decoration: none;
}
.nav-item:hover { background: var(--side-line); text-decoration: none; color: #fff; }
.nav-item.active { background: var(--side-line); color: #fff; font-weight: 600; }
.nav-item span:first-of-type { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-h { margin: 16px 10px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #7b8da1; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dot.lg { width: 13px; height: 13px; margin-right: 9px; }
.side-foot { border-top: 1px solid var(--side-line); padding-top: 12px; margin-top: 12px; }
.side-foot .me { display: flex; align-items: center; gap: 9px; color: #fff; padding: 0 6px 8px; text-decoration: none; }
.side-foot .me span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.foot-links { display: flex; gap: 12px; padding: 0 6px; align-items: center; font-size: 12.5px; }
.foot-links a, .foot-links .linkbtn { color: #8fa1b5; }
.foot-links a.on { color: #fff; font-weight: 600; }
.foot-links .linkbtn { margin-left: auto; }
.main { padding: 24px 30px 60px; min-width: 0; }
.main.solo { max-width: 100%; }
.badge {
  background: #d6453a; color: #fff; border-radius: 999px;
  font-size: 11px; font-weight: 700; padding: 1px 7px; min-width: 20px; text-align: center;
}

/* ---------- Basiskomponenter ---------- */
.inline { display: inline; margin: 0; }
.linkbtn {
  background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer;
}
.linkbtn:hover { text-decoration: underline; }
.linkbtn.danger, .danger { color: var(--danger); }
.linkbtn:disabled { opacity: .35; cursor: default; text-decoration: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 13px; border-radius: 8px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 500; cursor: pointer; text-decoration: none; line-height: 1.3;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn.danger { color: var(--danger); border-color: var(--line-2); }
.btn:disabled { opacity: .4; cursor: default; }

input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=search], select, textarea {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
textarea { resize: vertical; min-height: 70px; }
input:focus, select:focus, textarea:focus, summary:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent);
}
input[type=file] { font: inherit; max-width: 100%; }
input[type=color] { width: 38px; height: 34px; padding: 2px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); cursor: pointer; }
label { display: block; font-weight: 500; }
label > input, label > select, label > textarea { margin-top: 4px; font-weight: 400; }
label.check { display: inline-flex; align-items: center; gap: 7px; font-weight: 400; }
label.check input { width: auto; margin: 0; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px 10px; margin: 0; }
legend { font-weight: 500; padding: 0 6px; }

.stack { display: flex; flex-direction: column; gap: 12px; }
.row-inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-inline > input[type=text], .row-inline > select { width: auto; flex: 1 1 220px; max-width: 420px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.narrow { max-width: 520px; }

.card-form, .block { margin-bottom: 26px; }
.card-form {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
}
.count {
  display: inline-block; background: var(--line); color: var(--muted);
  border-radius: 999px; padding: 0 8px; font-size: 12px; font-weight: 600; margin-left: 4px;
}
.empty { color: var(--muted); padding: 24px; text-align: center; background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--radius); }

.flash { padding: 9px 14px; border-radius: 8px; margin-bottom: 14px; border: 1px solid; }
.flash-ok { background: #e4f4ea; border-color: #b9e0c8; color: #1d6a40; }
.flash-err { background: #fbe9e7; border-color: #f0c3bd; color: #962f23; }
@media (prefers-color-scheme: dark) {
  .flash-ok { background: #15301f; border-color: #1f4a30; color: #8fd6ab; }
  .flash-err { background: #3a1b17; border-color: #5c2a24; color: #f0a79d; }
}

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin: 3px 0 0; }
.page-actions { display: flex; gap: 8px; }

/* ---------- Chips, prioritet, avatarer ---------- */
.chip {
  display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  color: var(--c, #475569); background: color-mix(in srgb, var(--c, #475569) 14%, transparent);
  white-space: nowrap;
}
.chip-src { --c: #64748b; }
.prio { font-size: 11.5px; font-weight: 600; padding: 1px 7px; border-radius: 5px; white-space: nowrap; }
.prio-low { color: #5f7186; }
.prio-normal { color: #2f6fb0; }
.prio-high { color: #b9690f; background: #fcefd9; }
.prio-urgent { color: #b32b2b; background: #fbe0de; }
@media (prefers-color-scheme: dark) {
  .prio-high { background: #3c2c12; color: #f0b25c; }
  .prio-urgent { background: #3f1a18; color: #f08c85; }
}
.due { font-size: 12px; color: var(--muted); white-space: nowrap; }
.due.overdue { color: #b32b2b; font-weight: 600; }
.due.duetoday { color: #b9690f; font-weight: 600; }

.av {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%; color: #fff;
  font-size: 10.5px; font-weight: 700; flex: none; border: 2px solid var(--surface);
}
.av.sm { width: 22px; height: 22px; font-size: 10px; border: 0; }
.av-none { background: var(--line-2); color: var(--muted); }
.av-more { background: var(--line); color: var(--muted); }
.av-stack { display: inline-flex; }
.av-stack .av + .av { margin-left: -7px; }
.mention { background: var(--accent-soft); color: var(--accent); border-radius: 4px; padding: 0 3px; font-weight: 600; }
.who { display: inline-flex; align-items: center; gap: 8px; }

/* ---------- Overblik ---------- */
.banner {
  display: flex; align-items: center; gap: 8px; padding: 12px 16px; margin-bottom: 22px;
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: var(--radius); color: var(--ink); text-decoration: none;
}
.banner:hover { text-decoration: none; background: color-mix(in srgb, var(--accent) 18%, transparent); }
.banner .go { margin-left: auto; color: var(--accent); font-weight: 600; }
.group-h { margin: 16px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.group-h.overdue { color: #b32b2b; }
.rows { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.rows li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.rows li:last-child { border-bottom: 0; }
.rows .row-main { flex: 1; min-width: 0; color: var(--ink); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows .row-sub { color: var(--muted); font-size: 12.5px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.rows li.unread { background: var(--accent-soft); }
.rows li.unread .row-main { font-weight: 700; }
.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.board-tile {
  display: flex; flex-direction: column; gap: 3px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--c); border-radius: var(--radius);
  color: var(--ink); box-shadow: var(--shadow); text-decoration: none;
}
.board-tile:hover { text-decoration: none; transform: translateY(-1px); border-color: var(--line-2); border-top-color: var(--c); }
.bt-name { font-weight: 700; font-size: 15px; }
.bt-n { color: var(--muted); }
.bt-od { color: #b32b2b; font-weight: 600; font-size: 12.5px; }

/* ---------- Board ---------- */
.board-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 14px; }
.board-head h1 { display: flex; align-items: center; }
.tabs { display: flex; gap: 2px; background: var(--line); padding: 3px; border-radius: 9px; }
.tabs a { padding: 5px 13px; border-radius: 7px; color: var(--muted); font-weight: 500; text-decoration: none; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.head-actions { margin-left: auto; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters input[type=search] { width: 200px; }
.filters select { width: auto; max-width: 190px; }

.kanban { display: flex; gap: 14px; align-items: flex-start; overflow-x: auto; padding-bottom: 14px; min-height: 240px; }
.col { flex: 0 0 280px; background: var(--col-bg); border-radius: 12px; display: flex; flex-direction: column; max-height: calc(100vh - 230px); }
.col-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 13px 9px; border-top: 4px solid var(--c); border-radius: 12px 12px 0 0;
}
.col-name { font-weight: 700; }
.done-mark { color: var(--ok); }
.col-body { padding: 4px 8px 8px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; min-height: 44px; flex: 1; }
.col.drag-over .col-body { background: color-mix(in srgb, var(--accent) 8%, transparent); border-radius: 8px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--line-2);
  border-radius: 9px; padding: 9px 11px 8px; cursor: pointer; box-shadow: var(--shadow);
}
.card:hover { border-color: var(--line-2); }
.card.prio-high { border-left-color: #e0952f; background: var(--surface); }
.card.prio-urgent { border-left-color: #d33f3f; background: var(--surface); }
.card.prio-low, .card.prio-normal { background: var(--surface); }
.card.dragging { opacity: .45; }
.card-title { display: block; color: var(--ink); font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; text-decoration: none; }
.card-title:hover { text-decoration: none; color: var(--accent); }
.chips { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }
.card-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; min-height: 24px; }
.meta-l { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; color: var(--muted); font-size: 12px; }
.meta-l .prio { padding: 0 6px; }
.ico { white-space: nowrap; }
.drop-line { height: 3px; border-radius: 3px; background: var(--accent); margin: -2px 0; }
.quick { padding: 0 8px 10px; }
.quick input { background: transparent; border: 1px dashed var(--line-2); color: var(--muted); }
.quick input:focus { background: var(--surface); color: var(--ink); border-style: solid; }
.board-foot { display: flex; gap: 8px; margin-top: 6px; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 22px; }
table.grid { width: 100%; border-collapse: collapse; }
table.grid th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); }
table.grid th a { color: var(--muted); text-decoration: none; }
table.grid th a:hover { color: var(--ink); }
table.grid td { padding: 9px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.grid tr:last-child td { border-bottom: 0; }
table.grid tr:hover td { background: var(--surface-2); }
table.grid tr.inactive td { opacity: .55; }
.t-title { font-weight: 600; max-width: 380px; overflow-wrap: anywhere; }
.t-title a { color: var(--ink); }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions > * + * { margin-left: 10px; }
.status { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }

/* ---------- Kalender ---------- */
.cal-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.cal-title { min-width: 170px; text-align: center; font-size: 16px; }
.cal-title::first-letter { text-transform: uppercase; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--line); gap: 1px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cal-wd { background: var(--surface-2); padding: 7px 10px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.cal-day { background: var(--surface); min-height: 108px; padding: 5px 6px 6px; display: flex; flex-direction: column; gap: 3px; }
.cal-day.other { background: var(--surface-2); }
.cal-day.other .cal-n { color: var(--muted); opacity: .6; }
.cal-n { font-size: 12px; font-weight: 600; color: var(--ink); align-self: flex-end; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.cal-day.today .cal-n { background: var(--accent); color: var(--accent-ink); }
.cal-item {
  display: block; padding: 2px 6px; border-radius: 5px; font-size: 12px; line-height: 1.35;
  background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--ink); border-left: 3px solid var(--c);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none;
}
.cal-item:hover { text-decoration: none; background: color-mix(in srgb, var(--c) 28%, transparent); }
.cal-item.is-done { opacity: .5; text-decoration: line-through; }

/* ---------- Tidslinje ---------- */
.tl { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
.tl-row { display: grid; grid-template-columns: 230px minmax(640px, 1fr); border-bottom: 1px solid var(--line); min-width: 880px; }
.tl-row:last-child { border-bottom: 0; }
.tl-name { padding: 9px 14px; color: var(--ink); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-right: 1px solid var(--line); text-decoration: none; }
.tl-head .tl-name { background: var(--surface-2); }
.tl-days { display: grid; grid-template-columns: repeat(var(--span), 1fr); background: var(--surface-2); }
.tl-day { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 4px 0; font-size: 11px; color: var(--muted); border-left: 1px solid var(--line); min-height: 40px; position: relative; }
.tl-day em { font-style: normal; font-weight: 700; font-size: 10px; text-transform: uppercase; }
.tl-day.wk { background: color-mix(in srgb, var(--line) 55%, transparent); }
.tl-day.today span { background: var(--accent); color: var(--accent-ink); border-radius: 50%; width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.tl-track {
  position: relative; min-height: 42px;
  background-image: linear-gradient(to right, var(--line) 1px, transparent 1px);
  background-size: calc(100% / var(--span)) 100%;
}
.tl-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); opacity: .5; }
.tl-bar {
  position: absolute; top: 8px; height: 26px; min-width: 14px; border-radius: 6px;
  background: var(--c); display: flex; align-items: center; justify-content: flex-end; padding: 0 4px; overflow: hidden;
  text-decoration: none;
}
.tl-bar:hover { filter: brightness(1.1); text-decoration: none; }
.tl-bar.is-done { opacity: .5; }
.tl-bar .av { width: 20px; height: 20px; font-size: 9px; border-width: 1px; }

/* ---------- Dialog ---------- */
dialog.dialog { border: 0; border-radius: 14px; padding: 22px; width: min(640px, 94vw); background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
dialog.dialog::backdrop { background: rgba(10, 20, 30, .5); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.people { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.picker-item { display: inline-flex; align-items: center; gap: 7px; font-weight: 400; padding: 3px 0; cursor: pointer; }
.picker-item input { width: auto; margin: 0; }

/* ---------- Ticket ---------- */
.crumbs { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.ticket-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.title-input { font-size: 22px; font-weight: 700; border: 1px solid transparent; background: transparent; padding: 6px 8px; margin: 0 0 14px -8px; width: calc(100% + 8px); }
.title-input:hover { border-color: var(--line-2); }
.title-input:focus { background: var(--surface); }
.desc, .c-text { overflow-wrap: anywhere; }
.desc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 8px; }
.edit-desc summary { list-style: none; display: inline-flex; cursor: pointer; }
.edit-desc summary::-webkit-details-marker { display: none; }
.edit-desc[open] summary { margin-bottom: 8px; }
.progress { height: 6px; border-radius: 6px; background: var(--line); margin-bottom: 8px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--ok); transition: width .2s; }
.subtasks { list-style: none; padding: 0; margin: 0 0 8px; }
.subtasks li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.subtasks label { display: flex; align-items: center; gap: 9px; font-weight: 400; flex: 1; }
.subtasks input { width: auto; margin: 0; }
.subtasks input:checked + span { text-decoration: line-through; color: var(--muted); }
.inline-add { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-add input[type=text] { flex: 1; min-width: 180px; width: auto; }
.files { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.file { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 6px 10px; max-width: 100%; }
.file .thumb img { display: block; width: 44px; height: 44px; object-fit: cover; border-radius: 6px; }
.file-info { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.file-info a { overflow-wrap: anywhere; font-weight: 500; }
.feed { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.act { font-size: 12.5px; color: var(--muted); padding-left: 34px; }
.act-who { font-weight: 600; color: var(--ink); }
.comment { display: flex; gap: 10px; }
.comment .av { margin-top: 2px; }
.c-body { flex: 1; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 9px 14px; }
.c-head { display: flex; gap: 10px; align-items: baseline; margin-bottom: 3px; }
.c-head form { margin-left: auto; }
.comment-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.mention-menu { position: absolute; z-index: 40; background: var(--surface); border: 1px solid var(--line-2); border-radius: 9px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); min-width: 200px; padding: 4px; }
.mention-menu button { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 6px 9px; border: 0; background: none; color: var(--ink); font: inherit; border-radius: 6px; cursor: pointer; }
.mention-menu button.on, .mention-menu button:hover { background: var(--accent-soft); }

.side-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.field { display: block; }
.field > span:first-child { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 3px; font-weight: 600; }
.info { font-size: 13px; }
.side-actions { display: flex; gap: 8px; }
.picker { position: relative; }
.picker summary { list-style: none; cursor: pointer; border: 1px solid var(--line-2); border-radius: 8px; padding: 5px 9px; min-height: 34px; display: flex; align-items: center; background: var(--surface); }
.picker summary::-webkit-details-marker { display: none; }
.picker-menu { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--line-2); border-radius: 9px; padding: 6px 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); max-height: 280px; overflow: auto; display: flex; flex-direction: column; }

/* ---------- Admin ---------- */
.label-list { display: flex; flex-direction: column; gap: 8px; max-width: 960px; }
.label-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; }
.label-row input[type=text] { flex: 1 1 180px; width: auto; }
.label-row select { width: auto; max-width: 200px; }
.label-row.add { background: transparent; border-style: dashed; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0 0 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
code.copy { display: block; padding: 9px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow-x: auto; user-select: all; }

/* ---------- Login og offentlig formular ---------- */
body.auth .main, body.public .main { display: flex; justify-content: center; padding-top: 60px; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 28px; box-shadow: var(--shadow); height: fit-content; }
.auth-card.wide { max-width: 720px; }
.auth-card h1 { margin-bottom: 6px; }
.auth-card .sub { color: var(--muted); margin-bottom: 18px; }
.auth-lang { text-align: center; margin: 16px 0 0; color: var(--muted); font-size: 12.5px; }
.public-wrap { width: 100%; max-width: 720px; }
.public-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.public-top .brand { font-weight: 700; font-size: 16px; }
.public-top .lang a { margin-left: 8px; color: var(--muted); }
.public-top .lang a.on { color: var(--ink); font-weight: 700; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.checks { list-style: none; padding: 0; margin: 0 0 16px; }
.checks .ok { color: var(--ok); }
.checks .bad { color: var(--danger); }

.toast { position: fixed; right: 18px; bottom: 18px; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 8px; font-weight: 500; z-index: 60; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); }
.toast.err { background: var(--danger); color: #fff; }

/* ---------- Mobil ---------- */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .topbar {
    display: flex; align-items: center; gap: 12px; padding: 10px 14px;
    background: var(--side); color: #fff; position: sticky; top: 0; z-index: 25;
  }
  .topbar .brand { color: #fff; font-weight: 700; flex: 1; text-decoration: none; }
  .topbar .burger { background: none; border: 0; color: #fff; font-size: 22px; cursor: pointer; padding: 2px 6px; }
  .topbar .bell { color: #fff; text-decoration: none; position: relative; }
  .topbar .bell .badge { position: absolute; top: -6px; right: -10px; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; z-index: 30; transform: translateX(-102%); transition: transform .2s; height: 100%; }
  .side.open { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .4); }
  .main { padding: 18px 14px 50px; }
  .ticket-layout, .two-col, .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .col { flex-basis: 84vw; max-height: none; }
  .cal-day { min-height: 70px; padding: 3px; }
  .cal-item { font-size: 11px; padding: 1px 4px; }
  .head-actions { margin-left: 0; }
  .filters input[type=search] { width: 100%; }
  .title-input { font-size: 19px; }
}

/* ---------- Brand-faner, invitationslink og skrivebeskyttet board ---------- */
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.pills a { display: inline-flex; align-items: center; gap: 7px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 500; text-decoration: none; }
.pills a:hover { border-color: var(--muted); }
.pills a.on { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.pills a.on .dot { box-shadow: 0 0 0 2px var(--surface); }
.invite-link { display: flex; gap: 8px; margin: 12px 0 6px; }
.invite-link input { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.kanban.readonly .card { cursor: pointer; }
input[readonly].title-input { cursor: default; }
select:disabled, input:disabled { opacity: .75; cursor: not-allowed; }

/* ---------- Statistik ---------- */
.stats-filters { margin-bottom: 18px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.filter-row label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.filter-row select, .filter-row input { font-size: 14px; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--ink); min-width: 150px; }
.filter-note { margin: 10px 0 0; font-size: 13px; }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 26px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.kpi-l { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.kpi-v { font-size: 28px; font-weight: 650; line-height: 1.15; color: var(--ink); }
.kpi-v small { font-size: 14px; font-weight: 500; color: var(--muted); }
.delta { font-size: 13px; font-weight: 600; }
.delta.up { color: var(--ok); }
.delta.down { color: var(--danger); }
.delta.flat { color: var(--muted); }
.chart-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 14px 10px; }
svg.chart { width: 100%; height: auto; display: block; }
svg.chart .grid { stroke: var(--line); stroke-width: 1; }
svg.chart .ax { fill: var(--muted); font-size: 11px; font-family: var(--font); }
svg.chart rect:hover { opacity: .8; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 6px; font-size: 13px; color: var(--muted); }
.legend .dot { margin-right: 6px; }
table.grid td.num, table.grid th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
svg.spark { width: 120px; height: 32px; display: block; }
.stats-note { font-size: 13px; max-width: 70ch; }
@media (max-width: 760px) {
  .kpis { grid-template-columns: 1fr; }
  .filter-row label { flex: 1 1 140px; }
  .filter-row select, .filter-row input { width: 100%; min-width: 0; }
}
