:root {
  --ink: #1d2420;
  --muted: #566058;      /* mørkere grå: kan læses på både hvid og sandfarvet baggrund (WCAG AA) */
  --line: #e6e2d9;
  --paper: #ffffff;
  --ground: #f4f2ed;
  --side: #1b2520;
  --side-ink: #c9d0ca;
  --side-muted: #8a958d;
  --side-active: #2a372f;
  --accent: #c04f1e;
  --accent-dark: #a64318;
  --accent-soft: #fbe9df;
  --accent-ink: #ffffff;
  --ok: #1f7a4a;
  --ok-soft: #e1f3e8;
  --bad: #b3261e;
  --bad-soft: #fbe6e3;
  --warn: #8a5a00;
  --warn-soft: #fbf0d3;
  --radius: 18px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-dark); }
svg.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Ramme: menu i siden ---------- */

body.has-sidebar { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 14px 14px;
  background: var(--side);
  color: var(--side-ink);
  overflow-y: auto;
}
.sidebar a { color: inherit; text-decoration: none; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--accent); color: #fff; }
.brand strong { display: block; color: #fff; font-size: 17px; line-height: 1.2; }
.brand small { display: block; color: var(--side-muted); font-size: 13px; }

.sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 11px; font-size: 15.5px; }
.sidebar nav a:hover { background: var(--side-active); color: #fff; }
.sidebar nav a.active { background: var(--side-active); color: #fff; }
.sidebar nav a.active svg { color: #f08a5d; }
.nav-label { margin: 18px 12px 6px; font-size: 11.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--side-muted); }

.me { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 13px; background: var(--side-active); }
.me-name { flex: 1; min-width: 0; }
.me-name strong { display: block; color: #fff; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-name small { display: block; color: var(--side-muted); font-size: 12.5px; }
.me form { margin: 0; }
.icon-button { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 9px; background: none; color: var(--side-ink); cursor: pointer; }
.icon-button:hover { background: rgba(255, 255, 255, .08); color: #fff; }

.avatar { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; background: #3d5a80; color: #fff; font-size: 12.5px; font-weight: 700; letter-spacing: .02em; }
.avatar.c1 { background: #a8502a; }
.avatar.c2 { background: #3f6f73; }
.avatar.c3 { background: #4a5a8c; }
.avatar.c4 { background: #7a5c8e; }
.avatar.c0 { background: #5b7a3a; }

main { width: 100%; max-width: 1180px; margin: 0 auto; padding: 34px 40px 70px; }
body.plain main { max-width: 480px; padding-top: 60px; }
main.narrow { max-width: 560px; }
.plain-brand { display: flex; align-items: center; gap: 10px; margin: 0 0 22px; font-weight: 700; font-size: 18px; }

/* ---------- Tekst og overskrifter ---------- */

h1 { font-size: 30px; line-height: 1.15; letter-spacing: -.02em; margin: 0 0 20px; }
h2 { font-size: 18px; letter-spacing: -.01em; margin: 30px 0 12px; }
.heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.heading h1, .heading h2 { margin: 0; }
.heading + table, .heading + .card { margin-top: 0; }
h2 + table { margin-top: 0; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 4px; color: var(--muted); font-size: 14.5px; font-weight: 500; }

/* ---------- Kort, tabeller, knapper ---------- */

.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }

table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
th, td { padding: 11px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12.5px; color: var(--muted); font-weight: 600; background: #faf9f6; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fcfbf8; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tfoot td { border-bottom: 0; padding-top: 7px; padding-bottom: 7px; }
tfoot tr:first-child td { border-top: 1px solid var(--line); }
tfoot tr.total td { font-weight: 700; }
td form { margin: 0; }
td a { font-weight: 500; text-decoration: none; }
td a:hover { text-decoration: underline; }

button, .button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-weight: 600;
  padding: 10px 18px;
  border: 1px solid var(--accent);
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(60, 30, 10, .12);
}
button:hover, .button:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
button.secondary, .button.secondary { background: var(--paper); color: var(--ink); border-color: var(--line); }
button.secondary:hover, .button.secondary:hover { background: #faf9f6; border-color: #d5d0c4; }
button.link { border: 0; background: none; box-shadow: none; color: var(--accent-dark); padding: 0; font-weight: 500; text-decoration: underline; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 18px 0; }
.actions form { margin: 0; }

/* ---------- Formularer ---------- */

.form > div, .line-form > div { margin-bottom: 15px; }
.form label, .line-form label { display: block; font-weight: 600; font-size: 14.5px; margin-bottom: 5px; }
input, select, textarea { font: inherit; width: 100%; padding: 9px 12px; border: 1px solid #8a8475; border-radius: 10px; background: #fff; color: var(--ink); }
input[type="checkbox"] { width: auto; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.helptext { display: block; font-size: 13px; color: var(--muted); margin-top: 4px; }
.errorlist { list-style: none; margin: 0 0 5px; padding: 0; color: var(--bad); font-size: 14px; }

.line-form { display: grid; grid-template-columns: 3fr 1fr 1fr 1fr; gap: 0 14px; margin-top: 14px; }
.line-form .actions { grid-column: 1 / -1; margin: 0; }
.payment-form { grid-template-columns: 1fr 1fr 2fr; }

.search { margin: 0 0 14px; }
.search input { padding: 11px 14px; border-radius: 12px; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.filters a { padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--ink); text-decoration: none; font-size: 14.5px; font-weight: 500; }
.filters a.current { background: var(--side); border-color: var(--side); color: #fff; }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 24px; margin: 0 0 20px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

.badge { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: 13px; font-weight: 600; background: #eceae4; color: var(--ink); white-space: nowrap; }
.badge.issued, .badge.paid { background: var(--ok-soft); color: var(--ok); }
.badge.overdue { background: var(--bad-soft); color: var(--bad); }
.badge.open { background: var(--warn-soft); color: var(--warn); }
.badge.credited { background: #eceae4; color: var(--muted); }

.messages { list-style: none; margin: 0 0 18px; padding: 0; }
.messages li { padding: 11px 16px; border-radius: 12px; margin-bottom: 6px; background: #e9eff6; border: 1px solid #cddbec; }
.messages li.success { background: var(--ok-soft); border-color: #bfe0cc; }
.messages li.error { background: var(--bad-soft); border-color: #f2c4bf; color: var(--bad); }

.badge.q-sendt { background: var(--warn-soft); color: var(--warn); }
.badge.q-accepteret { background: var(--ok-soft); color: var(--ok); }
.badge.q-afvist { background: var(--bad-soft); color: var(--bad); }
.quote-form { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 0 14px; margin-bottom: 8px; }
.quote-form > div:nth-of-type(2) { grid-column: 1 / -1; grid-row: 2; }
.quote-form .actions { grid-column: 1 / -1; margin: 0; }
.quote-line-form { grid-template-columns: 1.2fr 3fr 1fr 1fr 1.2fr; }
.discount-form { grid-template-columns: 1fr 2fr; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form input[type="text"] { width: 240px; }

.checkin { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; border-color: #bfe0cc; background: var(--ok-soft); }
.team-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; }
.team-form label { display: inline-flex; align-items: center; gap: 7px; font-weight: 500; }
.team-form .actions { flex-basis: 100%; margin: 6px 0 0; }
.usage-form { grid-template-columns: 3fr 1fr 1fr 1.4fr; }
.photo-form { grid-template-columns: 1fr 1fr; }
.material-form { grid-template-columns: 3fr 1.5fr 1fr 1fr; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 14px; }
.photos figure { margin: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.photos img { display: block; width: 100%; height: 150px; object-fit: cover; background: #eceae4; }
.photos figcaption { padding: 9px 12px; font-size: 14px; }
.photos figcaption span { display: block; font-size: 12.5px; }
.photos figcaption form { margin: 4px 0 0; }
.note { margin-bottom: 10px; }
.note p { margin: 0 0 6px; }
.note form { display: inline; margin-left: 10px; }

/* ---------- Overblik ---------- */

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { display: block; padding: 20px 22px; border-radius: var(--radius); background: var(--paper); border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
a.kpi:hover { border-color: #d5d0c4; }
.kpi-label { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 14.5px; font-weight: 500; }
.kpi-value { display: block; margin: 12px 0 8px; font-size: 29px; line-height: 1.1; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: 16px; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.kpi-note { color: var(--muted); font-size: 14px; }
.kpi.dark { background: radial-gradient(120% 140% at 100% 0%, #5a2f1c 0%, var(--side) 55%); border-color: var(--side); color: #fff; }
.kpi.dark .kpi-label { color: #c9d0ca; }
.kpi.dark .kpi-note { color: #c9d0ca; }
.kpi.dark .kpi-note.alert { color: #ffb38a; font-weight: 600; }

.overview { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.panel + .panel { margin-top: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px 14px; }
.panel-head h2 { margin: 0; font-size: 17px; }
.count { display: grid; place-items: center; min-width: 28px; height: 28px; padding: 0 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-dark); font-size: 13.5px; font-weight: 700; }
.panel-empty { margin: 0; padding: 4px 22px 22px; color: var(--muted); }

.todo { list-style: none; margin: 0; padding: 0; }
.todo li { border-top: 1px solid var(--line); }
.todo a { display: flex; align-items: center; gap: 14px; padding: 13px 22px; color: var(--ink); text-decoration: none; }
.todo a:hover { background: #fcfbf8; }
.todo-icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 12px; background: #f1efe9; color: #5b625c; }
.todo-icon.overdue { background: var(--bad-soft); color: var(--bad); }
.todo-icon.todo-warn { background: var(--warn-soft); color: var(--warn); }
.todo-text { flex: 1; min-width: 0; }
.todo-text strong { display: block; font-weight: 600; }
.todo-text span { display: block; color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.todo .chevron { color: #a3a79f; }

.team { list-style: none; margin: 0; padding: 0 22px 20px; }
.team li + li { margin-top: 16px; }
.team-row { display: flex; align-items: center; gap: 10px; }
.team-row strong { flex: 1; min-width: 0; font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team-row span.hours { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.bar { height: 5px; margin-top: 9px; border-radius: 999px; background: #eceae4; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 999px; background: var(--side); }

.feed { list-style: none; margin: 0; padding: 0 22px 20px; }
.feed li { display: flex; gap: 12px; }
.feed li + li { margin-top: 14px; }
.feed-icon { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; background: #f1efe9; color: #5b625c; }
.feed-icon svg.icon { width: 17px; height: 17px; }
.feed a { color: var(--ink); text-decoration: none; font-weight: 500; }
.feed a:hover { text-decoration: underline; }
.feed small { display: block; color: var(--muted); font-size: 13px; }

/* ---------- Smalle skærme ---------- */

@media (max-width: 1080px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  body.has-sidebar { display: block; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px; }
  .sidebar nav { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; flex: 1 1 100%; order: 3; gap: 4px; }
  .sidebar nav a { white-space: nowrap; padding: 8px 12px; }
  .nav-label { display: none; }
  .brand small { display: none; }
  .me { margin-left: auto; padding: 4px; background: none; }
  .me-name { display: none; }
  main { padding: 22px 16px 60px; }
  h1 { font-size: 25px; }
  table { display: block; overflow-x: auto; }
  .line-form, .payment-form { grid-template-columns: 1fr 1fr; }
  .line-form > div:first-of-type { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .kpis { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Kalender ---------- */

.calendar { table-layout: fixed; }
.calendar th, .calendar td { padding: 9px 8px; }
.calendar th:first-child, .calendar td.who { width: 150px; padding-left: 16px; }
.calendar td.who strong { display: block; font-weight: 600; }
.calendar td.who small.on-site { display: block; color: var(--ok); font-size: 12.5px; }
.calendar th.today { color: var(--accent-dark); }
.calendar td.day { position: relative; border-left: 1px solid var(--line); padding-bottom: 30px; min-height: 70px; }
.calendar td.day.weekend, .calendar th.weekend { background: #faf9f6; }
.calendar td.day.today, .calendar tbody tr:hover td.day.today { background: var(--accent-soft); }
.plan-chip { display: block; margin-bottom: 6px; padding: 6px 8px; border-radius: 9px; border-left: 4px solid var(--side); background: #f1efe9; color: var(--ink); text-decoration: none; font-size: 13px; line-height: 1.3; overflow: hidden; }
.plan-chip:hover { text-decoration: none; filter: brightness(.97); }
.plan-chip b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-chip small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-chip.ca1 { border-left-color: #c04f1e; background: #fbe9df; }
.plan-chip.ca2 { border-left-color: #1f7a4a; background: #e1f3e8; }
.plan-chip.cb1 { border-left-color: #2b5f9e; background: #e4eef9; }
.plan-chip.cb2 { border-left-color: #8a5a00; background: #fbf0d3; }
.calendar small.hours { display: block; color: var(--muted); font-size: 12px; }
.plan-add { position: absolute; right: 6px; bottom: 5px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper); color: var(--muted); font-weight: 600; text-decoration: none; line-height: 1; }
.plan-add:hover { border-color: var(--accent); color: var(--accent-dark); text-decoration: none; }
.plan-list { list-style: none; padding: 4px 0; margin: 0 0 8px; }
.form ul, .form div > div { list-style: none; margin: 0; padding: 0; }
.form fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.form legend { padding: 0; margin-bottom: 6px; font-weight: 600; font-size: 14.5px; }
.form div > div label, .form ul label { display: inline-flex; align-items: center; gap: 7px; font-weight: 500; margin: 0 18px 6px 0; }

/* ---------- Efterkalkulation ---------- */

.calc-row { margin-bottom: 18px; }
.calc-top { display: flex; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; }
.calc-row .bar { height: 7px; margin: 7px 0 6px; }
.bar.good i { background: var(--ok); }
.bar.over i { background: var(--bad); }
.calc-sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.calc-sum .k { color: var(--muted); font-size: 13.5px; }
.calc-sum .v { font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums; }
.neg { color: var(--bad); }
.pos { color: var(--ok); }
.badge.tone-red { background: var(--bad-soft); color: var(--bad); }
.badge.tone-amber { background: var(--warn-soft); color: var(--warn); }
.badge.tone-green { background: var(--ok-soft); color: var(--ok); }
td .bar { min-width: 120px; }

/* ---------- Rykkere ---------- */

.reminder-form textarea { min-height: 260px; }

@media (max-width: 820px) {
  .calendar { table-layout: auto; }
  .calendar td.day { min-width: 130px; }
  .calc-sum { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Trin 5: søgning, konto, platform, kom godt i gang ---------- */

.side-search { margin: 0 0 10px; }
.side-search input { padding: 8px 12px; border-radius: 10px; border-color: #33423a; background: #222e28; color: #e8ece9; font-size: 14.5px; }
.side-search input::placeholder { color: var(--side-muted); }
a.me-name { color: inherit; text-decoration: none; }
a.me-name:hover strong { text-decoration: underline; }
.plain-user { float: right; margin: -44px 0 0; font-size: 14.5px; }
.codebox { display: inline-block; padding: 10px 16px; border: 1px dashed #cfc9bc; border-radius: 10px; background: #faf9f6; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 17px; letter-spacing: .06em; }
.readiness { margin-bottom: 18px; border-color: #ecd9a6; background: var(--warn-soft); }
.readiness ul { margin: 8px 0 0; padding-left: 20px; }
.readiness li { margin-bottom: 4px; }
.badge.s-aktiv { background: var(--ok-soft); color: var(--ok); }
.badge.s-pause { background: var(--warn-soft); color: var(--warn); }
.badge.s-deaktiveret, .badge.s-slettet { background: var(--bad-soft); color: var(--bad); }
.onboarding { margin-bottom: 20px; }
.onboarding .panel-head form { margin: 0; font-size: 14.5px; }
.todo-icon.done { background: var(--ok-soft); color: var(--ok); }
.todo-text strong.struck { text-decoration: line-through; color: var(--muted); }
.narrow-box { max-width: 480px; }
/* Menuen er blevet længere: den ruller selv, så brugerfeltet nederst altid kan ses. */
.sidebar nav { min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #33423a transparent; }
.sidebar nav a { flex: none; padding: 8px 12px; }
.nav-label { margin: 14px 12px 4px; flex: none; }
@media (max-width: 820px) {
  .sidebar nav { overflow-y: visible; }
  .side-search { flex: 1 1 100%; order: 2; margin: 0; }
}

/* ---------- Trin 6: ekstraarbejde, kundens side, min uge, offline ---------- */

.badge.x-godkendt { background: var(--ok-soft); color: var(--ok); }
.badge.x-afvist { background: var(--bad-soft); color: var(--bad); }
.badge.x-afventer { background: var(--warn-soft); color: var(--warn); }
.extra-form { grid-template-columns: 2fr 1fr 2fr 1.5fr; }
.portal-extra { margin-bottom: 12px; }
.portal-extra img { max-width: 100%; max-height: 320px; border-radius: 12px; }
.portal-extra .calc-top span { text-align: right; }
.week-day { display: flex; justify-content: space-between; align-items: baseline; }
.offline-pill { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 50; padding: 10px 18px; border-radius: 999px; background: var(--side); color: #fff; font-size: 14.5px; font-weight: 600; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); }
/* Kundens sider og platformen er bredere end login-siden. */
body.plain.wide main { max-width: 900px; }

/* ---------- Sæt en medarbejder på sager ---------- */
/* Tekst og kanter her er mørkere end ellers, så de kan læses af alle (WCAG 2.1 AA). */

.assign { --assign-muted: #566058; --assign-line: #8a8475; padding-bottom: 0; }
.assign-help { margin: 0 0 14px; color: var(--assign-muted); }
.assign-tools { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 22px; margin-bottom: 10px; }
.assign-search { flex: 1 1 280px; }
.assign-search label { display: block; font-weight: 600; font-size: 14.5px; margin-bottom: 5px; }
.assign-search input { min-height: 44px; border-color: var(--assign-line); }
.assign-only { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; font-weight: 500; cursor: pointer; }
.assign input[type="checkbox"] { width: 22px; height: 22px; flex: none; accent-color: var(--ok); cursor: pointer; }
.assign-count { margin: 0 0 12px; font-weight: 600; }
.assign-group { border: 0; margin: 0 0 16px; padding: 0; min-width: 0; }
.assign-group legend { padding: 0; margin-bottom: 8px; font-weight: 700; font-size: 15px; }
.assign-legend-note { font-weight: 500; color: var(--assign-muted); }
.assign-row { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 8px 14px; margin-bottom: 6px; border: 1px solid var(--assign-line); border-radius: 12px; background: var(--paper); cursor: pointer; }
.assign-row[hidden], .assign-group[hidden] { display: none; }
.assign-row:hover { background: #faf9f6; }
.assign-row:has(input:checked) { border-color: var(--ok); border-width: 2px; padding: 7px 13px; background: var(--ok-soft); }
.assign-row:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.assign-row input:focus { outline: none; }
.assign-main { flex: 1; min-width: 0; }
.assign-main strong { display: block; font-weight: 600; }
.assign-main span { display: block; font-size: 14px; color: var(--assign-muted); }
.assign-hours { flex: none; font-size: 14px; color: var(--assign-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.assign-empty { margin: 0 0 16px; color: var(--assign-muted); }
.assign-save { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin: 0 -20px; padding: 14px 20px; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); background: var(--paper); }
.assign-save button { min-height: 44px; }
.assign-changed { font-weight: 600; color: #8a4b00; }
.assign-changed[hidden] { display: none; }

/* ---------- Menugrupper, der kan foldes ind og ud ---------- */

.nav-group { display: flex; flex-direction: column; gap: 2px; flex: none; margin-top: 8px; }
.nav-items { display: flex; flex-direction: column; gap: 2px; }
.nav-items[hidden] { display: none; }
.nav-toggle, .nav-toggle:hover { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 40px; padding: 8px 12px; border: 0; border-radius: 9px; background: none; box-shadow: none; color: #a9b3ab; font-size: 11.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; cursor: pointer; }
.nav-toggle:hover { background: var(--side-active); color: #fff; }
.nav-toggle:focus-visible { outline: 2px solid #f0a070; outline-offset: 1px; }
.nav-toggle svg.icon { width: 15px; height: 15px; transition: transform .15s; }
.nav-toggle[aria-expanded="true"] svg.icon { transform: rotate(90deg); }
@media (prefers-reduced-motion: reduce) { .nav-toggle svg.icon { transition: none; } }
@media (max-width: 820px) {
  /* På telefonen er menuen én vandret række: her vises alle punkter, og grupperne kan ikke foldes. */
  .nav-group, .nav-items, .nav-items[hidden] { display: contents; }
  .nav-toggle, .nav-toggle:hover { display: none; }
}

/* ---------- Kundeformular: Privat eller Virksomhed ---------- */

.form .kind-choice { border: 0; margin: 0 0 20px; padding: 0; min-width: 0; }
.kind-choice legend { padding: 0; margin-bottom: 8px; font-weight: 700; font-size: 16px; }
.kind-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form .kind-option { display: flex; align-items: center; gap: 12px; min-height: 60px; margin: 0; padding: 10px 14px; border: 1px solid #8a8475; border-radius: 12px; background: var(--paper); font-weight: 400; cursor: pointer; }
.kind-option input { width: 22px; height: 22px; flex: none; accent-color: var(--ok); cursor: pointer; }
.kind-option strong { display: block; font-weight: 600; font-size: 15.5px; }
.kind-option span span { display: block; font-size: 13.5px; color: #566058; }
.kind-option:has(input:checked) { border: 2px solid var(--ok); padding: 9px 13px; background: var(--ok-soft); }
.kind-option:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.kind-option input:focus { outline: none; }
.customer-form [hidden] { display: none; }
@media (max-width: 560px) { .kind-options { grid-template-columns: 1fr; } }

/* ---------- Overblik: velkomst, genveje og dagens hold ---------- */

.hero { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 36px; align-items: center; margin-bottom: 20px; padding: 30px 32px; border: 1px solid #ead9cc; border-radius: 26px 26px 26px 8px; overflow: hidden;
  background:
    radial-gradient(90% 140% at 100% 0%, rgba(192, 79, 30, .16) 0%, rgba(192, 79, 30, 0) 60%),
    repeating-linear-gradient(0deg, rgba(27, 37, 32, .035) 0 1px, transparent 1px 28px),
    repeating-linear-gradient(90deg, rgba(27, 37, 32, .035) 0 1px, transparent 1px 28px),
    linear-gradient(135deg, #fffaf5 0%, #fbeee4 100%); }
.hero-date { margin: 0 0 6px; color: #7a4a2c; font-size: 14.5px; font-weight: 600; letter-spacing: .02em; }
.hero h1 { margin: 0 0 10px; font-family: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif; font-size: 40px; font-weight: 700; line-height: 1.08; letter-spacing: -.015em; }
.hero-lead { margin: 0 0 16px; max-width: 46ch; font-size: 16.5px; color: #3c4640; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 6px 14px; border: 1px solid #d9cfc3; border-radius: 999px; background: rgba(255, 255, 255, .82); color: var(--ink); font-size: 14.5px; font-weight: 600; text-decoration: none; }
.chip svg.icon { width: 16px; height: 16px; }
.chip:hover { background: #fff; border-color: #b9ab9b; }
.chip-alert { border-color: #e7b9b3; color: #8f1d16; }
.chip-wait { border-color: #e6d19a; color: #6f4800; }
.hero-actions { display: grid; grid-template-columns: repeat(2, 148px); gap: 10px; }
.tile { display: flex; flex-direction: column; justify-content: space-between; gap: 14px; min-height: 84px; padding: 13px 14px; border: 1px solid #dccfc2; border-radius: 16px; background: rgba(255, 255, 255, .86); color: var(--ink); font-weight: 600; font-size: 15px; line-height: 1.2; text-decoration: none; transition: transform .12s, box-shadow .12s; }
.tile svg.icon { width: 20px; height: 20px; color: var(--accent-dark); }
.tile:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(60, 30, 10, .12); background: #fff; }
.tile-main { border-color: var(--accent); background: var(--accent); color: #fff; }
.tile-main svg.icon { color: #fff; }
.tile-main:hover { background: var(--accent-dark); }
.hero a:focus-visible { outline: 3px solid var(--side); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .tile { transition: none; } .tile:hover { transform: none; } }

.kpi-value small { white-space: nowrap; }
.kpi.dark .kpi-value small { color: #c9d0ca; }
.meter { display: block; height: 6px; margin: 2px 0 9px; border-radius: 999px; background: #eceae4; overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 999px; background: var(--side); }
.meter-dark { background: rgba(255, 255, 255, .18); }
.meter-dark i { background: #f0a070; }
.spark { display: flex; align-items: flex-end; gap: 6px; height: 54px; margin: 2px 0 8px; }
.spark-col { display: flex; flex: 1; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; height: 100%; }
.spark-col i { display: block; width: 100%; min-height: 2px; border-radius: 4px 4px 1px 1px; background: #d8d3c8; }
.spark-col.current i { background: var(--accent); }
.spark-col small { font-size: 10.5px; line-height: 1; color: var(--muted); text-transform: lowercase; }

.today { margin-bottom: 20px; }
.today-list { list-style: none; margin: 0; padding: 0; }
.today-list li { display: flex; align-items: center; gap: 12px; padding: 12px 22px; border-top: 1px solid var(--line); }
.today-who { flex: 1; min-width: 0; }
.today-who strong { display: block; font-weight: 600; }
.today-who strong a { color: var(--ink); text-decoration: none; }
.today-who strong a:hover { text-decoration: underline; }
.today-who > span { display: block; font-size: 14px; color: #566058; }
.today-who > span a { color: var(--accent-dark); font-weight: 500; text-decoration: none; }
.today-who > span a:hover { text-decoration: underline; }
.today-hours { flex: none; font-size: 14px; color: #566058; font-variant-numeric: tabular-nums; }
.panel-head > a { font-size: 14.5px; font-weight: 500; }

@media (max-width: 1080px) { .hero { grid-template-columns: minmax(0, 1fr); } .hero-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 620px) {
  .hero { padding: 22px 18px; border-radius: 20px 20px 20px 6px; }
  .hero h1 { font-size: 31px; }
  .hero-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .today-list li { flex-wrap: wrap; padding: 12px 16px; }
}

/* ---------- Tilvalg (topadministratoren vælger, hvad virksomheden har købt) ---------- */
.form .feature-pick { border: 0; margin: 22px 0 0; padding: 0; min-width: 0; }
.feature-pick legend { padding: 0; margin-bottom: 6px; font-weight: 700; font-size: 16px; }
.feature-pick > p { margin: 0 0 10px; }
.feature-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.feature-tools button.link { min-height: 32px; }
.form .feature-list { list-style: none; margin: 0 0 6px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 10px; }
.form .feature-list label { display: flex; align-items: flex-start; gap: 12px; min-height: 44px; height: 100%; margin: 0; padding: 12px 14px; border: 1px solid #8a8475; border-radius: 12px; background: #fff; font-weight: 400; cursor: pointer; }
.form .feature-list label:hover { background: #fcfbf8; }
.feature-list input[type="checkbox"] { flex: none; width: 20px; height: 20px; margin: 2px 0 0; }
.feature-list label > span { display: block; min-width: 0; }
.feature-list strong { display: block; font-weight: 600; }
.feature-list label > span > span { display: block; color: #566058; font-size: 14px; }
.form .feature-list label:has(input:checked) { border-color: var(--ok, #2f6b4a); background: var(--ok-soft, #eaf4ee); box-shadow: inset 0 0 0 1px var(--ok, #2f6b4a); }
.feature-list label:focus-within { outline: 2px solid #c2571b; outline-offset: 2px; }
.form .feature-pick.no-legend { margin-top: 0; }
.feature-pick.no-legend legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.feature-off { max-width: 620px; }
.feature-off h1 { margin-top: 0; }

/* ---------- Priser, QR-kode ---------- */
.price-table { margin: 0 0 14px; box-shadow: none; }
.price-table td { vertical-align: middle; }
.price-table label { margin: 0; }
.price-input { max-width: 150px; text-align: right; }
.qr { margin: 6px 0 14px; }
.qr svg { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 10px; }

/* ---------- Rapporter, godkendelse af timer, fravær ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.period-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; margin-bottom: 20px; }
.period-form > div { flex: 0 1 190px; }
.period-form label { display: block; font-weight: 600; font-size: 14.5px; margin-bottom: 5px; }
.report .bar-col { width: 34%; }
.report-bar { display: block; height: 10px; min-width: 2px; border-radius: 6px; background: var(--accent); }
.report-bar.alert { background: var(--bad); }
.approval { padding-bottom: 6px; margin-bottom: 18px; }
.approval .heading { margin-top: 0; }
.approval table { box-shadow: none; margin-bottom: 6px; }
.absence-chip { display: inline-block; padding: 2px 9px; border-radius: 999px; background: #e7e3f2; color: #3f3566; font-size: 12.5px; font-weight: 600; }
.calendar td.away { background: #f6f4fb; }
.absence-own { list-style: none; margin: 0 0 18px; padding: 14px 18px; }
.absence-own li { padding: 3px 0; }
@media (max-width: 820px) { .report .bar-col { display: none; } }

/* ---------- Tjeklister, udlæg, skabeloner ---------- */
.checklist .check-item { border: 1px solid var(--line); margin: 0 0 12px; padding: 14px 18px 16px; min-width: 0; }
.check-item legend { float: left; width: 100%; padding: 0; margin-bottom: 10px; font-weight: 600; }
.check-answers { clear: both; display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.check-answer { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 14px; border: 1px solid #8a8475; border-radius: 10px; background: #fff; cursor: pointer; }
.check-answer input { width: 20px; height: 20px; margin: 0; }
.check-answer:has(input:checked) { box-shadow: inset 0 0 0 1px currentColor; font-weight: 600; }
.check-answer.c-ok:has(input:checked) { background: var(--ok-soft); color: var(--ok); border-color: var(--ok); }
.check-answer.c-fejl:has(input:checked) { background: var(--bad-soft); color: var(--bad); border-color: var(--bad); }
.check-note { display: block; font-size: 14.5px; font-weight: 600; }
.check-note input { margin-top: 5px; }
.badge.c-ok { background: var(--ok-soft); color: var(--ok); }
.badge.c-fejl { background: var(--bad-soft); color: var(--bad); }
.signed { border-color: var(--ok); background: var(--ok-soft); }
.sticky-save { position: sticky; bottom: 0; padding: 12px 0; background: var(--ground); }
.template-save input { max-width: 190px; }
table + .heading, .report + .heading { margin-top: 28px; }
.card.inline-form { margin-top: 12px; flex-wrap: wrap; }
.card.inline-form select { flex: 1 1 220px; }
