:root {
  --accent: #1F5FD1;
  --accent-soft: #EAF1FF;
  --ground: #F5F6F8;
  --surface: #FFFFFF;
  --line: #E4E7EC;
  --line-soft: #EEF0F3;
  --ink: #111827;
  --ink-2: #4B5565;
  --ink-3: #6B7485;
  --namecol: 248px;
  --hour-line: #F1F3F6;
  --free-bg: #CDEFD9;
  --free-fg: #0D5A30;
  --busy-bg: #D6E4FF; --busy-fg: #0F3A8A;
  --oof-bg: #E6DCFA; --oof-fg: #45208C;
  --tent-fg: #0F3A8A; --tent-bd: #A9C1F2;
  --else-fg: #3A4252; --else-bd: #8A94A6;
  --unknown-bg: #E5E8ED; --unknown-fg: #4A5160;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: Figtree, system-ui, sans-serif; color: var(--ink); background: var(--ground); font-size: 14px; }
button, input, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
svg.i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.boot { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--ink-2); }

/* Login */
.login { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { max-width: 440px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 36px; display: flex; flex-direction: column; gap: 14px; }
.login-card h1 { margin: 0; font-size: 22px; }
.login-card p { margin: 0; color: var(--ink-2); line-height: 1.5; }
.login-card .fine { font-size: 12px; }
.brand { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; color: var(--accent); }
.brand sup { font-size: 10px; font-weight: 500; }
.brand span { font-size: 14px; font-weight: 600; color: var(--ink-2); margin-left: 4px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 12px; border: 1px solid #DCE0E6; border-radius: 8px; background: var(--surface); font-weight: 600; font-size: 13px; }
.btn:hover { background: #F7F8FA; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #174AA6; }
.btn-lg { height: 44px; font-size: 14px; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-icon { width: 36px; padding: 0; }

/* Layout */
.app { min-height: 100%; display: flex; flex-direction: column; }
.body { flex: 1; display: flex; min-height: 0; }
.main { flex: 1; min-width: 0; padding: 16px 20px 96px; display: flex; flex-direction: column; gap: 12px; position: relative; }

/* Top bar */
.topbar { height: 56px; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 16px; padding: 0 16px 0 20px; position: sticky; top: 0; z-index: 20; }
.topbar .brand { font-size: 28px; min-width: 216px; display: flex; align-items: baseline; gap: 8px; }
.topbar .brand span { font-size: 14px; font-weight: 500; margin: 0; }
.tenant { position: relative; }
.tenant-btn { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px 0 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-weight: 600; font-size: 13px; max-width: 320px; }
.tenant-btn .t-ini { width: 24px; height: 24px; border-radius: 6px; background: var(--ink); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: none; }
.tenant-btn .t-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu { position: absolute; top: 42px; left: 0; min-width: 300px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(16,24,40,.16); padding: 6px; z-index: 30; }
.menu .m-head { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); padding: 8px 10px 4px; }
.menu button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 8px 10px; border: 0; background: transparent; border-radius: 8px; text-align: left; font-size: 13px; }
.menu button:hover { background: var(--ground); }
.menu .m-sub { display: block; font-size: 12px; color: var(--ink-3); }
.menu .m-on { color: var(--accent); font-weight: 700; }
.menu hr { border: 0; border-top: 1px solid var(--line-soft); margin: 6px 0; }
.search { flex: 1; display: flex; justify-content: center; }
.search label { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 520px; height: 38px; padding: 0 12px; border-radius: 10px; background: #F1F3F6; color: var(--ink-2); }
.search input { flex: 1; border: 0; background: transparent; outline: none; min-width: 0; color: var(--ink); }
.me { width: 34px; height: 34px; border-radius: 50%; background: #DCE6F7; color: #1C3466; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }

/* Sidebar */
.sidebar { width: 280px; flex: none; background: var(--surface); border-right: 1px solid var(--line); padding: 16px; display: flex; flex-direction: column; gap: 18px; overflow-y: auto; max-height: calc(100vh - 56px); position: sticky; top: 56px; }
.side-h { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.side-sub { font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 10px 8px 4px; display: flex; align-items: center; gap: 6px; background: none; border: 0; width: 100%; text-align: left; }
.side-sub svg { width: 12px; height: 12px; transition: transform .15s; }
.side-sub[aria-expanded="true"] svg { transform: rotate(90deg); }
.gsearch { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink-3); }
.gsearch input { flex: 1; border: 0; outline: none; min-width: 0; background: transparent; color: var(--ink); font-size: 13px; }
.src { display: flex; align-items: center; gap: 4px; border-radius: 8px; }
.src:hover { background: var(--ground); }
.src.on { background: var(--accent-soft); }
.src.on .src-btn { color: var(--accent); font-weight: 600; }
.src-btn { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 8px; border: 0; background: transparent; font-size: 13px; font-weight: 500; text-align: left; }
.src-btn .n { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.src-btn .c { font-size: 12px; color: var(--ink-3); }
.star { width: 28px; height: 28px; border: 0; background: transparent; color: #C5CBD5; display: flex; align-items: center; justify-content: center; border-radius: 6px; }
.star.on { color: #E3A21A; }
.star svg { width: 14px; height: 14px; }
.star.on svg { fill: currentColor; stroke: currentColor; }
.more { border: 0; background: none; color: var(--accent); font-size: 12px; font-weight: 600; padding: 6px 8px; text-align: left; }
.side-foot { margin-top: auto; display: flex; gap: 8px; align-items: center; padding: 10px; border-radius: 10px; background: var(--ground); font-size: 12px; color: var(--ink-2); line-height: 1.35; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #1E9E5A; flex: none; }
.dot.warn { background: #E3A21A; }

/* Mini calendar */
.mini-h { display: flex; align-items: center; justify-content: space-between; font-weight: 600; }
.mini { display: grid; grid-template-columns: 22px repeat(7, minmax(0, 1fr)); row-gap: 2px; font-size: 12px; text-align: center; margin-top: 6px; }
.mini .wd { color: var(--ink-3); font-weight: 600; line-height: 26px; }
.mini .wk { color: #8A93A3; font-size: 10px; line-height: 28px; }
.mini button { height: 28px; border: 0; background: transparent; padding: 0; font-weight: 500; }
.mini button span { display: inline-block; width: 26px; height: 26px; line-height: 26px; border-radius: 50%; }
.mini button.out { color: #8A93A3; }
.mini button.inweek { background: var(--accent-soft); font-weight: 700; }
.mini button.inweek.first { border-radius: 8px 0 0 8px; }
.mini button.inweek.last { border-radius: 0 8px 8px 0; }
.mini button.today span { background: var(--accent); color: #fff; font-weight: 700; }

/* Toolbar */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar h1 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.pill { font-size: 13px; color: var(--ink-2); padding: 3px 8px; border-radius: 6px; background: #EBEDF1; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 1px solid #DCE0E6; border-radius: 999px; background: var(--surface); font-size: 12px; font-weight: 600; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.grow { flex: 1; }
.status { font-size: 12px; color: var(--ink-2); }
select.sel { height: 36px; border: 1px solid #DCE0E6; border-radius: 8px; padding: 0 8px; background: var(--surface); font-weight: 600; font-size: 13px; }

.banner { padding: 10px 14px; border-radius: 10px; background: #FFF4E5; color: #7A3600; font-size: 13px; line-height: 1.4; }
.banner.err { background: #FDECEC; color: #8A1C1C; }

/* Calendar grid */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.scroller { overflow-x: auto; }
.grid { min-width: 1040px; user-select: none; -webkit-user-select: none; }
.gr { display: grid; grid-template-columns: var(--namecol) repeat(5, minmax(0, 2fr)) repeat(2, minmax(0, 1fr)); }
.head { border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 5; }
.head .src-title { padding: 12px 16px; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.head .src-title b { font-size: 13px; }
.head .src-title span { font-size: 12px; color: var(--ink-2); }
.dh { border-left: 1px solid var(--line); padding: 10px 0 0; display: flex; flex-direction: column; gap: 8px; }
.dh .dl { display: flex; align-items: baseline; gap: 6px; padding: 0 10px; }
.dh .dow { font-size: 12px; font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
.dh .dn { font-size: 18px; font-weight: 700; }
.dh.today .dow { color: var(--accent); }
.dh.today .dn { color: #fff; background: var(--accent); border-radius: 8px; padding: 0 6px; }
.ticks { position: relative; height: 18px; }
.ticks span { position: absolute; transform: translateX(-50%); font-size: 10px; font-weight: 500; color: var(--ink-3); }
.we { border-left: 1px solid var(--line); background: #F7F8FA; display: flex; flex-direction: column; align-items: center; padding-top: 8px; gap: 2px; }
.we .dow { font-size: 11px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; }
.we .dn { font-size: 13px; font-weight: 700; color: var(--ink-2); width: 26px; height: 26px; line-height: 26px; text-align: center; border-radius: 50%; }
.we.today .dow { color: var(--accent); }
.we.today .dn { background: var(--accent); color: #fff; }

.freerow { border-bottom: 1px solid var(--line); background: #FBFCFD; }
.freerow .lab { height: 36px; padding: 0 16px; display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: #1E5A3A; }
.fcell { position: relative; border-left: 1px solid var(--line); height: 36px; }
.fseg { position: absolute; top: 8px; height: 20px; border-radius: 5px; background: var(--free-bg); color: var(--free-fg); font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; overflow: hidden; white-space: nowrap; }

.prow { border-bottom: 1px solid var(--line-soft); }
.prow.on { background: #F0F5FF; }
.pcell { display: flex; align-items: center; gap: 10px; padding: 0 12px 0 14px; border: 0; background: transparent; text-align: left; min-width: 0; min-height: 56px; }
.cb { width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid #B7BFCC; flex: none; display: flex; align-items: center; justify-content: center; color: #fff; }
.prow.on .cb { background: var(--accent); border-color: var(--accent); }
.cb svg { width: 12px; height: 12px; stroke-width: 3; opacity: 0; }
.prow.on .cb svg { opacity: 1; }
.av { width: 34px; height: 34px; border-radius: 50%; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: none; position: relative; }
.pt { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.pt b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt span { font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.warn-i { color: #B26A00; }
.dc { position: relative; border-left: 1px solid var(--line); background-image: linear-gradient(to right, var(--hour-line) 1px, transparent 1px); background-size: var(--hourpct) 100%; }
.dc.today { background-color: #FAFCFF; }
.wc { border-left: 1px solid var(--line); background: #F7F8FA; }
.wc.today { background: #F2F5FC; }
.noacc { position: absolute; inset: 0; display: flex; align-items: center; padding-left: 10px; font-size: 12px; color: var(--ink-3); font-style: italic; }
.nowline { position: absolute; top: 0; bottom: 0; width: 2px; background: #D13438; opacity: .7; z-index: 2; pointer-events: none; }

.ev { position: absolute; height: 22px; border-radius: 6px; padding: 0 6px; border: 0; font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 4px; overflow: hidden; white-space: nowrap; text-align: left; z-index: 1; }
.ev span { overflow: hidden; text-overflow: ellipsis; }
.ev svg { width: 11px; height: 11px; stroke-width: 2.4; }
.ev.cl { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.ev.cr { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.ev-busy { background: var(--busy-bg); color: var(--busy-fg); }
.ev-oof { background: var(--oof-bg); color: var(--oof-fg); }
.ev-tentative { background-color: #E3ECFF; color: var(--tent-fg); border: 1px solid var(--tent-bd); background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.65) 0 5px, transparent 5px 10px); }
.ev-workingElsewhere { background-color: #fff; color: var(--else-fg); border: 1px dashed var(--else-bd); }
.ev-free { background-color: #fff; color: var(--ink-2); border: 1px solid var(--line); }
.ev.cat.ev-workingElsewhere { border-color: currentColor; }
.ev.cat.ev-tentative { border-color: currentColor; }
.ev.fb { cursor: pointer; }
.ev.full:hover { filter: brightness(.96); box-shadow: 0 0 0 2px rgba(31,95,209,.25); }
.dc { cursor: cell; }
.ev-unknown { background: var(--unknown-bg); color: var(--unknown-fg); }

.empty { padding: 48px 16px; text-align: center; color: var(--ink-2); }
.skel { height: 56px; border-bottom: 1px solid var(--line-soft); background: linear-gradient(90deg, #F5F6F8 0, #FBFCFD 50%, #F5F6F8 100%); background-size: 200% 100%; animation: sh 1.2s infinite linear; }
@keyframes sh { from { background-position: 200% 0; } to { background-position: 0 0; } }

.legend { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 18px; height: 10px; border-radius: 3px; }
.sw-busy { background: var(--busy-bg); }
.sw-oof { background: var(--oof-bg); }
.sw-tentative { background: repeating-linear-gradient(135deg, #E3ECFF 0 3px, #F6F9FF 3px 6px); border: 1px solid var(--tent-bd); }
.sw-elsewhere { border: 1px dashed var(--else-bd); }

/* Action bar */
.abar { position: fixed; left: 50%; bottom: 24px; transform: translateX(calc(-50% + 172px)); display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 16px; border-radius: 14px; background: var(--ink); color: #fff; box-shadow: 0 12px 32px rgba(16,24,40,.28); white-space: nowrap; z-index: 25; }
.abar b { font-size: 13px; }
.abar .names { font-size: 12px; color: #C3C9D4; margin-right: 8px; max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.abar a, .abar button { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border: 0; border-radius: 9px; background: #1F2937; color: #fff; font-size: 13px; font-weight: 600; text-decoration: none; }
.abar a.primary { background: var(--accent); }
.abar button.x { background: transparent; color: #C3C9D4; width: 36px; padding: 0; justify-content: center; }

@media (max-width: 900px) {
  .sidebar { display: none; }
  .abar { transform: translateX(-50%); }
  .topbar .brand { min-width: 0; }
}

/* Kategorier i sidebar */
.cat-row { display: flex; align-items: center; gap: 8px; width: 100%; height: 32px; padding: 0 6px; border: 0; background: transparent; border-radius: 8px; font-size: 12px; text-align: left; }
.cat-row:hover { background: var(--ground); }
.cat-row .cb { border-radius: 4px; }
.cat-row.on .cb { background: var(--accent); border-color: var(--accent); }
.cat-row.on .cb svg { opacity: 1; }
.cat-pill { flex: 1; min-width: 0; height: 24px; display: flex; align-items: center; padding: 0 8px; border-radius: 6px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-row:not(.on) .cat-pill { opacity: .45; }
.acc-i { color: var(--ink-3); }

/* Aftaledialog */
.drawer-wrap { position: fixed; inset: 0; z-index: 50; }
.drawer-bg { position: absolute; inset: 0; background: rgba(17,24,39,.32); }
.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: var(--surface); box-shadow: -12px 0 32px rgba(16,24,40,.18); display: flex; flex-direction: column; }
.drawer-load { padding: 32px; color: var(--ink-2); }
.d-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 14px 24px; border-bottom: 1px solid var(--line); }
.d-head h2 { margin: 0; font-size: 18px; flex: 1; }
.d-body { flex: 1; overflow-y: auto; padding: 18px 24px; display: flex; flex-direction: column; gap: 16px; }
.d-title { border: 0; border-bottom: 2px solid var(--accent); padding: 4px 0 10px; font-size: 22px; font-weight: 700; outline: none; background: transparent; }
.d-title:disabled { border-bottom-color: var(--line); color: var(--ink); }
.d-note { padding: 10px 12px; border-radius: 10px; background: #F1F5FD; color: #1C3466; font-size: 13px; line-height: 1.45; }
.d-err { color: #8A1C1C; font-size: 13px; min-height: 0; }
.d-err:empty { display: none; }
.d-foot { border-top: 1px solid var(--line); padding: 12px 24px; display: flex; flex-direction: column; gap: 8px; }
.f-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; align-items: start; }
.f-lab { font-size: 13px; font-weight: 600; color: var(--ink-2); padding-top: 9px; }
.f-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.f-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.f-in { height: 36px; border: 1px solid #DCE0E6; border-radius: 8px; padding: 0 10px; background: var(--surface); font-size: 13px; }
.f-in:disabled { background: #F7F8FA; color: var(--ink-2); }
.f-in.t { width: 104px; }
.f-in.w { width: 100%; }
.f-in.ta { height: auto; padding: 10px; line-height: 1.5; resize: vertical; width: 100%; }
.f-static { padding-top: 9px; font-size: 13px; font-weight: 600; }
.f-hint { font-size: 12px; color: var(--ink-2); line-height: 1.4; }
.f-hint:empty { display: none; }
.f-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.f-stack { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.chk { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; padding-top: 8px; }
.chk input { width: 16px; height: 16px; margin: 0; }
.dash { color: var(--ink-3); }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: #EBEDF1; }
.seg button { height: 28px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.seg button:hover { background: #fff; color: var(--ink); }
.att { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; border: 1px solid #DCE0E6; border-radius: 10px; min-height: 44px; }
.att input { flex: 1; min-width: 180px; border: 0; outline: none; font-size: 13px; padding: 0 6px; background: transparent; }
.chip-att { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 4px 0 10px; border-radius: 8px; background: #F1F3F6; font-size: 13px; font-weight: 600; }
.chip-att i { width: 8px; height: 8px; border-radius: 50%; }
.chip-att .resp-t { font-weight: 500; color: var(--ink-3); font-size: 12px; }
.chip-att button { width: 22px; height: 22px; border: 0; background: transparent; color: var(--ink-3); display: flex; align-items: center; justify-content: center; border-radius: 6px; }
.chip-att button svg { width: 12px; height: 12px; }
.resp { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.resp .f-lab { padding: 0; }
.btn.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.danger { color: #B42318; border-color: #F3C2BD; }
.btn.danger:hover { background: #FDECEC; }
.btn:disabled { opacity: .55; cursor: default; }

/* Funktions-rail */
.rail { width: 72px; flex: none; background: var(--surface); border-right: 1px solid var(--line-soft); padding: 12px 6px; display: flex; flex-direction: column; align-items: center; gap: 4px; position: sticky; top: 56px; max-height: calc(100vh - 56px); overflow-y: auto; }
.r-btn { position: relative; width: 60px; height: 56px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.r-btn svg { width: 20px; height: 20px; }
.r-btn span:not(.r-badge):not(.r-dot) { font-size: 10px; font-weight: 600; }
.r-btn:hover { background: var(--ground); }
.r-btn.on { background: var(--accent-soft); color: var(--accent); }
.r-badge { position: absolute; top: 4px; right: 8px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; background: #D13438; color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid #fff; box-sizing: border-box; }
.r-dot { position: absolute; top: 7px; right: 15px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; }
.sidebar { width: 272px; }

/* Paneler */
.pnl { display: flex; flex-direction: column; gap: 10px; }
.pnl .btn { justify-content: center; }
.pnl-p { margin: 0; font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.pcard { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.card-t { border: 0; background: none; padding: 0; text-align: left; font-size: 13px; font-weight: 700; color: var(--ink); }
.card-t:hover { color: var(--accent); }
.card-s { font-size: 12px; color: var(--ink-2); line-height: 1.45; }
.card-b { display: flex; gap: 6px; }
.card-b .btn { flex: 1; }
.card-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12px; }
.btn-icon.sm { width: 30px; padding: 0; }
.bar { display: block; height: 6px; border-radius: 999px; background: #EBEDF1; overflow: hidden; }
.bar span { display: block; height: 6px; border-radius: 999px; background: var(--accent); }
.tag { font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: 5px; white-space: nowrap; }
.tag-ok { background: #D2F1DE; color: #0D5A30; }
.tag-wait { background: #FFEFB0; color: #634B00; }
.demo { font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #7A3600; background: #FFE0C2; padding: 2px 6px; border-radius: 5px; margin-left: 6px; }
.link-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.link-row .pt { flex: 1; }
.dot.off { background: #9AA3B2; }
.to-row { display: flex; align-items: center; gap: 10px; }
.av.sm { width: 28px; height: 28px; font-size: 10px; }

/* Kontomenu */
.me { border: 0; cursor: pointer; }
.menu.right { left: auto; right: 0; min-width: 260px; }
.m-acc { padding: 10px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }

/* Weekend som halve kolonner */
.dh.we { background: #F7F8FA; }
.dh.we .dl { padding: 0 6px; }
.dc.we { background-color: #FAFBFC; }
.dc.we.today, .dh.we.today { background-color: #F2F5FC; }
.fcell.we { background: #F7F8FA; }

/* Træk for at vælge tid */
.dragsel { position: absolute; top: 4px; bottom: 4px; border-radius: 6px; background: rgba(31, 95, 209, .14); border: 2px solid var(--accent); color: var(--accent); font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; white-space: nowrap; overflow: hidden; pointer-events: none; z-index: 3; }
body.dragging, body.dragging * { cursor: col-resize !important; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 92px; transform: translate(-50%, 12px); background: var(--ink); color: #fff; font-size: 13px; padding: 10px 14px; border-radius: 10px; opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; z-index: 60; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 900px) { .rail { display: none; } }

/* ===== Fast layout: kun personlisten scroller ===== */
html, body { height: 100%; }
body:has(#app:not([hidden])) { overflow: hidden; }
.app { height: 100vh; min-height: 0; }
.body { flex: 1; min-height: 0; overflow: hidden; }
.topbar { position: static; }
.rail, .sidebar { position: static; top: auto; max-height: none; height: 100%; overflow-y: auto; }
.main { min-height: 0; overflow: hidden; padding: 14px 20px 16px; gap: 10px; }
.main > .card { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.main > .card .scroller { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.head { position: static; }
.gtop { position: sticky; top: 0; z-index: 8; background: var(--surface); box-shadow: 0 2px 0 var(--line); }
.gbody { position: relative; }
.me-row { background: #FAFCFF; }
.me-row.on { background: #F0F5FF; }
.me-tag { font-size: 10px; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 1px 5px; border-radius: 4px; margin-left: 4px; vertical-align: 1px; }
/* navnekolonnen bliver stående ved vandret scroll */
.gr > :first-child { position: sticky; left: 0; z-index: 4; background: inherit; }
.gr.head, .gr.freerow, .gr.prow { background: var(--surface); }
.gr.freerow { background: #FBFCFD; }
.gr.prow.on { background: #F0F5FF; }
.gr.prow.me-row { background: #FAFCFF; }
.gr.prow.me-row.on { background: #F0F5FF; }
.gr { grid-template-columns: var(--namecol) var(--cols); }
.grid.v-day { min-width: 760px; }
.grid.v-week { min-width: 1040px; }
.grid.v-2weeks { min-width: 1060px; }
.grid.v-month { min-width: 980px; }

/* Sidepanel: Ny aftale øverst */
.side-new { width: 100%; flex: none; }

/* Værktøjslinje */
.toolbar { flex-direction: column; align-items: stretch; gap: 10px; flex: none; }
.tb-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tb-nav { display: inline-flex; gap: 2px; }
.seg-v { display: inline-flex; padding: 3px; border-radius: 10px; background: #EBEDF1; }
.seg-v button { height: 30px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; color: var(--ink-2); font-size: 13px; font-weight: 600; }
.seg-v button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(16,24,40,.12); }
.hsel { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px; border: 1px solid #DCE0E6; border-radius: 8px; background: var(--surface); font-weight: 600; font-size: 13px; }
.hsel select { appearance: none; -webkit-appearance: none; border: 0; background: transparent; font-weight: 600; font-size: 13px; padding-right: 2px; cursor: pointer; outline: none; }
.btn-on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.chip.dashed { border-style: dashed; border-color: #B7BFCC; background: transparent; color: var(--ink-2); }
.chip svg { width: 12px; height: 12px; }
.sq { display: inline-block; width: 9px; height: 9px; border-radius: 2px; }
.sq-oof { background: #8F6AD8; }
.sq-away { border: 1px dashed var(--ink-2); box-sizing: border-box; }
.chip.on .sq-away { border-color: #fff; }
.pop { top: 40px; min-width: 260px; }
.pop-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; font-size: 13px; border-radius: 8px; cursor: pointer; }
.pop-row:hover { background: var(--ground); }
.pop-row input { width: 16px; height: 16px; margin: 0; }

/* Dag-visning: større overskrift */
.v-day .dh .dl { padding: 0 14px; }
.v-day .dh .dow { font-size: 13px; }
/* Månedsvisning: kompakt hoved og smalle kolonner */
.dh.compact { padding: 8px 0 6px; align-items: center; gap: 2px; }
.dh.compact .dow { font-size: 10px; letter-spacing: 0; }
.dh.compact .dn { font-size: 13px; }
.dh.compact.today .dn { padding: 0 4px; border-radius: 6px; }
.v-month .dc { background-image: none; }
.v-month .ev { border-radius: 3px; padding: 0; }
.v-2weeks .dh .dl { padding: 0 6px; }
.v-2weeks .dh .dn { font-size: 15px; }
.v-2weeks .ev { font-size: 12px; padding: 0 5px; }

/* Udskrift */
@media print {
  .rail, .sidebar, .topbar, .toolbar, .abar, #actionbar, .legend, .banner { display: none !important; }
  html, body, .app, .body, .main { height: auto !important; overflow: visible !important; }
  .main > .card .scroller { overflow: visible !important; }
  .gtop { position: static; box-shadow: none; }
  .card { border: 0; }
}

/* ---------- Online status (Teams-tilstedeværelse) ---------- */
.av .pres { position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid #FFFFFF; box-sizing: content-box; background: #A19F9D; }
.av.sm .pres { width: 8px; height: 8px; }
.pres.p-available { background: #13A10E; }
.pres.p-busy { background: #C4314B; }
.pres.p-away { background: #EAA300; }
.pres.p-offline { background: #A19F9D; }
.pres.p-oof, .pres.oof { background: #B4009E; }
.pres-mini { width: 8px; height: 8px; border-radius: 50%; background: #13A10E; display: inline-block; box-shadow: 0 0 0 2px #fff, 0 0 0 3px #13A10E55; }
@media print { .av .pres { display: none; } }

/* Markeret personlinje (enkeltklik) – adskilt fra valgt (flueben) */
.gr.prow.focus { background: #F6F8FB; box-shadow: inset 3px 0 0 var(--accent); }
.gr.prow.focus.on { background: #EAF1FF; }
.gr.prow.focus > :first-child { background: inherit; }
/* Træk over flere dage → heldag */
.dc.dragday { background: rgba(31, 95, 209, .12) !important; box-shadow: inset 0 0 0 2px var(--accent); }
.dc.dragday[data-span]::after { content: attr(data-span); position: absolute; left: 6px; top: 50%; transform: translateY(-50%); font-size: 11px; font-weight: 700; color: var(--accent); white-space: nowrap; z-index: 4; pointer-events: none; }
/* Fravælg alle */
.freerow .lab { padding: 0 12px 0 14px; gap: 10px; }
.freerow .lab > svg { width: 16px; height: 16px; flex: none; }
.freerow .clr { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--accent); background: var(--accent); color: #fff; cursor: pointer; padding: 0; box-sizing: border-box; }
.freerow .clr svg { width: 12px; height: 12px; stroke-width: 3; }
.freerow .clr:hover { background: #C4314B; border-color: #C4314B; }

/* Heldags-/flerdagsaftaler: én sammenhængende bar hen over dagene */
.gr.prow { position: relative; }
.lbars { position: absolute; top: 0; bottom: 0; left: var(--namecol); right: 0; pointer-events: none; z-index: 2; }
.lbars .ev { pointer-events: auto; }

/* ================= Aftale i fuld visning ================= */
body.composing { overflow: hidden; }
.compose { position: fixed; top: 56px; left: 0; right: 0; bottom: 0; z-index: 30; background: #F5F6F8; display: flex; flex-direction: column; overflow: hidden; }
.cmp-load { padding: 40px; color: var(--ink-2); }
.cmp-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 24px; background: var(--surface); border-bottom: 1px solid var(--line); flex: none; }
.cmp-head h1 { margin: 0; font-size: 18px; font-weight: 700; }
.cmp-back { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); font-size: 13px; font-weight: 600; cursor: pointer; }
.cmp-back:hover { background: #F1F3F6; color: var(--ink); }
.cmp-vsep { width: 1px; height: 20px; background: var(--line); }
.cmp-chip { font-size: 12px; font-weight: 600; color: var(--ink-2); padding: 3px 8px; border-radius: 6px; background: #EBEDF1; }
.cmp-head .btn { height: 38px; border-radius: 9px; }
.cmp-save { gap: 8px; padding: 0 16px; }
.cmp-save svg { width: 15px; height: 15px; }
.cmp-head .btn.danger { color: #B42318; }
.cmp-resp { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.cmp-resp .btn.on { background: #111827; color: #fff; border-color: #111827; }
.cmp-err { margin: 12px 24px 0; padding: 10px 14px; border-radius: 10px; background: #FEF0EF; color: #8A1C1C; font-size: 13px; font-weight: 600; }
.cmp-err:empty { display: none; }
.cmp-body { flex: 1; min-height: 0; display: flex; gap: 20px; padding: 20px 24px 24px; overflow: auto; align-items: flex-start; }
.cmp-form { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.cmp-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 18px; }
.cmp-card.np { padding: 0; overflow: hidden; }
.cmp-title { border: 0; border-bottom: 2px solid var(--accent); padding: 4px 0 10px; font-size: 24px; font-weight: 700; color: var(--ink); outline: none; background: transparent; font-family: inherit; }
.cmp-title:disabled { border-bottom-color: var(--line); }
.cmp-row { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; align-items: start; }
.cmp-row.c { align-items: center; }
.cmp-lab { font-size: 13px; font-weight: 600; color: var(--ink-2); padding-top: 9px; }
.cmp-row.c .cmp-lab { padding-top: 0; }
.cmp-att { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; border: 1px solid #DCE0E6; border-radius: 10px; min-height: 46px; align-items: center; }
.cmp-person { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 4px 0 4px; border-radius: 8px; background: #F1F3F6; font-size: 13px; font-weight: 600; }
.cmp-person .badge { font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 5px; }
.cmp-person .resp-t { font-size: 11px; font-weight: 500; color: var(--ink-3); }
.cmp-person button { width: 20px; height: 20px; border: 0; background: transparent; color: #6B7485; display: flex; align-items: center; justify-content: center; border-radius: 5px; cursor: pointer; }
.cmp-person button:hover { background: #E3E6EB; }
.cmp-av { width: 24px; height: 24px; border-radius: 50%; font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.cmp-av.sm { width: 28px; height: 28px; }
.cmp-att-in { flex: 1; min-width: 180px; display: flex; }
.cmp-att-in input { width: 100%; border: 0; outline: none; font-size: 13px; padding: 0 6px; background: transparent; font-family: inherit; height: 30px; }
.cmp-links { display: flex; gap: 16px; font-size: 13px; flex-wrap: wrap; align-items: center; }
.cmp-links .lnk { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 600; font-size: 13px; cursor: pointer; }
.cmp-links .lnk span { color: var(--ink-3); font-weight: 500; }
.muted { color: var(--ink-2); font-size: 13px; }
.muted.sm, .sm.muted { font-size: 12px; }
.cmp-date { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px 0 12px; border: 1px solid #DCE0E6; border-radius: 9px; background: var(--surface); }
.cmp-date input { border: 0; outline: none; font-family: inherit; font-size: 13px; font-weight: 600; color: var(--ink); background: transparent; }
.cmp-date:has(input:disabled) { background: #F7F8FA; }
.cmp-form .f-in.t { height: 38px; border-radius: 9px; font-weight: 600; width: 96px; }
.cmp-dur { margin-left: 4px; }
.cmp-dur button { height: 30px; }
.cmp-sub { gap: 18px; font-size: 13px; }
.cmp-shead { display: flex; align-items: center; gap: 8px; color: var(--accent); }
.cmp-shead b { color: var(--ink); font-size: 14px; }
.cmp-sgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.cmp-sug { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px; border: 1px solid #DCE0E6; border-radius: 10px; background: var(--surface); text-align: left; cursor: pointer; font-family: inherit; color: var(--ink); }
.cmp-sug:hover { border-color: #A9C1F2; }
.cmp-sug.on { border: 2px solid var(--accent); background: #F0F5FF; padding: 11px; }
.cmp-sug .d { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.cmp-sug .t { font-size: 16px; font-weight: 700; }
.cmp-sug .s { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.cmp-sug .s i { width: 7px; height: 7px; border-radius: 50%; }
.cmp-sug .s.ok { color: #0D5A30; } .cmp-sug .s.ok i { background: #1E9E5A; }
.cmp-sug .s.tent { color: #8A4B00; } .cmp-sug .s.tent i { background: #E3A21A; }
#e-sugg { gap: 12px; padding: 16px 20px; }
.tgl { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; cursor: pointer; }
.tgl input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tgl-t { position: relative; width: 38px; height: 22px; border-radius: 999px; background: #C9CFD8; flex: none; transition: background .15s; }
.tgl-t::after { content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.tgl input:checked + .tgl-t { background: var(--accent); }
.tgl input:checked + .tgl-t::after { left: 19px; }
.tgl input:focus-visible + .tgl-t { outline: 2px solid var(--accent); outline-offset: 2px; }
.tgl svg { color: var(--ink-2); }
.cmp-on { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.cmp-loc { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border: 1px solid #DCE0E6; border-radius: 9px; color: var(--ink-2); }
.cmp-loc input { flex: 1; border: 0; outline: none; font-family: inherit; font-size: 13px; color: var(--ink); background: transparent; }
.cmp-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.cmp-pills button { height: 32px; padding: 0 12px; border: 1px solid #DCE0E6; border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; }
.cmp-pills button.on { background: #111827; border-color: #111827; color: #fff; }
.cmp-pills.cats button { border: 2px solid transparent; background: var(--cbg, #F1F3F6); color: var(--cfg, var(--ink)); font-weight: 700; padding: 0 10px; }
.cmp-pills.cats button.nocat { border: 1px dashed #B7BFCC; background: transparent; color: var(--ink-2); }
.cmp-pills.cats button.on { border: 2px solid var(--cfg, #111827); background: var(--cbg, #F1F3F6); color: var(--cfg, var(--ink)); }
.cmp-pills.cats button.nocat.on { border: 2px solid #111827; color: var(--ink); }
.cmp-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding-top: 4px; align-items: end; }
.cmp-grid3 .f-in { height: 38px; border-radius: 9px; }
.cmp-priv { height: 38px; }
.cmp-ta { display: block; width: 100%; min-height: 140px; border: 0; outline: none; resize: vertical; padding: 16px; box-sizing: border-box; font-size: 14px; line-height: 1.5; color: var(--ink); font-family: inherit; }

/* Planlægger */
.cmp-plan { flex: 1 1 480px; max-width: 600px; min-width: 380px; position: sticky; top: 0; max-height: calc(100vh - 56px - 130px); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.cmp-tabs { display: flex; gap: 4px; padding: 8px 12px 0; border-bottom: 1px solid var(--line); flex: none; }
.cmp-tabs button { height: 40px; padding: 0 12px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--ink-2); font-size: 13px; font-weight: 600; font-family: inherit; }
.cmp-tabs button[aria-selected="true"] { border-bottom-color: var(--accent); color: var(--ink); font-weight: 700; }
.cmp-tabs button:disabled { opacity: .55; }
.cmp-pnav { display: flex; align-items: center; gap: 8px; padding: 10px 16px; flex: none; }
.cmp-pnav #e-pday { font-size: 14px; font-weight: 700; }
.chk.sm { font-size: 12px; color: var(--ink-2); }
.cmp-pscroll { flex: 1; min-height: 0; overflow: auto; padding: 0 12px 16px; }
.pgrid-h { display: grid; gap: 4px; position: sticky; top: 0; background: var(--surface); z-index: 3; padding-bottom: 6px; }
.pgrid-h .fh { font-size: 10px; font-weight: 700; color: #1E5A3A; text-align: center; align-self: end; }
.pgrid-h .ph { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.pgrid-h .ph > span:last-child { font-size: 11px; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pgrid-b { display: grid; gap: 4px; position: relative; margin-top: 8px; }
.pgrid-b .pt { position: relative; }
.pgrid-b .pt span { position: absolute; right: 6px; font-size: 10px; color: #6B7485; }
.pgrid-b .pc { position: relative; border-radius: 6px; background: repeating-linear-gradient(to bottom, #EEF0F3 0 1px, transparent 1px var(--hh)); }
.pgrid-b .pc.fc { background: repeating-linear-gradient(to bottom, #EEF0F3 0 1px, transparent 1px var(--hh)), #FAFBFC; }
.pgrid-b .pc.noacc { background: repeating-linear-gradient(135deg, #F1F3F6 0 6px, #FAFBFC 6px 12px); }
.pgrid-b .pna { position: absolute; top: 8px; left: 0; right: 0; text-align: center; font-size: 10px; color: var(--ink-3); }
.pf { position: absolute; left: 3px; right: 3px; border-radius: 5px; background: #CDEFD9; }
.pb { position: absolute; left: 2px; right: 2px; border-radius: 5px; background: #D6E4FF; color: #0F3A8A; font-size: 11px; font-weight: 600; padding: 3px 6px; box-sizing: border-box; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; line-height: 1.3; }
.pb.st-tentative { background: repeating-linear-gradient(135deg, #E3ECFF 0 5px, #F6F9FF 5px 10px); border: 1px solid #A9C1F2; }
.pb.st-oof { background: #EADCF8; color: #5B2A86; }
.pb.st-workingElsewhere { background: #fff; border: 1px dashed #9AA3B2; color: var(--ink-2); }
.pb.st-unknown { background: #E5E8ED; color: #4A5160; }
.pslot { position: absolute; left: 48px; right: 0; border: 2px solid var(--accent); border-radius: 8px; background: rgba(31, 95, 209, .10); box-sizing: border-box; cursor: grab; z-index: 2; touch-action: none; }
.pslot.ro { cursor: default; }
.pslot.conf { border-color: #C4314B; background: rgba(196, 49, 75, .08); }
.pslot .pl { position: absolute; left: 8px; top: 6px; padding: 3px 8px; border-radius: 6px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; white-space: nowrap; pointer-events: none; }
.pslot.conf .pl { background: #C4314B; }
.pslot .hd { position: absolute; left: 50%; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: #fff; border: 2px solid var(--accent); box-sizing: border-box; cursor: ns-resize; }
.pslot.conf .hd { border-color: #C4314B; }
.pslot .hd.t { top: -6px; } .pslot .hd.b { bottom: -6px; }
.ploading { position: absolute; inset: 0; display: flex; align-items: flex-start; justify-content: center; padding-top: 40px; background: rgba(255,255,255,.6); font-size: 12px; font-weight: 600; color: var(--ink-2); z-index: 4; }
.cmp-pfoot { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); background: #FBFCFD; font-size: 12px; color: var(--ink-2); flex: none; }
.cmp-pfoot svg { color: #1E7A48; flex: none; }
.cmp-pfoot.bad { background: #FEF6F5; color: #8A1C1C; }
.cmp-pfoot.bad svg { color: #C4314B; }
@media (max-width: 1100px) { .cmp-body { flex-wrap: wrap; } .cmp-plan { position: static; max-width: none; max-height: 640px; } }
@media print { .compose { display: none; } }
.cmp-form .chk, .cmp-plan .chk { padding-top: 0; }
/* Navneopslag */
.cmp-att-in { position: relative; }
.cmp-ac { position: absolute; top: calc(100% + 6px); left: -6px; width: min(460px, 80vw); max-height: 360px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px rgba(16,24,40,.16); padding: 4px; z-index: 10; }
.ac-it { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 7px; cursor: pointer; }
.ac-it.on, .ac-it:hover { background: #F0F5FF; }
.ac-it .cmp-av { width: 30px; height: 30px; font-size: 11px; }
.ac-t { display: flex; flex-direction: column; min-width: 0; }
.ac-t b { font-size: 13px; font-weight: 600; }
.ac-t > span { font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-t mark { background: #FFF1B8; color: inherit; border-radius: 2px; }
.ac-empty { padding: 10px; font-size: 12px; color: var(--ink-2); }

/* ================= Hurtig visning af aftale ================= */
.pv { position: fixed; top: 56px; right: 0; bottom: 0; width: min(440px, 100vw); z-index: 25; background: var(--surface); border-left: 1px solid var(--line); box-shadow: -16px 0 40px rgba(16,24,40,.14); display: flex; flex-direction: column; animation: pvIn .16s ease-out; }
@keyframes pvIn { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.pv-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px 12px 20px; border-bottom: 1px solid var(--line); flex: none; }
.pv-head .btn { height: 34px; gap: 6px; }
.pv-body { flex: 1; overflow-y: auto; padding: 18px 20px 24px; display: flex; flex-direction: column; gap: 18px; }
.pv-owner { display: flex; align-items: center; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--line-soft, #EEF0F3); }
.pv-av { position: relative; width: 30px; height: 30px; border-radius: 50%; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.pv-av.lg { width: 40px; height: 40px; font-size: 13px; }
.pv-pres { position: absolute; right: -1px; bottom: -1px; width: 9px; height: 9px; border-radius: 50%; border: 2px solid #fff; }
.pv-pt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.pv-pt b { font-size: 13px; font-weight: 600; }
.pv-owner .pv-pt b { font-size: 14px; }
.pv-pt > span { font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-title { display: flex; gap: 12px; }
.pv-bar { width: 4px; border-radius: 4px; flex: none; }
.pv-title h2 { margin: 0 0 8px; font-size: 20px; font-weight: 700; line-height: 1.25; display: flex; align-items: center; gap: 6px; word-break: break-word; }
.pv-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.pv-tag { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px; }
.pv-tag.muted-tag { background: #EEF0F3; color: var(--ink-2); }
.pv-facts { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.pv-facts > div { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start; }
.pv-facts dt { color: var(--ink-3); padding-top: 1px; }
.pv-facts dd { margin: 0; font-size: 13px; line-height: 1.45; color: var(--ink); }
.pv-facts dd b { font-size: 15px; }
.pv-dur { display: inline-block; margin-left: 8px; font-size: 11px; font-weight: 700; color: var(--ink-2); background: #EEF0F3; padding: 1px 6px; border-radius: 5px; vertical-align: 1px; }
.pv-resp { display: flex; align-items: center; gap: 6px; padding: 12px; border-radius: 10px; background: #F6F8FB; flex-wrap: wrap; }
.pv-resp > span { font-size: 12px; font-weight: 700; color: var(--ink-2); margin-right: 4px; }
.pv-resp .btn { height: 32px; }
.pv-resp .btn.on.ok { background: #1E9E5A; border-color: #1E9E5A; color: #fff; }
.pv-resp .btn.on.tent { background: #E3A21A; border-color: #E3A21A; color: #fff; }
.pv-resp .btn.on.no { background: #C4314B; border-color: #C4314B; color: #fff; }
.pv-filters { display: flex; flex-wrap: wrap; gap: 4px; padding: 3px; border-radius: 10px; background: #EBEDF1; margin-bottom: 6px; }
.pv-filters button { flex: 1; height: 28px; padding: 0 8px; border: 0; border-radius: 7px; background: transparent; color: var(--ink-2); font-size: 12px; font-weight: 600; white-space: nowrap; cursor: pointer; font-family: inherit; }
.pv-filters button span { color: var(--ink-3); font-weight: 700; }
.pv-filters button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(16,24,40,.12); }
.pv-gh { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 12px 0 4px; }
.pv-gh span { color: var(--ink-2); }
.pv-att ul { list-style: none; margin: 0; padding: 0; }
.pv-p { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.pv-r { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: var(--ink-2); flex: none; }
.pv-r i { width: 18px; height: 18px; border-radius: 50%; background: var(--rc); color: #fff; font-style: normal; font-size: 10px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.pv-r i.o { background: transparent; border: 1.5px solid var(--rc); box-sizing: border-box; }
.pv-desc .pv-gh { margin-top: 0; }
.pv-text { font-size: 13px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; color: var(--ink); max-height: 320px; overflow-y: auto; }
.pv-empty { font-size: 12px; color: var(--ink-3); padding: 4px 0; }
.pv-err { color: #8A1C1C; font-size: 12px; font-weight: 600; }
.pv-err:empty { display: none; }
.pv-foot { flex: none; padding: 10px 20px; border-top: 1px solid var(--line); background: #FBFCFD; font-size: 12px; color: var(--ink-3); }
@media print { .pv { display: none; } }
/* Markeret/valgt linje dækker også weekenddagene */
.gr.prow.focus .dc.we { background-color: #EFF2F6; }
.gr.prow.on .dc.we { background-color: #E8EFFC; }
.gr.prow.focus.on .dc.we { background-color: #E2EBFB; }

/* 2 uger: smalle weekendkolonner med stablet dag/dato */
.dh.wk2 { align-items: center; gap: 0; padding: 8px 0 0; }
.dh.wk2 .dow { font-size: 11px; letter-spacing: 0; }
.dh.wk2 .dn { font-size: 14px; line-height: 1; margin-top: 3px; display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 22px; }
.dh.wk2.today .dn { padding: 0 4px; border-radius: 6px; box-sizing: border-box; }
.v-2weeks .dh .dl { padding: 0 6px; gap: 4px; }
.v-2weeks .dh .dow { font-size: 11px; letter-spacing: .02em; }
.v-2weeks .ticks span { font-size: 9px; }
/* Måned: ens dato-linje for alle dage, i dag-markering holdes inde i kolonnen */
.dh.compact .dow { line-height: 14px; }
.dh.compact .dn { line-height: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; max-width: calc(100% - 4px); }
.dh.compact.today .dn { min-width: 0; width: 22px; padding: 0; border-radius: 6px; }
.dh.compact.we.today .dn { font-size: 11px; letter-spacing: -.02em; }
.v-month .ev { border-radius: 4px; padding: 0 3px; font-size: 11px; }
.ev-more { position: absolute; left: 1px; right: 1px; border: 0; border-radius: 4px; background: #EBEDF1; color: var(--ink-2); font-size: 10px; font-weight: 700; padding: 0; cursor: pointer; z-index: 1; font-family: inherit; }
.ev-more:hover { background: #DCE0E6; color: var(--ink); }

/* ================= Personpanel (visitkort + kommende aftaler) ================= */
.pv-person { width: min(420px, 100vw); }
.pp-head { padding: 8px 12px 0 16px; align-items: flex-end; }
.pp-tabs { display: flex; gap: 4px; }
.pp-tabs button { height: 40px; padding: 0 12px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--ink-2); font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; }
.pp-tabs button[aria-selected="true"] { border-bottom-color: var(--accent); color: var(--ink); font-weight: 700; }
.pp-head .btn-icon { margin-bottom: 4px; }
.pp-body { padding: 0; gap: 0; }
.pp-card { padding: 20px; display: flex; flex-direction: column; gap: 14px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #F6F8FC 0, #FFFFFF 88px); }
.pp-top { display: flex; gap: 16px; align-items: center; }
.pp-photo { position: relative; width: 84px; height: 84px; border-radius: 18px; flex: none; display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 700; box-shadow: 0 1px 2px rgba(16,24,40,.08), 0 0 0 4px #fff; }
.pp-photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 18px; }
.pp-pres { position: absolute; right: -4px; bottom: -4px; width: 16px; height: 16px; border-radius: 50%; border: 3px solid #fff; }
.pp-id { min-width: 0; }
.pp-id h2 { margin: 0; font-size: 20px; font-weight: 700; line-height: 1.2; }
.pp-role { font-size: 13px; color: var(--ink-2); margin-top: 3px; }
.pp-status { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; font-weight: 600; color: var(--ink-2); background: #fff; border: 1px solid var(--line); padding: 3px 8px 3px 6px; border-radius: 999px; }
.pp-status i { width: 8px; height: 8px; border-radius: 50%; }
.pp-msg { font-size: 12px; line-height: 1.45; color: var(--ink); background: #F6F8FB; border-radius: 10px; padding: 8px 10px; }
.pp-msg.oof { background: #F5EEFC; color: #4A2470; }
.pp-actions { display: flex; gap: 6px; }
.pp-act { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--accent); font-size: 11px; font-weight: 600; text-decoration: none; cursor: pointer; font-family: inherit; }
.pp-act span { color: var(--ink-2); }
.pp-act:hover { border-color: #A9C1F2; background: #F0F5FF; }
.pp-facts { margin: 0; display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 7px 12px; font-size: 13px; }
.pp-facts dt { color: var(--ink-3); font-weight: 500; }
.pp-facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; display: flex; align-items: center; gap: 6px; }
.pp-facts a { color: var(--ink); text-decoration: none; }
.pp-facts a:hover { color: var(--accent); text-decoration: underline; }
.pp-copy { border: 0; background: transparent; color: var(--ink-3); padding: 2px; border-radius: 4px; cursor: pointer; display: inline-flex; }
.pp-copy:hover { color: var(--accent); background: #F0F5FF; }
.pp-copy.ok { color: #1E9E5A; }
.pp-list { padding: 14px 20px 20px; display: flex; flex-direction: column; gap: 4px; }
.pp-search { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border: 1px solid #DCE0E6; border-radius: 9px; color: var(--ink-3); margin-bottom: 6px; position: sticky; top: 0; background: #fff; z-index: 1; }
.pp-search input { flex: 1; border: 0; outline: none; font-family: inherit; font-size: 13px; color: var(--ink); background: transparent; }
.pp-day { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); padding: 12px 2px 4px; }
.pp-ev { display: grid; grid-template-columns: 62px 4px minmax(0, 1fr); gap: 10px; align-items: stretch; padding: 7px 8px 7px 4px; border: 0; border-radius: 8px; background: transparent; text-align: left; cursor: pointer; font-family: inherit; color: var(--ink); }
.pp-ev:hover { background: #F4F6FA; }
.pp-t { display: flex; flex-direction: column; align-items: flex-end; font-size: 12px; line-height: 1.35; white-space: nowrap; }
.pp-t b { font-weight: 700; }
.pp-t span { color: var(--ink-3); }
.pp-bar { border-radius: 3px; }
.pp-s { display: flex; flex-direction: column; min-width: 0; justify-content: center; }
.pp-s b { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-s b svg { flex: none; color: var(--ink-3); }
.pp-s > span { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-note { font-size: 12px; color: var(--ink-2); background: #F6F8FB; border-radius: 8px; padding: 8px 10px; }
.pcell { cursor: pointer; }
/* Viste timer */
.hpop { width: 280px; padding: 6px 12px 12px; }
.hpop .m-head { padding-left: 0; padding-right: 0; }
.h-range { display: flex; align-items: flex-end; gap: 8px; }
.h-range label { flex: 1; display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.h-range select { height: 36px; border: 1px solid #DCE0E6; border-radius: 8px; padding: 0 8px; font-size: 14px; font-weight: 600; color: var(--ink); background: var(--surface); font-family: inherit; }
.h-range .dash { padding-bottom: 9px; color: var(--ink-3); }
.h-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.h-presets .chip { height: 28px; }
.hpop .h-presets button { width: auto; flex: none; height: 28px; padding: 0 10px; border: 1px solid #DCE0E6; border-radius: 999px; background: var(--surface); color: var(--ink); font-size: 12px; font-weight: 600; }
.hpop .h-presets button:hover { background: #F1F3F6; }
.hpop .h-presets button.on { background: #111827; border-color: #111827; color: #fff; }
/* Visitkort står fast – kun aftalelisten scroller */
.pp-body { overflow: hidden; }
.pp-card { flex: none; }
.pp-list { flex: 1; min-height: 0; padding-bottom: 0; gap: 0; }
.pp-search { position: static; flex: none; margin-bottom: 8px; }
#pp-items { flex: 1; min-height: 0; overflow-y: auto; margin: 0 -8px; padding: 0 8px 16px; display: flex; flex-direction: column; gap: 4px; }
.pp-body { min-height: 0; }
#pp-items > * { flex: none; }
/* Profilbillede: rundt som de øvrige avatarer – passer både til firkantede og runde M365-billeder */
.pp-photo { border-radius: 50%; }
.pp-photo img { border-radius: 50%; display: block; }
.pp-photo.has-img { background: transparent; box-shadow: 0 1px 3px rgba(16,24,40,.12); }

/* ================= Egne grupper ================= */
.side-sub-act { padding-right: 2px; }
.side-add { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border: 0; border-radius: 6px; background: transparent; color: var(--accent); font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; }
.side-add svg { width: 13px; height: 13px; transform: none !important; }
.side-add:hover { background: var(--accent-soft); }
.side-hint { font-size: 12px; color: var(--ink-3); padding: 2px 8px 6px; line-height: 1.45; }
.src.mine .src-btn svg { width: 15px; height: 15px; color: var(--accent); flex: none; }
.src .star.act { color: var(--ink-3); opacity: 0; }
.src:hover .star.act, .src .star.act:focus-visible { opacity: 1; }
.src .star.act:hover { background: #fff; color: var(--ink); }
.src-del { height: 26px; padding: 0 10px; margin-right: 2px; border: 0; border-radius: 6px; background: #C4314B; color: #fff; font-size: 12px; font-weight: 700; cursor: pointer; font-family: inherit; }
.src.confirm { background: #FEF0EF; }

.mg-wrap { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 24px; }
.mg-bg { position: absolute; inset: 0; background: rgba(17,24,39,.36); }
.mg { position: relative; width: min(880px, 100%); height: min(680px, 100%); background: var(--surface); border-radius: 16px; box-shadow: 0 24px 64px rgba(16,24,40,.28); display: flex; flex-direction: column; overflow: hidden; animation: pvIn .16s ease-out; }
.mg-head { display: flex; align-items: center; padding: 14px 14px 6px 24px; }
.mg-head h2 { margin: 0; font-size: 18px; font-weight: 700; }
.mg-name { padding: 6px 24px 16px; display: flex; flex-direction: column; gap: 6px; }
.mg-name label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.mg-name input { height: 42px; border: 1px solid #DCE0E6; border-radius: 10px; padding: 0 12px; font-size: 16px; font-weight: 600; font-family: inherit; outline: none; }
.mg-name input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31,95,209,.15); }
.mg-cols { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 0; border-top: 1px solid var(--line); }
.mg-pick, .mg-sel { min-height: 0; display: flex; flex-direction: column; }
.mg-sel { border-left: 1px solid var(--line); background: #FAFBFC; }
.mg-tools { display: flex; gap: 8px; padding: 14px 16px 10px 24px; }
.mg-search { flex: 1; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border: 1px solid #DCE0E6; border-radius: 9px; color: var(--ink-3); }
.mg-search input { flex: 1; min-width: 0; border: 0; outline: none; font-family: inherit; font-size: 13px; color: var(--ink); background: transparent; }
.mg-tools select { height: 36px; max-width: 160px; border: 1px solid #DCE0E6; border-radius: 9px; padding: 0 8px; font-size: 13px; font-family: inherit; background: #fff; }
.mg-list { flex: 1; min-height: 0; overflow-y: auto; padding: 0 12px 12px 18px; }
.mg-it { width: 100%; display: flex; align-items: center; gap: 10px; padding: 7px 8px; border: 0; border-radius: 8px; background: transparent; text-align: left; cursor: pointer; font-family: inherit; color: var(--ink); }
.mg-it:hover { background: #F4F6FA; }
.mg-it.on { background: #F0F5FF; }
.mg-av { width: 32px; height: 32px; border-radius: 50%; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.mg-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mg-t b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mg-t span { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mg-add { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid #C9CFD8; color: var(--ink-3); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.mg-it:hover .mg-add { border-color: var(--accent); color: var(--accent); }
.mg-it.on .mg-add { background: var(--accent); border-color: var(--accent); color: #fff; }
.mg-selh { display: flex; align-items: center; gap: 6px; padding: 20px 16px 10px 20px; font-size: 13px; }
.mg-selh span { color: var(--ink-3); }
.mg-selh .lnk { border: 0; background: none; color: var(--ink-2); font-size: 12px; font-weight: 600; cursor: pointer; padding: 0; }
.mg-selh .lnk:hover { color: #C4314B; }
.mg-members { flex: 1; min-height: 0; overflow-y: auto; padding: 0 12px 12px 14px; }
.mg-m { display: flex; align-items: center; gap: 10px; padding: 6px 6px; border-radius: 8px; }
.mg-m:hover { background: #fff; }
.mg-m button { width: 26px; height: 26px; border: 0; border-radius: 6px; background: transparent; color: var(--ink-3); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; opacity: .6; }
.mg-m:hover button { opacity: 1; }
.mg-m button:hover { background: #FEF0EF; color: #C4314B; }
.mg-empty, .mg-more { font-size: 12px; color: var(--ink-3); padding: 16px 8px; text-align: center; }
.mg-foot { display: flex; align-items: center; gap: 8px; padding: 12px 16px 12px 24px; border-top: 1px solid var(--line); }
.mg-foot .btn { height: 38px; }
.mg-foot .btn-primary:disabled { opacity: .45; cursor: not-allowed; }
/* Tidsvælger (skriv eller vælg) */
.tsel { position: relative; display: inline-flex; }
.tsel .f-in.t { width: 96px; padding-right: 26px; cursor: text; }
.tsel-caret { position: absolute; right: 10px; top: 50%; width: 7px; height: 7px; border-right: 1.6px solid var(--ink-3); border-bottom: 1.6px solid var(--ink-3); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.tsel-list { position: absolute; top: calc(100% + 4px); left: 0; min-width: 150px; max-height: 264px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px rgba(16,24,40,.16); padding: 4px; z-index: 20; }
.tsel-it { display: flex; align-items: baseline; gap: 10px; padding: 7px 10px; border-radius: 6px; font-size: 13px; cursor: pointer; }
.tsel-it b { font-weight: 600; font-variant-numeric: tabular-nums; }
.tsel-it span { font-size: 12px; color: var(--ink-3); }
.tsel-it:hover { background: #F4F6FA; }
.tsel-it.on { background: #F0F5FF; }
.tsel-it.cur b { color: var(--accent); }
/* Ens dropdown-pil på alle valglister (som tidsvælgeren i Ny aftale) */
.h-range select, select.f-in, .mg-tools select {
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath d='M2 3.5l3 3 3-3' fill='none' stroke='%236B7485' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 10px 10px;
  padding-right: 28px; cursor: pointer;
}
select.f-in:disabled { cursor: default; }
/* Mødelokale i "Sted" */
.cmp-locw { position: relative; }
.room-ac { left: 0; width: min(520px, 100%); }
.ac-h { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); padding: 8px 8px 4px; }
.ac-it .badge, .cmp-roomchip .badge { font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 5px; margin-left: auto; flex: none; }
.cmp-av.room { background: #EBEDF1; color: var(--ink-2); border-radius: 8px; }
.ac-it .cmp-av.room, .ac-it .cmp-av { width: 30px; height: 30px; }
.cmp-roomchip { display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 4px 0 8px; border-radius: 7px; background: #F1F3F6; color: var(--ink); font-size: 13px; white-space: nowrap; }
.cmp-roomchip > span:not(.badge) { color: var(--ink-3); font-size: 12px; }
.cmp-roomchip .badge { margin-left: 0; }
.cmp-roomchip button { width: 20px; height: 20px; border: 0; border-radius: 5px; background: transparent; color: #6B7485; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.cmp-roomchip button:hover { background: #E3E6EB; }
.cmp-loc #e-room:empty { display: none; }

/* ================= Udvidet lokalesøgning (fanen Lokaler) ================= */
.cmp-tabs button:not(:disabled) { cursor: pointer; }
.rs { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.rs[hidden], .cmp-pnav[hidden], .cmp-pscroll[hidden], .cmp-pfoot[hidden] { display: none !important; }
.rs-filters { padding: 14px 16px 10px; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--line); }
.rs-filters label:not(.chip-cb):not(.chk) { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--ink-2); min-width: 0; }
.rs-filters select, .rs-filters input[type="number"], .rs-filters input[type="search"] { height: 34px; border: 1px solid #DCE0E6; border-radius: 8px; padding: 0 10px; font-size: 13px; font-family: inherit; color: var(--ink); background-color: #fff; width: 100%; box-sizing: border-box; }
.rs-filters select { -webkit-appearance: none; appearance: none; padding-right: 28px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath d='M2 3.5l3 3 3-3' fill='none' stroke='%236B7485' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; cursor: pointer; }
.rs-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rs-feat { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rs-feat > span { font-size: 12px; font-weight: 600; color: var(--ink-2); margin-right: 4px; }
.chip-cb { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border: 1px solid #DCE0E6; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--ink-2); cursor: pointer; user-select: none; }
.chip-cb input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip-cb:has(input:checked) { background: #111827; border-color: #111827; color: #fff; }
.chip-cb:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.rs-opts { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.rs-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 12px 16px 6px; font-size: 13px; }
.rs-list { flex: 1; min-height: 0; overflow-y: auto; padding: 0 10px 12px; }
.rs-it { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 9px; }
.rs-it:hover { background: #F6F8FB; }
.rs-it.on { background: #F0F5FF; }
.rs-it .cmp-av.room { width: 34px; height: 34px; }
.rs-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.rs-t b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rs-t > span { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rs-eq { display: flex; gap: 4px; margin-top: 2px; }
.rs-eq i { font-style: normal; font-size: 10px; font-weight: 700; color: var(--ink-2); background: #EEF0F3; padding: 1px 6px; border-radius: 4px; }
.rs-it .badge { font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 5px; flex: none; }
.rs-it .btn { height: 30px; padding: 0 12px; flex: none; }
.cmp-plan:has(.rs:not([hidden])) { height: calc(100vh - 56px - 130px); }
/* Hurtigsøgning efter person */
.qf { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 45; display: flex; align-items: center; gap: 10px; min-width: 360px; height: 48px; padding: 0 12px 0 16px; background: #111827; color: #fff; border-radius: 14px; box-shadow: 0 16px 40px rgba(16,24,40,.32); animation: qfIn .14s ease-out; }
@keyframes qfIn { from { transform: translate(-50%, 8px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
.qf svg { width: 16px; height: 16px; color: #9AA3B2; flex: none; }
.qf input { width: 140px; border: 0; outline: none; background: transparent; color: #fff; font-size: 15px; font-weight: 600; font-family: inherit; }
.qf-hint { flex: 1; font-size: 13px; color: #C9CFD8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qf.none .qf-hint { color: #F4A6A6; }
.qf kbd { font-family: inherit; font-size: 11px; font-weight: 700; color: #C9CFD8; border: 1px solid #3B4352; border-radius: 6px; padding: 2px 6px; }

/* "Efter afdeling" som træ (land → by → afdeling) */
.otree { display: flex; flex-direction: column; }
.src.orow { padding-left: calc(var(--d, 0) * 14px); }
.src.orow .src-btn { padding-left: 2px; height: 30px; }
.otog { flex: none; width: 22px; height: 26px; display: flex; align-items: center; justify-content: center; border: 0; background: transparent; color: var(--ink-3); border-radius: 6px; padding: 0; }
button.otog:hover { background: #fff; color: var(--ink); }
.otog svg { width: 12px; height: 12px; transition: transform .15s; }
.orow[aria-expanded="true"] > .otog svg { transform: rotate(90deg); }
.src.orow .star { opacity: 0; }
.src.orow:hover .star, .src.orow .star.on, .src.orow .star:focus-visible { opacity: 1; }

/* ---------- Filter: vis-type, arbejdstid og kategorier ---------- */
.fpop { width: 330px; max-height: calc(100vh - 170px); overflow-y: auto; padding-bottom: 6px; }
.fpop .fkind { display: flex; margin: 2px 10px 6px; }
.fpop .fkind button { flex: 1; padding: 0 6px; }
.fpop .f-hint { margin: 0; padding: 2px 10px 6px; font-size: 11.5px; line-height: 1.4; color: var(--ink-3); }
.fpop .f-hint code { font-size: 11px; }
.fpop .pop-row .pr-t { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.fpop .pop-row .pr-t small { font-size: 11.5px; color: var(--ink-3); font-weight: 400; }
.wh-sw { width: 22px; height: 14px; border-radius: 4px; background: rgba(66, 133, 244, .1); border: 1px solid rgba(66, 133, 244, .22); flex: none; }
.fpop .fcat-h { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; border-top: 1px solid var(--line); padding-top: 12px; }
.fpop .fcat-h em { font-style: normal; font-weight: 600; color: var(--ink-3); margin-left: 4px; letter-spacing: 0; }
.fpop .fcat-h .a { display: flex; gap: 12px; text-transform: none; letter-spacing: 0; }
.fpop .fcat-h .more { padding: 0; }
.fpop .fcat-list { max-height: 264px; overflow-y: auto; padding: 0 4px; }
.fpop .cat-row.zero .c { color: var(--ink-3); }
.fbadge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; }

/* Uden for arbejdstiden: lysblåt lag under aftalerne */
.nwh { position: absolute; top: 0; bottom: 0; background: rgba(66, 133, 244, .055); pointer-events: none; z-index: 0; }
.dc.we .nwh { background: rgba(66, 133, 244, .07); }

/* Lokaler og ressourcer i listen */
.av.av-res { background: #EEF1F5; color: #4A5568; border-radius: 8px; }
.av.av-res svg { width: 16px; height: 16px; stroke-width: 1.8; }

/* Egne beskrivelser af kategorier (Filter) */
.fpop .fcat-item { display: flex; align-items: center; gap: 2px; }
.fpop .fcat-item .cat-row { flex: 1; min-width: 0; }
.fpop .cat-pill { gap: 6px; }
.fpop .cat-pill .cp-t { overflow: hidden; text-overflow: ellipsis; }
.fpop .cat-pill .cp-o { font-weight: 500; font-size: 11px; opacity: .7; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; }
.fpop .fcat-ed { flex: none; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 6px; background: transparent; color: var(--ink-3); cursor: pointer; opacity: 0; }
.fpop .fcat-ed.ph { cursor: default; }
.fpop .fcat-ed svg { width: 14px; height: 14px; }
.fpop .fcat-item:hover .fcat-ed, .fpop .fcat-ed:focus-visible, .fpop .fcat-item.editing .fcat-ed { opacity: 1; }
.fpop .fcat-ed:hover { background: var(--ground); color: var(--ink); }
.fpop .fcat-item.editing { padding: 3px 0 0 8px; }
.fpop .cat-sw { width: 16px; height: 16px; border-radius: 4px; flex: none; margin-right: 6px; }
.fpop .cat-desc-in { flex: 1; min-width: 0; height: 28px; padding: 0 8px; border: 1px solid var(--accent); border-radius: 6px; font: inherit; font-size: 12.5px; outline: none; box-shadow: 0 0 0 3px rgba(31, 95, 209, .15); }
.fpop .fcat-sub { padding: 3px 8px 6px 30px; font-size: 11px; color: var(--ink-3); }

.fpop .f-hint .sync { display: inline-block; margin-top: 4px; font-weight: 600; }
.fpop .f-hint .sync.ok { color: #1E7A48; }
.fpop .f-hint .sync.warn { color: #9A5B00; }

/* ---------- Brugerindstillinger (avatar → Indstillinger) ---------- */
.us-wrap { position: fixed; inset: 0; z-index: 70; }
.us-bg { position: absolute; inset: 0; background: rgba(17,24,39,.28); animation: usFade .16s ease-out; }
.us { position: absolute; top: 0; right: 0; bottom: 0; width: min(460px, 100vw); background: var(--surface); box-shadow: -16px 0 40px rgba(16,24,40,.18); display: flex; flex-direction: column; animation: usIn .2s cubic-bezier(.2,.8,.2,1); }
.us-wrap.closing .us { transform: translateX(100%); transition: transform .16s ease-in; }
.us-wrap.closing .us-bg { opacity: 0; transition: opacity .16s; }
@keyframes usIn { from { transform: translateX(100%); } to { transform: none; } }
@keyframes usFade { from { opacity: 0; } to { opacity: 1; } }
.us-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 14px 10px 24px; }
.us-head h2 { margin: 0; font-size: 18px; font-weight: 700; }
.us-x { width: 34px; height: 34px; border: 0; background: transparent; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--ink-2); }
.us-x:hover { background: var(--ground); }
.us-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 24px 20px; display: flex; flex-direction: column; gap: 14px; }
.us-me { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--ground); }
.us-me > div { min-width: 0; display: flex; flex-direction: column; }
.us-me b { font-size: 14px; }
.us-me span { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.us-av { width: 42px; height: 42px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
.us-sec { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px 14px; display: flex; flex-direction: column; gap: 10px; }
.us-sec h3 { margin: 0 0 2px; display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.us-sec h3 svg { color: var(--accent); }
.us-src { margin-left: auto; font-size: 11px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--ink-3); background: var(--ground); padding: 2px 8px; border-radius: 999px; }
.us-row { display: grid; grid-template-columns: 130px minmax(0, 1fr); align-items: center; gap: 12px; font-size: 13px; }
.us-row > span:first-child { color: var(--ink-2); font-weight: 500; }
.us-sel { height: 34px; width: 100%; border: 1px solid #DCE0E6; border-radius: 8px; padding: 0 10px; background: var(--surface); outline: none; font-size: 13px; }
.us-sel:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31,95,209,.15); }
.us-sel.sm { width: 92px; }
.us-hours { display: flex; align-items: center; gap: 8px; }
.us-hours i { font-style: normal; color: var(--ink-3); }
.us-sw { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; cursor: pointer; padding: 2px 0; }
.us-sw input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.us-sw input:checked + .tgl-t { background: var(--accent); }
.us-sw input:checked + .tgl-t::after { left: 19px; }
.us-sw input:focus-visible + .tgl-t { box-shadow: 0 0 0 3px rgba(31,95,209,.25); }
.us-sw-t { display: flex; flex-direction: column; font-weight: 500; }
.us-sw-t small { font-size: 12px; color: var(--ink-3); font-weight: 400; margin-top: 1px; }
.us-note { margin: 0; font-size: 12px; color: var(--ink-3); line-height: 1.45; }
.us-note a { color: var(--accent); font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.us-note a:hover { text-decoration: underline; }
.us-val { font-weight: 600; font-size: 13px; }
.us-days { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line-soft); border-radius: 10px; overflow: hidden; }
.us-days li { display: flex; justify-content: space-between; padding: 7px 12px; font-size: 13px; color: var(--ink-3); }
.us-days li + li { border-top: 1px solid var(--line-soft); }
.us-days li.on { color: var(--ink); }
.us-days li.on span:last-child { font-variant-numeric: tabular-nums; font-weight: 600; }
.us-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 24px; border-top: 1px solid var(--line); }
.us-sync { font-size: 12px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.us-sync .sync { font-weight: 600; color: var(--ink-3); }
.us-sync .sync.ok { color: #1E7A48; }
.us-sync .sync.warn { color: #9A5B00; }
.us-tz { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.us-iv { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.us-iv > span { display: inline-flex; align-items: center; gap: 8px; }
.us-iv b { font-variant-numeric: tabular-nums; font-weight: 600; }
.us-loc { display: inline-flex; align-items: center; gap: 4px; font-style: normal; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--ground); color: var(--ink-2); }
.us-loc.office { background: var(--accent-soft); color: var(--accent); }
/* Dropdowns i Indstillinger: egen pil med luft til kanten */
.us-sel { -webkit-appearance: none; appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7485' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; background-size: 12px; }
.us-sel:hover { border-color: #C5CBD5; }
/* Hjemme/Kontor i egen række (øverst til venstre i datofeltet) */
.wloc { position: absolute; left: 3px; top: 3px; z-index: 3; width: 18px; height: 18px; border-radius: 5px; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.92); color: var(--ink-3); box-shadow: 0 0 0 1px var(--line); }
.wloc svg { width: 12px; height: 12px; }
.wloc.office { color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px #CFDDF8; }
/* Hjemme/Kontor: lille ikon uden kasse, holdes over de centrerede aftaler (starter ca. 17px nede) */
.wloc { left: 4px; top: 2px; width: 12px; height: 12px; border-radius: 0; background: none; box-shadow: none; color: #8A93A3; }
.wloc svg { width: 11px; height: 11px; stroke-width: 2.2; }
.wloc.office { background: none; box-shadow: none; color: var(--accent); }
/* Egne grupper: søg i personer / lokaler / ressourcer / alle */
.mg-kinds { display: flex; gap: 4px; padding: 14px 16px 0 24px; }
.mg-kind { height: 28px; padding: 0 12px; border: 1px solid #DCE0E6; border-radius: 999px; background: #fff; font-size: 12px; font-weight: 600; color: var(--ink-2); cursor: pointer; font-family: inherit; }
.mg-kind:hover { border-color: #C5CBD5; color: var(--ink); }
.mg-kind.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.mg-kinds + .mg-tools { padding-top: 10px; }
.mg-av-room, .mg-av-resource { border-radius: 9px; background: #EEF1F5; color: var(--ink-2); }
.mg-av-room { background: #E8F4EE; color: #1E7A48; }
.mg-av-resource { background: #FFF4E5; color: #9A5B00; }

/* Træk for ny aftale: grøn = alle ledige, rød = konflikt */
.dragsel.ok { background: rgba(22, 163, 74, .18); border-color: #16A34A; color: #126C36; }
.dragsel.bad { background: rgba(220, 38, 38, .16); border-color: #DC2626; color: #A11B1B; }
.dc.dragday.ok { background: rgba(22, 163, 74, .14) !important; box-shadow: inset 0 0 0 2px #16A34A; }
.dc.dragday.bad { background: rgba(220, 38, 38, .12) !important; box-shadow: inset 0 0 0 2px #DC2626; }
.dc.dragday.ok[data-span]::after { color: #126C36; }
.dc.dragday.bad[data-span]::after { color: #A11B1B; }

/* Flyt og ændr størrelse på aftaler med musen */
.ev.mv { cursor: grab; }
.ev .rz { position: absolute; top: 0; bottom: 0; width: 6px; cursor: ew-resize; z-index: 2; }
.ev .rz-l { left: 0; }
.ev .rz-r { right: 0; }
.ev.mv:hover .rz { background: rgba(0, 0, 0, .08); }
body.dragging.dragmove, body.dragging.dragmove * { cursor: grabbing !important; }
body.dragging.dragresize, body.dragging.dragresize * { cursor: ew-resize !important; }
.ev.evsrc { opacity: .35; }
.ev.evghost { pointer-events: none; z-index: 4; box-shadow: 0 6px 16px rgba(16, 24, 40, .22); }
.ev.evghost.ok { outline: 2px solid #16A34A; outline-offset: 1px; }
.ev.evghost.bad { outline: 2px solid #DC2626; outline-offset: 1px; }

/* ================= Oversigter: Gruppe / Person / Ugeplan / Fravær / Liste (js/views.js) ================= */
.mode-btn { min-width: 118px; justify-content: flex-start; }
.mode-btn svg:last-child { margin-left: auto; width: 14px; height: 14px; color: var(--ink-3); }
.mpop { min-width: 300px; }
.mpop button { align-items: flex-start; }
.mpop button > svg:first-child { margin-top: 2px; color: var(--ink-2); }
.mpop .m-txt { flex: 1; display: flex; flex-direction: column; font-weight: 600; }
.mpop .m-txt .m-sub { font-weight: 400; }
.mpop button.m-on > svg:first-child, .mpop button.m-on > svg:last-child { color: var(--accent); }

.grid.xv { min-width: 980px; user-select: none; -webkit-user-select: none; }
.xv .empty { padding: 32px; text-align: center; color: var(--ink-3); }
.xv-note { font-size: 11px; font-weight: 600; color: #8A5A00; background: #FFF4D6; border-radius: 6px; padding: 2px 7px; white-space: nowrap; }
.xv-nm { border: 0; background: none; padding: 0; font-weight: 700; font-size: 13px; color: var(--ink); text-align: left; }
.xv-nm:hover { color: var(--accent); text-decoration: underline; }

/* fælles statusfarver for aftaler uden kategori */
.xv-ev, .tf-bar { background: var(--busy-bg); color: var(--busy-fg); }
.xv-ev.st-tentative, .tf-bar.st-tentative { background-color: #E3ECFF; color: var(--tent-fg); box-shadow: inset 0 0 0 1px var(--tent-bd); background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.65) 0 5px, transparent 5px 10px); }
.xv-ev.st-oof, .tf-bar.st-oof { background: var(--oof-bg); color: var(--oof-fg); }
.xv-ev.st-workingElsewhere, .tf-bar.st-workingElsewhere { background: #fff; color: var(--else-fg); box-shadow: inset 0 0 0 1px var(--else-bd); }
.xv-ev.st-free, .tf-bar.st-free { background: #F4F6F9; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.xv-ev.cat, .tf-bar.cat { box-shadow: none; background-image: none; }

/* ---- Person ---- */
.iv { display: grid; grid-template-columns: 236px minmax(0, 1fr); align-items: start; min-height: 100%; }
.iv-list { position: sticky; top: 0; align-self: start; max-height: calc(100vh - 230px); overflow-y: auto; border-right: 1px solid var(--line); background: #FBFCFD; padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.iv-lh { display: flex; align-items: center; gap: 8px; padding: 6px 8px 10px; font-size: 13px; color: var(--ink-2); }
.iv-lh b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iv-li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 0; border-radius: 8px; background: transparent; text-align: left; min-width: 0; }
.iv-li:hover { background: #EEF2F7; }
.iv-li.on { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.iv-li > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.iv-li b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iv-li b i { font-style: normal; font-weight: 400; color: var(--ink-3); }
.iv-li small { font-size: 11px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iv-main { min-width: 0; padding-bottom: 12px; }
.iv-top { position: sticky; top: 0; z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line); }
.iv-who { display: flex; align-items: center; gap: 12px; padding: 12px 16px 8px; }
.iv-who > div { display: flex; flex-direction: column; }
.iv-name { border: 0; background: none; padding: 0; font-size: 16px; font-weight: 700; text-align: left; }
.iv-name:hover { color: var(--accent); }
.iv-who small { font-size: 12px; color: var(--ink-3); }
.iv-dh { display: grid; font-size: 12px; font-weight: 600; color: var(--ink-2); padding: 0 0 6px; }
.iv-dh span { padding: 0 8px; }
.iv-dh .xwe { color: var(--ink-3); }
.iv-month { padding: 14px 16px 6px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.iv-wk { display: grid; border-top: 1px solid var(--line-soft); }
.iv-wn { font-size: 11px; font-weight: 600; color: var(--ink-3); padding: 8px 0 0 12px; }
.iv-cell { border-left: 1px solid var(--line-soft); padding: 4px 4px 6px; min-height: 92px; display: flex; flex-direction: column; gap: 3px; }
.iv-cell.xwe { background: #F8F9FB; }
.iv-cell.today { background: #F0F5FF; box-shadow: inset 0 2px 0 var(--accent); }
.iv-dn { align-self: flex-start; border: 0; background: none; padding: 1px 4px; border-radius: 5px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.iv-dn:hover { background: var(--accent-soft); color: var(--accent); }
.iv-cell.today .iv-dn { background: var(--accent); color: #fff; }
.iv-long { display: flex; flex-direction: column; gap: 2px; }
.iv-tl { position: relative; flex: 1; border-radius: 6px; background-image: linear-gradient(to right, var(--hour-line) 1px, transparent 1px); background-size: var(--hp) 100%; cursor: cell; }
.xv-ev { position: absolute; height: 18px; border: 0; border-radius: 4px; padding: 0 5px; font-size: 11px; font-weight: 600; display: flex; align-items: center; gap: 3px; overflow: hidden; white-space: nowrap; text-align: left; }
.xv-ev span { overflow: hidden; text-overflow: ellipsis; }
.xv-ev svg { width: 11px; height: 11px; flex: none; }
.xv-ev.long { position: static; width: 100%; }
.xv-ev.long.cl { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.xv-ev.long.cr { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.xv-ev:hover, .wp-card:hover, .tf-bar:hover { filter: brightness(.96); outline: 2px solid rgba(31,95,209,.35); outline-offset: 0; z-index: 2; }

/* ---- Ugeplan ---- */
.wp-top { position: sticky; top: 0; z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line); }
.wp-head { display: grid; align-items: end; }
.wp-corner { display: flex; align-items: center; justify-content: center; height: 44px; color: var(--ink-3); }
.wp-dh { display: flex; align-items: baseline; gap: 6px; padding: 10px 10px 8px; border-left: 1px solid var(--line-soft); font-size: 13px; color: var(--ink-2); }
.wp-dh b { font-size: 18px; color: var(--ink); }
.wp-dh.xwe { color: var(--ink-3); }
.wp-dh.today b { color: #fff; background: var(--accent); border-radius: 8px; padding: 0 7px; }
.wp-person { border-bottom: 1px solid var(--line); }
.wp-person.xme { background: #FAFCFF; }
.wp-name { display: flex; align-items: center; gap: 14px; padding: 6px 12px; background: #F4F6F9; border-bottom: 1px solid var(--line-soft); font-size: 12px; color: var(--ink-3); position: sticky; left: 0; }
.wp-row { display: grid; }
.wp-av { display: flex; justify-content: center; padding-top: 8px; }
.wp-cell { border-left: 1px solid var(--line-soft); padding: 5px; min-height: 52px; display: flex; flex-direction: column; gap: 4px; cursor: cell; }
.wp-cell.xwe { background: #F8F9FB; }
.wp-cell.today { background: #F3F7FF; }
.wp-card { display: flex; align-items: stretch; gap: 6px; width: 100%; padding: 4px 6px; border: 1px solid var(--line); border-radius: 7px; background: #fff; text-align: left; cursor: pointer; min-height: 36px; }
.wp-card.st-free { opacity: .8; }
.wp-card.st-tentative { border-style: dashed; }
.wp-t { display: flex; flex-direction: column; width: 40px; flex: none; font-size: 11px; color: var(--ink-3); line-height: 1.35; font-variant-numeric: tabular-nums; }
.wp-t b { color: var(--ink); font-weight: 700; }
.wp-bar { display: block; width: 4px; flex: none; border-radius: 2px; align-self: stretch; }
.wp-s { display: flex; flex-direction: column; min-width: 0; font-size: 12px; line-height: 1.35; }
.wp-sj { font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wp-sj svg { width: 11px; height: 11px; margin-right: 3px; vertical-align: -1px; }
.wp-s small { color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- Fravær ---- */
.tf { min-width: calc(var(--namecol) + var(--tfn) * 18px); }
.tf-top { position: sticky; top: 0; z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line); }
.tf-hrow, .tf-row { display: grid; grid-template-columns: var(--namecol) minmax(0, 1fr); }
.tf-corner { display: flex; flex-direction: column; justify-content: center; padding: 8px 14px 2px; font-size: 13px; position: sticky; left: 0; background: var(--surface); z-index: 2; }
.tf-corner small, .tf-corner.sub { font-size: 11px; color: var(--ink-3); padding-top: 0; padding-bottom: 6px; }
.tf-months, .tf-days, .tf-bg, .tf-bars { display: grid; }
.tf-months span { padding: 10px 6px 4px; font-size: 13px; font-weight: 700; color: var(--ink-2); border-left: 1px solid var(--line); white-space: nowrap; overflow: hidden; }
.tf-days span { display: flex; flex-direction: column; align-items: center; font-size: 11px; font-weight: 600; color: var(--ink-2); padding: 2px 0 6px; border-left: 1px solid var(--line-soft); font-variant-numeric: tabular-nums; }
.tf-days span i { font-style: normal; font-weight: 400; color: var(--ink-3); font-size: 10px; }
.tf-days span.xwe { color: var(--ink-3); background: #F6F7F9; }
.tf-days span.mon { border-left-color: #D5DAE2; }
.tf-days span.today { color: #fff; background: var(--accent); border-radius: 6px 6px 0 0; }
.tf-days span.today i { color: rgba(255,255,255,.8); }
.tf-row { border-bottom: 1px solid var(--line-soft); }
.tf-row.xme { background: #FAFCFF; }
.tf-name { display: flex; align-items: center; gap: 8px; padding: 6px 12px; min-width: 0; position: sticky; left: 0; background: inherit; background-color: var(--surface); z-index: 2; }
.tf-row.xme .tf-name { background-color: #FAFCFF; }
.tf-name > span { display: flex; flex-direction: column; min-width: 0; }
.tf-name small { font-size: 11px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tf-track { position: relative; min-height: 44px; }
.tf-bg { position: absolute; inset: 0; }
.tf-bg span { border-left: 1px solid var(--line-soft); cursor: cell; }
.tf-bg span.xwe { background: #F6F7F9; }
.tf-bg span.mon { border-left-color: #E1E5EB; }
.tf-bg span.today { background: rgba(31,95,209,.08); box-shadow: inset 1px 0 0 var(--accent), inset -1px 0 0 var(--accent); }
.tf-bars { position: relative; grid-auto-rows: 20px; row-gap: 3px; padding: 11px 0; pointer-events: none; }
.tf-bar { pointer-events: auto; margin: 0 1px; border: 0; border-radius: 5px; padding: 0 6px; font-size: 11px; font-weight: 600; text-align: left; white-space: nowrap; overflow: hidden; display: flex; align-items: center; min-width: 0; }
.tf-bar span { overflow: hidden; text-overflow: ellipsis; }
.tf-bar.cl { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: 0; }
.tf-bar.cr { border-top-right-radius: 0; border-bottom-right-radius: 0; margin-right: 0; }

/* ---- Liste ---- */
.ls-search { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 1px solid #DCE0E6; border-radius: 8px; background: #fff; min-width: 320px; color: var(--ink-3); }
.ls-search input { border: 0; outline: 0; flex: 1; min-width: 0; height: 100%; color: var(--ink); background: transparent; }
.ls-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ls-sel { height: 32px; border: 1px solid #DCE0E6; border-radius: 8px; padding: 0 8px; background: #fff; max-width: 220px; }
.ls { min-width: 980px; }
.ls-info { display: flex; align-items: center; gap: 10px; padding: 10px 14px; font-size: 12px; color: var(--ink-3); border-bottom: 1px solid var(--line-soft); }
.ls-info b { color: var(--ink); font-size: 13px; }
.ls-info .grow, .ls-day .grow { flex: 1; }
.ls-top { position: sticky; top: 0; z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line); }
.ls-grid { display: grid; grid-template-columns: 68px 92px minmax(170px, 1.3fr) minmax(200px, 2fr) minmax(110px, 1fr) minmax(110px, 1fr) minmax(130px, 1fr); align-items: center; column-gap: 10px; padding: 0 14px; }
.ls-head button { border: 0; background: none; padding: 9px 0; font-size: 12px; font-weight: 700; color: var(--ink-2); text-align: left; display: flex; gap: 4px; align-items: center; }
.ls-head button:hover, .ls-head button.on { color: var(--accent); }
.ls-arr { font-size: 9px; }
.ls-day { display: flex; gap: 10px; align-items: baseline; padding: 8px 14px 6px; background: #F4F6F9; border-bottom: 1px solid var(--line-soft); font-size: 12px; color: var(--ink-3); position: sticky; top: 37px; z-index: 3; }
.ls-day b { font-size: 13px; color: var(--ink); }
.ls-day.today b { color: var(--accent); }
.ls-row { width: 100%; border: 0; border-bottom: 1px solid var(--line-soft); background: #fff; text-align: left; padding-top: 6px; padding-bottom: 6px; font-size: 13px; }
.ls-row:hover { background: #F7F9FC; }
.ls-row > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ls-t { font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 8px; color: var(--ink-2); }
.ls-t b { color: var(--ink); }
.ls-t .wp-bar { height: 22px; margin-left: auto; }
.ls-p { display: flex; align-items: center; gap: 8px; }
.ls-p > span { display: flex; flex-direction: column; min-width: 0; }
.ls-p b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.ls-p small { font-size: 11px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; }
.ls-s { font-weight: 600; }
.ls-s svg { width: 12px; height: 12px; margin-right: 4px; vertical-align: -2px; color: var(--ink-3); }
.ls-row.st-free .ls-s { font-weight: 500; color: var(--ink-2); }
.ls-l, .ls-o { color: var(--ink-2); }
.ls-c { display: flex; gap: 4px; }
.ls-cat { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 10px; white-space: nowrap; }

@media print {
  .iv-list { display: none; }
  .iv { grid-template-columns: 1fr; }
  .wp-top, .tf-top, .ls-top, .iv-top, .ls-day { position: static; }
}
.ls-wide .ls-grid { grid-template-columns: 112px 104px minmax(170px, 1.3fr) minmax(200px, 2fr) minmax(110px, 1fr) minmax(110px, 1fr) minmax(130px, 1fr); }

/* ---- Person → Uger: indlæsning af flere uger ---- */
.iv-more { padding: 18px; text-align: center; font-size: 12px; color: var(--ink-3); border-top: 1px solid var(--line-soft); }

/* ---- Person → Uge: ugekalender efter Outlooks skabelon ---- */
.ow-main .iv-who { border-bottom: 1px solid var(--line-soft); }
.ow-top { position: sticky; top: 0; z-index: 6; background: var(--surface); border-bottom: 1px solid var(--line); }
.ow-head { display: grid; }
.ow-wk { display: flex; align-items: flex-end; justify-content: center; padding-bottom: 8px; font-size: 11px; font-weight: 600; color: var(--ink-3); }
.ow-dh { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 6px; padding: 10px 10px 8px 12px; border-left: 1px solid var(--line-soft); min-width: 0; }
.ow-dn { display: flex; flex-direction: column; align-items: flex-start; border: 0; background: none; padding: 0; text-align: left; color: var(--ink); min-width: 0; }
.ow-dn b { font-size: 20px; font-weight: 600; line-height: 1.1; }
.ow-dn span { font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ow-dn:hover b, .ow-dn:hover span { color: var(--accent); }
.ow-dh.today { box-shadow: inset 0 3px 0 var(--accent); }
.ow-dh.today .ow-dn b, .ow-dh.today .ow-dn span { color: var(--accent); }
.ow-dh.xwe .ow-dn b, .ow-dh.xwe .ow-dn span { color: var(--ink-3); }
.ow-wl { display: inline-flex; width: 22px; height: 22px; align-items: center; justify-content: center; border-radius: 6px; color: var(--ink-2); flex: none; margin-bottom: 2px; }
.ow-wl svg { width: 15px; height: 15px; }
.ow-wl.office { color: var(--accent); background: var(--accent-soft); }
.ow-allday { display: grid; border-top: 1px solid var(--line-soft); }
.ow-adbars { display: grid; grid-auto-rows: 22px; row-gap: 2px; padding: 4px 0; min-height: 30px; position: relative; }
.ow-adbg { border-left: 1px solid var(--line-soft); margin: -4px 0; cursor: cell; }
.ow-adbg.xwe { background: #F8F9FB; }
.ow-adbar { z-index: 1; margin: 0 3px; border: 0; border-left: 4px solid; border-radius: 4px; padding: 0 6px; font-size: 12px; font-weight: 600; text-align: left; display: flex; align-items: center; gap: 4px; overflow: hidden; white-space: nowrap; min-width: 0; }
.ow-adbar span { overflow: hidden; text-overflow: ellipsis; }
.ow-adbar svg { width: 11px; height: 11px; flex: none; }
.ow-adbar, .ow-ev { background: var(--busy-bg); color: var(--busy-fg); }
.ow-adbar.st-oof, .ow-ev.st-oof { background: var(--oof-bg); color: var(--oof-fg); }
.ow-adbar.st-free, .ow-ev.st-free { background: #F4F6F9; color: var(--ink-2); }
.ow-adbar.st-workingElsewhere, .ow-ev.st-workingElsewhere { background: #fff; color: var(--else-fg); box-shadow: inset 0 0 0 1px var(--else-bd); }
.ow-adbar.st-tentative, .ow-ev.st-tentative { background-color: #EEF3FF; color: var(--tent-fg); background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.7) 0 5px, transparent 5px 10px); }
.ow-adbar.cat, .ow-ev.cat { background-image: none; box-shadow: none; }
.ow-body { display: grid; position: relative; padding-top: 8px; padding-bottom: 12px; }
.ow-gut { position: relative; }
.ow-gut span { position: absolute; right: 8px; transform: translateY(-50%); font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.ow-gut span:first-child { transform: none; }
.ow-col { position: relative; border-left: 1px solid var(--line-soft); cursor: cell;
  background-image: linear-gradient(to bottom, #E6E9EE 1px, transparent 1px), linear-gradient(to bottom, #F2F4F7 1px, transparent 1px);
  background-size: 100% var(--hh), 100% calc(var(--hh) / 2); }
.ow-col.xwe { background-color: #F8F9FB; }
.ow-col.today { background-color: #F7FAFF; }
.ow-off { position: absolute; left: 0; right: 0; background: rgba(120, 135, 160, .08); pointer-events: none; }
.ow-ev { position: absolute; z-index: 1; border: 0; border-left: 4px solid; border-radius: 4px; padding: 3px 6px; text-align: left; font-size: 12px; line-height: 1.3; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 0 0 1px rgba(255,255,255,.9); }
.ow-ev b { font-weight: 600; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.ow-ev b svg { width: 11px; height: 11px; margin-right: 3px; vertical-align: -1px; }
.ow-ev span { font-size: 11px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ow-ev.short { padding-top: 1px; padding-bottom: 1px; }
.ow-ev.short b { -webkit-line-clamp: 1; white-space: nowrap; display: block; text-overflow: ellipsis; }
.ow-ev.ct { border-top-left-radius: 0; border-top-right-radius: 0; }
.ow-ev.cb { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.ow-ev:hover, .ow-adbar:hover { filter: brightness(.96); outline: 2px solid rgba(31,95,209,.35); z-index: 3; }
.ow-now { position: absolute; left: -1px; right: 0; height: 2px; background: #D13438; z-index: 4; pointer-events: none; }
.ow-now::before { content: ''; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: #D13438; }
@media print { .ow-top { position: static; } }

/* ---- Træk-og-slip i oversigterne ---- */
.xmv { cursor: grab; }
.xsrc { opacity: .35; }
.xghost { pointer-events: none; z-index: 6 !important; box-shadow: 0 8px 20px rgba(16, 24, 40, .25) !important; }
.xghost.ok { outline: 2px solid #16A34A; outline-offset: 1px; }
.xghost.bad { outline: 2px solid #DC2626; outline-offset: 1px; }
.xdrop { background-color: rgba(31, 95, 209, .10) !important; box-shadow: inset 0 0 0 2px var(--accent) !important; }
.xdrop.bad { background-color: rgba(220, 38, 38, .08) !important; box-shadow: inset 0 0 0 2px #DC2626 !important; }
.xdrag-tip { position: fixed; z-index: 1000; pointer-events: none; background: #111827; color: #fff; font-size: 12px; font-weight: 600; padding: 5px 9px; border-radius: 7px; box-shadow: 0 6px 16px rgba(16,24,40,.25); white-space: nowrap; }
.xdrag-tip.bad { background: #B42318; }
.ow-ev .rz-b { position: absolute; left: 0; right: 0; bottom: 0; height: 7px; cursor: ns-resize; }
.ow-sel { position: absolute; left: 2px; right: 2px; z-index: 5; pointer-events: none; background: rgba(31, 95, 209, .14); border: 1.5px solid var(--accent); border-radius: 5px; font-size: 11px; font-weight: 600; color: var(--accent); padding: 2px 6px; }
body.dragging.dragvres, body.dragging.dragvres * { cursor: ns-resize !important; }
.iv-sel { position: absolute; top: 2px; bottom: 2px; z-index: 5; pointer-events: none; background: rgba(31, 95, 209, .16); border: 1.5px solid var(--accent); border-radius: 4px; }

/* Person → Uge: hele døgnet i et scrollbart område */
.ow-top { overflow-y: hidden; scrollbar-gutter: stable; }
.ow-scroll { overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; position: relative; }
.ow-scroll .ow-body { padding-top: 0; padding-bottom: 0; }
.ow-gut span { font-size: 10.5px; }
.xv-person .iv-main.ow-main { display: flex; flex-direction: column; }
.ow-scroll .ow-gut span:first-child { transform: translateY(-50%); }
.iv-dh span { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding-right: 10px; }
.iv-wl { display: inline-flex; width: 22px; height: 22px; align-items: center; justify-content: center; border-radius: 6px; color: var(--ink-2); flex: none; }
.iv-wl svg { width: 15px; height: 15px; }
.iv-wl.office { color: var(--accent); background: var(--accent-soft); }
/* Info under træk i oversigterne: vises i den første markerede dag (som data-span i gruppevisningen) */
.xdrop { position: relative; }
.wp-cell.xdrop, .iv-cell.xdrop { position: relative; }
.ow-adbg.xdrop { position: relative; }
[data-xlabel]::after { content: attr(data-xlabel); position: absolute; left: 4px; bottom: 4px; z-index: 6; max-width: calc(100% - 8px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 700; color: #fff; background: var(--accent); border-radius: 5px; padding: 2px 6px; pointer-events: none; }
[data-xlabel].bad::after { background: #DC2626; }
.tf-bg span[data-xlabel]::after { bottom: auto; top: 2px; }
.tf-bg span[data-xlabel]::after { max-width: none; }
/* Træk i Person-oversigterne: grøn = ledig, rød = konflikt (samme farver som gruppevisningen) */
.iv-sel.ok, .ow-sel.ok { background: rgba(22, 163, 74, .18); border-color: #16A34A; color: #126C36; }
.iv-sel.bad, .ow-sel.bad { background: rgba(220, 38, 38, .16); border-color: #DC2626; color: #A11B1B; }
.iv-sel { font-size: 11px; font-weight: 700; color: var(--accent); display: flex; align-items: center; padding: 0 5px; white-space: nowrap; overflow: visible; }
.xdrop.ok { background-color: rgba(22, 163, 74, .12) !important; box-shadow: inset 0 0 0 2px #16A34A !important; }
[data-xlabel].ok::after { background: #16A34A; }

/* Person → Uger: uge-række som grid med sammenhængende heldagsbarer */
.iv-wk { position: relative; }
.iv-wk .iv-cell { padding: 0; min-height: 0; display: block; z-index: 0; }
.iv-wk .iv-dn { position: relative; z-index: 1; margin: 4px 0 2px 4px; }
.iv-dn.today { background: var(--accent); color: #fff; }
.iv-wk .iv-tl { z-index: 1; margin: 3px 4px 6px; }
.iv-wk .xv-ev.long { position: relative; z-index: 2; width: auto; height: 18px; margin: 1px 4px; align-self: center; }
.iv-wk .xv-ev.long.cl { margin-left: 0; }
.iv-wk .xv-ev.long.cr { margin-right: 0; }
.iv-wk .iv-dn { justify-self: start; align-self: start; }

/* Brugermenuen (avatar) skal altid ligge over kalenderen. Topbaren får sin egen stablingskontekst over
   hovedområdet, og hovedområdet isoleres, så sticky/scrollende lag i oversigterne (fx Person → Uge)
   ikke kan male sig oven på menuen (ses især i Safari). */
.topbar { position: relative; z-index: 50; }
.main { z-index: 0; isolation: isolate; }
.topbar .menu { transform: translateZ(0); }
.ow { position: relative; z-index: 0; isolation: isolate; }

/* Markeret række (klik på en person): blå lodret streg yderst til venstre, foran fluebenet.
   Stregen ligger på navnecellen, fordi den er sticky og ellers dækker rækkens egen skygge. */
.gr.prow.focus > :first-child { box-shadow: inset 4px 0 0 var(--accent); }
