/* D100-dashboard – fælles layout (samme udtryk som lønafstemningens oversigt) */
:root {
  color-scheme: light dark;
  --bg: #f3f2ef; --surface: #ffffff; --surface-2: #f7f6f3; --border: #e3e1db; --border-2: #d6d3cb;
  --text: #1b1d21; --text-2: #50545b; --muted: #80838a;
  --side: #10393b; --side-2: #1b4b4d; --side-text: #d9e6e5; --side-muted: #86a3a2;
  --teal: #0f5f63; --teal-soft: #d8ebea; --orange: #ef6a1f;
  --red: #b3261e; --red-soft: #f8e1df; --amber: #b8741a; --amber-soft: #f7ead3;
  --blue: #2a4d9b; --blue-soft: #dfe6f5; --green: #1d6b45; --green-soft: #dcefe4; --grey: #a9aca8;
  --warn-bg: #fbf3e2; --warn-fg: #7a4f0b;
  --shadow: 0 1px 2px rgba(20,30,30,.05);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111615; --surface: #19201f; --surface-2: #212a29; --border: #2c3736; --border-2: #3a4746;
    --text: #eef2f1; --text-2: #bcc7c6; --muted: #8a9796;
    --side: #0b2a2c; --side-2: #164244;
    --teal: #4fb3b0; --teal-soft: #173d3e; --red: #ea7a70; --red-soft: #3d1f1d; --amber: #e2a654; --amber-soft: #3a2d17;
    --blue: #8aa8ea; --blue-soft: #1e2a45; --green: #62c08e; --green-soft: #173427; --grey: #56605f;
    --warn-bg: #2f2716; --warn-fg: #f0cd8a; --shadow: none;
  }
}
:root[data-theme="dark"] {
  --bg: #111615; --surface: #19201f; --surface-2: #212a29; --border: #2c3736; --border-2: #3a4746;
  --text: #eef2f1; --text-2: #bcc7c6; --muted: #8a9796;
  --side: #0b2a2c; --side-2: #164244;
  --teal: #4fb3b0; --teal-soft: #173d3e; --red: #ea7a70; --red-soft: #3d1f1d; --amber: #e2a654; --amber-soft: #3a2d17;
  --blue: #8aa8ea; --blue-soft: #1e2a45; --green: #62c08e; --green-soft: #173427; --grey: #56605f;
  --warn-bg: #2f2716; --warn-fg: #f0cd8a; --shadow: none;
}

/* ---------- app-navigation i sidebaren (bruges også på månedens dashboard) ---------- */
.appnav { display: flex; flex-direction: column; gap: 2px; padding: 0 10px; }
.side .appnav a { display: flex; gap: 11px; align-items: center; padding: 9px 12px; border-radius: 8px; color: var(--side-text); text-decoration: none; font-weight: 500; font-size: 14.5px; }
.side .appnav a:hover { background: rgba(255,255,255,.06); }
.side .appnav a.active { background: var(--side-2); color: #fff; box-shadow: inset 3px 0 0 #6fc0bb; }
.appnav svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .85; flex: none; }
.side .appnav .mlink { justify-content: space-between; font-size: 13.5px; padding: 6px 12px 6px 40px; }
.appnav .mlink .mdot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.mdot.ok { background: #62c08e; } .mdot.miss { background: #ef6a1f; } .mdot.run { background: var(--side-muted); }
.side .sect { color: var(--side-muted); font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; padding: 18px 22px 6px; }
.dswitch { margin: 0 20px 6px; }
.dswitch select { width: 100%; font: inherit; font-size: 13px; padding: 6px 8px; border-radius: 7px; border: 1px solid rgba(255,255,255,.15); background: var(--side-2); color: #fff; }

/* ---------- generel skal (kun på appens egne sider) ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body.shell { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 Inter, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif; }
.shell a { color: var(--teal); }
.shell .app { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.shell .side { background: var(--side); color: var(--side-text); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow-y: auto; }
.shell .brand { display: flex; gap: 12px; align-items: center; padding: 20px 18px 18px; }
.shell .logo { width: 38px; height: 38px; border-radius: 9px; background: var(--orange); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.shell .brand b { display: block; color: #fff; font-size: 16px; font-weight: 700; line-height: 1.15; }
.shell .brand small { color: var(--side-muted); font-size: 12px; }
.shell .hatch { height: 6px; margin: 0 0 14px; background: repeating-linear-gradient(-45deg, rgba(255,255,255,.85) 0 3px, transparent 3px 8px); opacity: .9; }
.shell .side-foot { margin-top: auto; border-top: 1px solid rgba(255,255,255,.08); padding: 14px 22px 16px; font-size: 12px; color: var(--side-muted); }
.shell .top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; justify-content: space-between; padding: 14px 32px; background: var(--surface); border-bottom: 1px solid var(--border); }
.shell .crumb { font-size: 14.5px; color: var(--text-2); }
.shell .crumb b { color: var(--text); font-weight: 600; }
.shell .top-right { display: flex; align-items: center; gap: 14px; }
.shell .who { text-align: right; line-height: 1.25; }
.shell .who b { display: block; font-weight: 600; font-size: 14px; }
.shell .who small { color: var(--muted); font-size: 12px; }
.shell .avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--side); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.shell main { padding: 32px 58px 56px; max-width: 1400px; }
.shell .page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.shell .page-head h1 { font-size: 29px; margin: 0; font-weight: 700; letter-spacing: -.02em; }
.shell .page-head p { margin: 4px 0 0; color: var(--text-2); font-size: 15.5px; max-width: 760px; }
.eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--teal); }
.shell .card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px 22px; margin: 0 0 18px; box-shadow: var(--shadow); }
.shell .card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.shell .card h3 { font-size: 16px; margin: 0; font-weight: 600; }
.shell .card-head .meta { font-size: 12.5px; color: var(--muted); }
.shell .muted { color: var(--muted); font-size: 13px; }
.shell .btn-primary, .btn-primary.x { font: inherit; font-weight: 600; font-size: 14.5px; background: var(--teal); color: #fff; border: 0; border-radius: 8px; padding: 10px 18px; cursor: pointer; white-space: nowrap; text-decoration: none; display: inline-block; }
.shell .btn-primary:hover { filter: brightness(1.08); }
.shell .btn-secondary { font: inherit; font-weight: 600; font-size: 14.5px; background: var(--surface); color: var(--teal); border: 1px solid var(--teal); border-radius: 8px; padding: 9px 16px; cursor: pointer; white-space: nowrap; text-decoration: none; display: inline-block; }
.shell .btn-secondary:hover { background: var(--teal-soft); }
.shell .btn { font: inherit; font-size: 13px; padding: 6px 12px; border: 1px solid var(--border-2); border-radius: 7px; background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none; display: inline-block; }
.shell .btn:hover { background: var(--surface-2); }
.shell .btn.danger { color: var(--red); border-color: var(--red-soft); }
.shell table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.shell th, .shell td { padding: 9px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.shell th { background: var(--surface-2); font-weight: 600; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); }
.shell .table-wrap { overflow-x: auto; }
.badge { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 10px; background: var(--teal-soft); color: var(--teal); font-size: 11px; font-weight: 600; letter-spacing: .02em; white-space: nowrap; }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.grey { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.flash { border-radius: 10px; padding: 12px 16px; margin: 0 0 18px; font-weight: 500; }
.flash.ok { background: var(--green-soft); color: var(--green); }
.flash.warn { background: var(--warn-bg); color: var(--warn-fg); }
.flash.err { background: var(--red-soft); color: var(--red); }

/* ---------- status ---------- */
.months { display: grid; gap: 14px; }
.mcard { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--grey); border-radius: 12px; padding: 18px 22px; box-shadow: var(--shadow); }
.mcard.ok { border-left-color: var(--green); }
.mcard.miss { border-left-color: var(--orange); }
.mcard.run { border-left-style: dashed; }
.mcard-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.mcard-head h3 { margin: 0; font-size: 18px; font-weight: 700; text-transform: capitalize; }
.mcard-head .per { color: var(--muted); font-size: 13px; margin-left: 8px; font-weight: 400; text-transform: none; }
.state { font-weight: 700; font-size: 13px; padding: 4px 11px; border-radius: 999px; white-space: nowrap; }
.state.ok { background: var(--green-soft); color: var(--green); }
.state.miss { background: var(--amber-soft); color: var(--amber); }
.state.run { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.docs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.doc { border: 1px solid var(--border); border-radius: 10px; padding: 11px 13px; background: var(--surface-2); min-width: 0; }
.doc b { display: flex; align-items: center; gap: 7px; font-size: 14px; }
.doc .ic { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; flex: none; }
.doc.ok .ic { background: var(--green); }
.doc.miss .ic { background: var(--orange); }
.doc.miss { border-style: dashed; background: var(--surface); }
.doc small { display: block; color: var(--text-2); font-size: 12.5px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc.miss small { color: var(--warn-fg); white-space: normal; }
.issues { margin: 12px 0 0; padding: 10px 14px 10px 30px; background: var(--warn-bg); color: var(--warn-fg); border-radius: 8px; font-size: 13px; }
.issues li { margin: 2px 0; }
.mcard-foot { display: flex; gap: 10px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.blocked { border: 1px solid var(--border); border-left: 4px solid var(--orange); background: var(--surface); border-radius: 12px; padding: 22px 24px; margin-bottom: 18px; }
.blocked h2 { margin: 0 0 6px; font-size: 20px; }
.blocked p { margin: 0 0 4px; color: var(--text-2); }
.blocked .missing-list { margin: 12px 0 0; padding-left: 20px; }
.blocked .missing-list li { margin: 5px 0; font-weight: 500; }

/* ---------- upload ---------- */
.drop { display: block; border: 2px dashed var(--border-2); border-radius: 12px; padding: 34px 20px; text-align: center; background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s; }
.drop.over { border-color: var(--teal); background: var(--teal-soft); }
.drop b { display: block; font-size: 16px; margin-bottom: 4px; }
.drop input[type=file] { display: none; }
.picked { margin: 12px 0 0; padding: 0; list-style: none; font-size: 13.5px; }
.picked li { padding: 4px 0; color: var(--text-2); }
.results { list-style: none; margin: 0; padding: 0; }
.results li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.results li:last-child { border-bottom: 0; }
.results .ic { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; }
.results .ok .ic { background: var(--green); } .results .bad .ic { background: var(--red); }
.results small { display: block; color: var(--muted); }
.kinds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.kind { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; font-size: 13px; color: var(--text-2); }
.kind b { display: block; color: var(--text); font-size: 14px; }

/* ---------- formularer ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; max-width: 760px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 5px; }
.field small { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.field input[type=text], .field input[type=email], .field input[type=password], .field input[type=date], .field input[type=number], .field select, .field textarea {
  width: 100%; font: inherit; padding: 9px 11px; border: 1px solid var(--border-2); border-radius: 8px; background: var(--surface); color: var(--text); }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--teal); outline-offset: 0; border-color: var(--teal); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.check input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--teal); }
.form-actions { display: flex; gap: 10px; margin-top: 20px; align-items: center; flex-wrap: wrap; }
.err { background: var(--red-soft); color: var(--red); border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; font-weight: 500; }

/* ---------- medarbejdere ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border-2); text-decoration: none; color: var(--text-2); font-size: 13px; font-weight: 500; }
.tabs a.on { background: var(--teal); border-color: var(--teal); color: #fff; }
.bulk { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 12px; font-size: 13px; }
.bulk select, .bulk input { font: inherit; font-size: 13px; padding: 6px 8px; border: 1px solid var(--border-2); border-radius: 7px; background: var(--surface); color: var(--text); }
.bulk .count { font-weight: 600; color: var(--text); margin-right: 6px; }
.emp-table td.sel, .emp-table th.sel { width: 36px; }
.emp-table input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--teal); }
.emp-table tr.inactive td { color: var(--muted); }
.emp-table .ini { font-weight: 700; letter-spacing: .02em; }
.emp-search { flex: 1 1 220px; max-width: 320px; font: inherit; padding: 8px 11px; border: 1px solid var(--border-2); border-radius: 8px; background: var(--surface); color: var(--text); }
.missing-box { border-left: 3px solid var(--orange); }
.missing-box ul { margin: 0; padding-left: 18px; }
.missing-box li { margin: 6px 0; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--side); }
.login { width: 100%; max-width: 400px; background: var(--surface); border-radius: 14px; padding: 30px 30px 26px; box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.login .brand2 { display: flex; gap: 12px; align-items: center; margin-bottom: 22px; }
.login .brand2 .logo2 { width: 42px; height: 42px; border-radius: 10px; background: var(--orange); color: #fff; display: grid; place-items: center; font-weight: 700; }
.login h1 { font-size: 21px; margin: 0; }
.login .field { margin-bottom: 14px; }
.login .btn-primary { width: 100%; padding: 12px; }

/* matrix (admin) */
.matrix td, .matrix th { text-align: center; white-space: nowrap; }
.matrix td:first-child, .matrix th:first-child { text-align: left; }
.cell-ok { color: var(--green); font-weight: 700; text-decoration: none; }
.cell-miss { color: var(--amber); font-weight: 700; text-decoration: none; }

@media (max-width: 1100px) { .shell main { padding: 26px 28px 48px; } .docs, .kinds { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .shell .app { grid-template-columns: minmax(0, 1fr); }
  .shell .side { position: static; height: auto; }
  .appnav { flex-direction: row; flex-wrap: wrap; padding-bottom: 12px; }
  .side .appnav .mlink { padding-left: 12px; }
  .shell .side .sect, .shell .side-foot { display: none; }
  .shell .top { padding: 12px 16px; flex-wrap: wrap; }
  .shell .who, .shell .avatar { display: none; }
  .shell main { padding: 20px 16px 40px; }
  .form-grid { grid-template-columns: 1fr; }
}
@media print { .shell .side, .shell .top { display: none; } .shell .app { display: block; } }
.shell .btn-primary:disabled, .shell .btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.doc-up { margin-top: 10px; }
.doc-up label { cursor: pointer; font-size: 12.5px; padding: 5px 10px; }
.shell .btn-primary.sm { font-size: 12.5px; padding: 6px 11px; border-radius: 7px; }
.pwbox { border-left: 4px solid var(--green); }
.pwgrid { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 12px 0 4px; font-size: 15px; }
.pwgrid span { color: var(--text-2); }
.pwgrid .pw { font-family: ui-monospace, Menlo, monospace; font-size: 18px; letter-spacing: .04em; }
