/* JobStatus. Bygger på Ventos tokens.css (kopieret fra vento-designguide), så den ligner Vento. */

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--vt-stone-50); -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button { font-family: inherit; }
svg.i { width: 16px; height: 16px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }
svg.i.lg { width: 20px; height: 20px; }

.shell { display: flex; min-height: 100vh; min-height: 100dvh; }
.vt-sidebar { position: sticky; top: 0; height: 100vh; height: 100dvh; }
.logo { font-weight: 700; letter-spacing: var(--vt-tracking-tight); font-size: 16px; display: flex; gap: 8px;
  align-items: center; }
.logo-mark { width: 24px; height: 24px; border-radius: 6px; background: var(--vt-pink-700); color: #fff;
  display: grid; place-items: center; }
.nav { padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.nav .badge { margin-left: auto; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.vt-topbar { position: sticky; top: 0; z-index: 5; gap: 12px; }
.vt-topbar .spacer { flex: 1; }
.page { padding: 16px; max-width: 980px; width: 100%; margin: 0 auto; min-width: 0; }
.dup .row-main { min-width: 0; }
.dup .row-title { white-space: normal; }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--vt-pink-700);
  color: #fff; font-size: 12px; font-weight: 600; display: inline-grid; place-items: center; }

.tabbar { display: none; }

@media (max-width: 767px) {
  .vt-sidebar { display: none; }
  .tabbar { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; background: #fff;
    border-top: 1px solid var(--vt-stone-200); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 6px;
    font-size: 11px; color: var(--vt-stone-500); text-decoration: none; position: relative; }
  .tabbar a.is-active { color: var(--vt-pink-700); font-weight: 500; }
  .tabbar .badge { position: absolute; top: 2px; left: 50%; margin-left: 6px; transform: scale(.85); }
  .page { padding: 12px 12px 88px; }
  .hide-sm { display: none !important; }
}
@media (min-width: 768px) { .hide-lg { display: none !important; } }

/* Kort og lister */
.card { background: #fff; border: 1px solid var(--vt-stone-200); border-radius: 8px; }
.card + .card { margin-top: 12px; }
.card-pad { padding: 16px; }
.section-h { display: flex; align-items: baseline; gap: 8px; margin: 20px 0 8px; }
.section-h h2 { margin: 0; font-size: var(--vt-text-xs); font-weight: 600; text-transform: uppercase;
  letter-spacing: var(--vt-tracking-wider); color: var(--vt-stone-500); }
.section-h .count { font-size: 12px; color: var(--vt-stone-400); }

.list { background: #fff; border: 1px solid var(--vt-stone-200); border-radius: 8px; overflow: hidden; }
.row { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-top: 1px solid var(--vt-stone-100);
  text-decoration: none; color: inherit; cursor: pointer; }
.row:first-child { border-top: 0; }
.row:hover { background: var(--vt-stone-50); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 500; color: var(--vt-stone-900); overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
.row-meta { font-size: 12px; color: var(--vt-stone-500); display: flex; gap: 6px; flex-wrap: wrap;
  align-items: center; margin-top: 2px; }
.row-meta > :has(+ .sep)::after { content: "·"; color: var(--vt-stone-400); margin-left: 6px; }
.row-meta > * { white-space: nowrap; }

a.vt-btn { text-decoration: none; }
.row-side { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.empty { padding: 24px 16px; text-align: center; color: var(--vt-stone-500); }

/* Ventetid: farven bærer alderen. */
.wait { width: 52px; flex-shrink: 0; text-align: center; border-radius: 6px; padding: 4px 0; font-weight: 600;
  font-size: 13px; background: var(--vt-stone-100); color: var(--vt-stone-700); font-variant-numeric: tabular-nums; }
.wait small { display: block; font-size: 10px; font-weight: 500; opacity: .75; text-transform: uppercase;
  letter-spacing: .04em; }
.wait.w1 { background: var(--vt-pill-amber-bg); color: var(--vt-pill-amber-fg); }
.wait.w2 { background: #ffe4e6; color: #be123c; }

.vt-pill { white-space: nowrap; }
.pill-stone { background: var(--vt-stone-100); color: var(--vt-stone-600); }
.pill-rose { background: #ffe4e6; color: #be123c; }
.pill-pink { background: var(--vt-pink-100); color: var(--vt-pink-700); }
.src { display: inline-flex; align-items: center; gap: 3px; color: var(--vt-stone-500); }

/* Nu */
.now { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 8px;
  background: var(--vt-pink-700); color: #fff; }
.now .row-meta { color: rgb(255 255 255 / .8); }
.now .row-title { color: #fff; }
.now-idle { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-radius: 8px;
  border: 1px dashed var(--vt-stone-300); color: var(--vt-stone-500); }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: #fff; flex-shrink: 0;
  animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.btn-on-pink { background: #fff; color: var(--vt-pink-700); }
.btn-on-pink:hover { background: var(--vt-pink-100); }

/* Filtre */
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 16px; }
.chip { height: 32px; padding: 0 12px; border-radius: 16px; border: 1px solid var(--vt-stone-200); background: #fff;
  color: var(--vt-stone-700); font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chip.is-active { background: var(--vt-stone-900); border-color: var(--vt-stone-900); color: #fff; }

/* Segmenter (status, sted, kilde) */
.seg { display: inline-flex; border: 1px solid var(--vt-stone-200); border-radius: var(--vt-radius); overflow: hidden;
  background: #fff; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; height: 34px; padding: 0 12px; font-size: 13px; cursor: pointer;
  color: var(--vt-stone-700); border-left: 1px solid var(--vt-stone-200); display: inline-flex; gap: 6px;
  align-items: center; }
.seg button:first-child { border-left: 0; }
.seg button.is-active { background: var(--vt-pink-700-10); color: var(--vt-pink-700); font-weight: 600; }
.seg.full { display: flex; }
.seg.full button { flex: 1; justify-content: center; height: 40px; }

/* Formularer */
.form { display: grid; gap: 14px; }
.grid2 { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
@media (max-width: 600px) { .grid2 { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.vt-input, .vt-select { width: 100%; }
.vt-input { font-size: 16px; } /* 16 px, så iOS ikke zoomer ind */
@media (min-width: 768px) { .vt-input { font-size: var(--vt-text-sm); } }
textarea.vt-input { height: auto; min-height: 88px; padding-top: 8px; padding-bottom: 8px; resize: vertical;
  font-family: inherit; line-height: 1.45; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions .grow { flex: 1; }
.hint { font-size: 12px; color: var(--vt-stone-500); }

/* Opgavesiden */
.detail-head { display: flex; gap: 12px; align-items: flex-start; }
.detail-title { font-size: 20px; line-height: 28px; font-weight: 600; letter-spacing: var(--vt-tracking-tight);
  margin: 0; flex: 1; word-break: break-word; }
.title-input { font-size: 20px !important; font-weight: 600; height: 40px; }
.cols { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) 320px; margin-top: 16px; align-items: start; }
@media (max-width: 900px) { .cols { grid-template-columns: minmax(0, 1fr); } }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--vt-stone-500); }
.kv dd { margin: 0; color: var(--vt-stone-900); word-break: break-word; }
.links a { display: flex; align-items: center; gap: 8px; padding: 8px 0; text-decoration: none;
  color: var(--vt-pink-700); font-weight: 500; border-top: 1px solid var(--vt-stone-100); }
.links a:first-child { border-top: 0; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 8px 0; position: relative; }
.timeline li::before { content: ""; position: absolute; left: 13px; top: 34px; bottom: -6px; width: 2px;
  background: var(--vt-stone-100); }
.timeline li:last-child::before { display: none; }
.dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--vt-stone-100);
  color: var(--vt-stone-600); }
.dot svg.i { width: 14px; height: 14px; }
.dot.k-modtaget { background: var(--vt-pink-100); color: var(--vt-pink-700); }
.dot.k-start, .dot.k-stop { background: var(--vt-pill-emerald-bg); color: var(--vt-pill-emerald-fg); }
.dot.k-dalux { background: var(--vt-pill-sky-bg); color: var(--vt-pill-sky-fg); }
.dot.k-status { background: var(--vt-pill-blue-bg); color: var(--vt-pill-blue-fg); }
.ev-text { color: var(--vt-stone-800); white-space: pre-wrap; word-break: break-word; }
.ev-meta { font-size: 12px; color: var(--vt-stone-400); }

.dup { border: 1px solid var(--vt-pill-amber-bg); background: #fffbeb; border-radius: 8px; padding: 12px; }
.dup h3 { margin: 0 0 6px; font-size: 13px; color: var(--vt-pill-amber-fg); display: flex; gap: 6px; align-items: center; }
.dup .row { border-top-color: #fde68a; padding: 8px 0; background: transparent; }

.mailbody { white-space: pre-wrap; word-break: break-word; font-size: 13px; color: var(--vt-stone-700);
  max-height: 420px; overflow: auto; background: var(--vt-stone-50); border-radius: 6px; padding: 12px; }

/* Login */
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.login .card { width: 100%; max-width: 360px; }

.fab { position: fixed; right: 16px; bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 11; width: 56px;
  height: 56px; border-radius: 28px; border: 0; background: var(--vt-pink-700); color: #fff;
  box-shadow: var(--vt-shadow-lg); display: grid; place-items: center; }
.fab svg.i { width: 24px; height: 24px; }

.vt-toasts { position: fixed; bottom: calc(80px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  z-index: 50; }
@media (min-width: 768px) { .vt-toasts { bottom: 24px; } }
.vt-toast.err { background: var(--vt-rose-600); }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Opgaver med actions (forsiden) ---------- */
svg.i.xl { width: 28px; height: 28px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar .seg { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; }
.seg .n { font-size: 11px; opacity: .65; font-weight: 500; }
.search { flex: 1; min-width: 140px; display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px;
  background: #fff; border: 1px solid var(--vt-stone-200); border-radius: var(--vt-radius); color: var(--vt-stone-400); }
.search input { border: 0; outline: 0; flex: 1; min-width: 0; font: inherit; font-size: 16px; color: var(--vt-stone-900); background: transparent; }
@media (min-width: 768px) { .search input { font-size: 14px; } }

.tasks { display: flex; flex-direction: column; gap: 10px; }
.task { background: #fff; border: 1px solid var(--vt-stone-200); border-radius: 8px; padding: 12px 12px 6px; }
.task.is-critical { border-color: #fda4af; box-shadow: inset 3px 0 0 var(--vt-rose-600); }
.task-head { display: flex; gap: 12px; align-items: flex-start; }
.task-head .row-main { text-decoration: none; color: inherit; }
.task-title { font-weight: 600; color: var(--vt-stone-900); line-height: 1.35; word-break: break-word; }
.task-title .vt-pill { vertical-align: 1px; gap: 3px; }
.task-title .vt-pill svg.i { width: 12px; height: 12px; }
.progress { font-size: 12px; color: var(--vt-stone-500); font-variant-numeric: tabular-nums; padding-top: 2px; }
.hold-reason { font-size: 13px; color: var(--vt-pill-amber-fg); display: flex; gap: 5px; align-items: center; margin-top: 4px; }
.hold-reason svg.i { width: 13px; height: 13px; }

.acts { list-style: none; margin: 8px 0 0; padding: 0 0 0 64px; }
.acts.full { padding-left: 0; margin-top: 0; }
@media (max-width: 767px) { .task .acts { padding-left: 0; } }
.act { display: flex; align-items: center; gap: 10px; min-height: 40px; border-top: 1px solid var(--vt-stone-100); }
.act:first-child { border-top: 0; }
.act-text { flex: 1; min-width: 0; color: var(--vt-stone-800); word-break: break-word; padding: 6px 0; }
[data-edit] { cursor: text; }
.check { width: 40px; height: 40px; flex-shrink: 0; margin: 0 -8px; border: 0; background: none; padding: 0; cursor: pointer;
  display: grid; place-items: center; -webkit-tap-highlight-color: transparent; }
.check .ring { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--vt-stone-300); background: #fff; color: transparent;
  display: grid; place-items: center; transition: all var(--vt-duration); }
.check svg.i { width: 14px; height: 14px; stroke-width: 3; }
.check:hover .ring { border-color: var(--vt-pink-700); color: var(--vt-pink-300); }
.act.is-done .check .ring { background: var(--vt-pink-700); border-color: var(--vt-pink-700); color: #fff; }
.act.is-done .act-text { color: var(--vt-stone-400); text-decoration: line-through; }
.act.just.is-done { animation: fadeout .45s ease-in forwards; }
@keyframes fadeout { 60% { opacity: 1; } to { opacity: .2; } }
.act-tool { opacity: .35; }
.act:hover .act-tool { opacity: 1; }
@media (hover: none) { .act-tool { opacity: .6; } }
.edit-act { flex: 1; padding: 4px 0; }

.task-foot { display: flex; align-items: center; gap: 8px; padding-left: 64px; }
@media (max-width: 767px) { .task-foot { padding-left: 0; } }
.link-btn { border: 0; background: none; color: var(--vt-pink-700); font: 500 13px var(--vt-font); padding: 6px 0; cursor: pointer; white-space: nowrap; }
.add-act { flex: 1; display: flex; align-items: center; gap: 10px; min-height: 40px; }
.add-act .add-icon { width: 24px; height: 24px; display: grid; place-items: center; color: var(--vt-stone-400); flex-shrink: 0; }
.add-act input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 16px; color: var(--vt-stone-900); padding: 6px 0; }
.add-act input::placeholder { color: var(--vt-stone-400); }
@media (min-width: 768px) { .add-act input { font-size: 14px; } }
.card .add-act { border-top: 1px solid var(--vt-stone-100); }
.done-acts { margin-top: 8px; }
.done-acts summary { cursor: pointer; padding: 6px 0; }

/* Opgavesiden */
.hold-box { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; padding: 10px 12px; border-radius: 8px;
  background: var(--vt-pill-amber-bg); color: var(--vt-pill-amber-fg); }
.hold-box .hint { color: var(--vt-pill-amber-fg); opacity: .8; }
.vt-btn.is-on { color: var(--vt-rose-600); }
details.card > summary { list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::before { content: "▸ "; }
details.card[open] > summary::before { content: "▾ "; }
.check-row { display: inline-flex; gap: 8px; align-items: center; font-size: 14px; color: var(--vt-stone-700); cursor: pointer; }
.check-row input { width: 18px; height: 18px; accent-color: var(--vt-rose-600); }
.check-row svg.i { color: var(--vt-rose-600); }

/* Afslut */
.photo-q { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 8px; background: var(--vt-pink-100);
  color: var(--vt-pink-800); }
.photo-q b { font-size: 15px; }
.photo-q .hint { color: var(--vt-pink-800); opacity: .8; }
.warn { display: flex; gap: 6px; align-items: center; color: var(--vt-pill-amber-fg); font-size: 13px; margin: 10px 0 0; }
.vt-btn.big { height: 44px; width: 100%; }
.vt-overlay { align-items: flex-end; }
@media (min-width: 600px) { .vt-overlay { align-items: center; } }
.vt-modal { max-height: calc(100dvh - 32px); overflow: auto; }
.toast-btn { border: 0; background: none; color: var(--vt-pink-300); font: 600 14px var(--vt-font); cursor: pointer; padding: 0; }
.acts.full .act:first-child [data-up] { visibility: hidden; }

/* ---------- Ruten ---------- */
.today-btn { flex-shrink: 0; display: inline-flex; flex-direction: column; align-items: center; gap: 1px; border: 1px solid var(--vt-stone-200);
  background: #fff; color: var(--vt-stone-400); border-radius: 6px; padding: 4px 6px; font: 500 10px var(--vt-font); cursor: pointer; }
.today-btn svg.i { width: 18px; height: 18px; }
.today-btn:hover { color: var(--vt-amber-700); border-color: var(--vt-amber-500); }
.today-btn.is-on { background: var(--vt-pill-amber-bg); border-color: var(--vt-amber-500); color: var(--vt-amber-700); }
.vt-btn.is-today { color: var(--vt-amber-700); background: var(--vt-pill-amber-bg); }
.row-meta .addr { display: inline-flex; align-items: center; gap: 2px; }
.row-meta .addr svg.i { width: 12px; height: 12px; }
.addr-line { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 4px 8px 4px 4px; border: 0; background: none;
  color: var(--vt-pink-700); font: 500 14px var(--vt-font); cursor: pointer; border-radius: 6px; text-align: left; }
.addr-line:hover { background: var(--vt-pink-700-10); }
.town { display: flex; align-items: center; gap: 6px; margin: 10px 0 -2px; font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: var(--vt-tracking-wider); color: var(--vt-stone-500); }
.town:first-child { margin-top: 0; }
.stop-n { width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%; background: var(--vt-stone-900); color: #fff; display: grid;
  place-items: center; font-weight: 700; }
.stop-n.crit { background: var(--vt-rose-600); }
.stop .acts, .stop .task-foot { padding-left: 44px; }
@media (max-width: 767px) { .stop .acts, .stop .task-foot { padding-left: 0; } }
.stop-tools { display: flex; flex-direction: column; }
.stop-tools .vt-icon-btn:disabled { opacity: .25; pointer-events: none; }
.task-foot .grow { flex: 1; }
.link-btn { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; }
.link-btn.muted { color: var(--vt-stone-500); font-weight: 400; }
.maps-bar { display: grid; gap: 8px; margin: 0 0 12px; }
.hit { width: 100%; border: 0; background: #fff; text-align: left; font: inherit; color: var(--vt-pink-700); }
.hit .row-title { color: var(--vt-stone-900); font-weight: 400; }

/* ---------- Mobil (gennemgang 2026-11-30) ---------- */
.link-btn { min-height: 40px; }
.addr-line { min-height: 40px; }
details > summary { min-height: 40px; display: flex; align-items: center; }
details.card > summary { margin: -8px 0; }
.check-row { min-height: 40px; }
.add-act { min-width: 0; }
.task-foot { min-width: 0; }
.seg button { white-space: nowrap; }
.vt-select { font-size: 16px; }
@media (min-width: 768px) { .vt-select { font-size: var(--vt-text-sm); } }
@media (max-width: 767px) {
  .page.has-fab { padding-bottom: 160px; }
  .page { padding-bottom: 120px; }
  .tabbar a { min-width: 0; }
  .tabbar a span:not(.badge) { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 359px) {
  .page { padding-left: 8px; padding-right: 8px; }
  .seg button { padding: 0 9px; }
  .task { padding: 10px 10px 4px; }
  .task-head { gap: 8px; }
  .wait { width: 44px; }
  .tabbar a { font-size: 10px; }
}
/* Lange tekster (adresser, afsendere) må brydes; korte mærker holdes samlet. */
.row-meta > * { white-space: normal; overflow-wrap: anywhere; min-width: 0; }
.row-meta > .src, .row-meta > .addr, .row-meta > .vt-pill { white-space: nowrap; }
/* Lukkede foldefelter: overskriften er hele kortet, og der er ingen tom luft under den. */
details.card { padding-top: 4px; padding-bottom: 4px; }
details.card > summary { margin: 0; min-height: 44px; }
details.card[open] { padding-bottom: 16px; }
@media (max-width: 359px) {
  .tabbar a span:not(.badge) { display: none; }
  .tabbar a { padding: 12px 0 10px; }
  .tabbar .badge { top: 4px; }
}
.tasks + .maps-bar { margin: 16px 0 0; }
button, a, summary, label, input, select, textarea { touch-action: manipulation; }
/* Hjemmeskærm-appen på iPhone: topbjælken under statuslinjen, ikke bag den. */
.vt-topbar { padding-top: env(safe-area-inset-top); height: calc(var(--vt-h-14) + env(safe-area-inset-top)); }
