/* ===== DocMate web-app ===== */
:root {
    --navy: #001A87;
    --navy-dark: #00125e;
    --navy-light: #3A55B8;
    --ink: #0A1428;
    --muted: #5A6B85;
    --line: #E3E9F2;
    --bg: #FFFFFF;
    --bg-alt: #F4F7FC;
    --bg-soft: #EEF3FB;
    --green: #2E9E5B;
    --orange: #E0622C;
    --red: #D33A3A;
    --radius: 14px;
    --shadow-sm: 0 4px 18px rgba(10, 20, 40, 0.06);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; color: var(--ink); background: var(--bg-alt); -webkit-font-smoothing: antialiased; }
.hidden { display: none !important; }
a { text-decoration: none; color: inherit; }

.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 19px; color: var(--navy); }
.brand-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--navy); color: #fff; font-size: 15px; }
.logo-img { height: 100px; width: auto; display: block; }
.logo-img.logo-lg { height: 100px; margin: 0 auto; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 10px; font-weight: 600; font-size: 14.5px; cursor: pointer; border: 1.5px solid transparent; font-family: inherit; transition: background .15s, transform .15s; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-dark); }
.btn-outline { border-color: var(--navy); color: var(--navy); background: transparent; }
.btn-outline:hover { background: var(--bg-soft); }
.btn-ghost { color: var(--navy); background: transparent; }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .6; cursor: default; transform: none; }

/* ===== Login ===== */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(900px 400px at 50% -10%, #DCE6FB 0%, var(--bg-alt) 60%); }
.login-card { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 38px 34px; box-shadow: 0 20px 60px rgba(0,26,135,.10); }
.login-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 22px; color: var(--navy); justify-content: center; margin-bottom: 24px; }
.login-card h1 { font-size: 24px; text-align: center; }
.login-sub { text-align: center; color: var(--muted); margin: 6px 0 26px; font-size: 15px; }
.login-card label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; margin-bottom: 6px; }
.login-card input { width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px; font-size: 15px; font-family: inherit; margin-bottom: 16px; transition: border-color .15s; }
.login-card input:focus { outline: none; border-color: var(--navy); }
.login-error { color: var(--red); font-size: 14px; text-align: center; margin-top: 12px; min-height: 18px; }
.login-link { display: block; text-align: center; color: var(--navy); font-weight: 600; font-size: 14px; margin-top: 20px; cursor: pointer; }
.login-link:hover { text-decoration: underline; }
.login-back { display: block; text-align: center; color: var(--muted); font-size: 14px; margin-top: 14px; }
.login-back:hover { color: var(--navy); }

/* ===== App shell ===== */
.topbar { min-height: 64px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 16px; padding: 8px 22px; position: sticky; top: 0; z-index: 30; }
.menu-toggle { display: none; background: none; border: none; font-size: 22px; cursor: pointer; color: var(--navy); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.company-logo { max-width: 100%; max-height: 52px; object-fit: contain; margin: 0 auto 10px; display: block; }

/* Global søgning i toppen */
.topsearch { position: relative; flex: 1; max-width: 440px; margin: 0 18px; }
.topsearch input { width: 100%; padding: 9px 14px; border: 1.5px solid var(--line); border-radius: 10px; font-size: 14px; font-family: inherit; }
.topsearch input:focus { outline: none; border-color: var(--navy); }
.search-dd { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 44px rgba(0,0,0,.16); max-height: 64vh; overflow: auto; z-index: 50; }
.search-dd .sd-group { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 11px 14px 4px; }
.search-dd .sd-item { display: flex; align-items: center; gap: 10px; padding: 9px 14px; cursor: pointer; }
.search-dd .sd-item:hover { background: var(--bg-soft); }
.search-dd .sd-empty { padding: 16px 14px; color: var(--muted); font-size: 14px; }
.search-dd .sd-item .row-icon { width: 36px; height: 36px; font-size: 17px; }
.search-dd .sd-text { min-width: 0; flex: 1; }
.search-dd .sd-title { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.search-dd .sd-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 820px) { .topsearch { display: none; } }
.user-chip { display: flex; align-items: center; gap: 10px; }
.user-avatar { width: 38px; height: 38px; border-radius: 10px; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.user-meta { display: flex; flex-direction: column; line-height: 1.25; }
.user-meta > span:first-child { font-weight: 600; font-size: 14px; }
.user-company { font-size: 12px; color: var(--muted); }

.app:not(.hidden) { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.app-body { display: grid; grid-template-columns: 232px 1fr; flex: 1; min-height: 0; }
.sidebar { background: #fff; border-right: 1px solid var(--line); padding: 18px 14px; height: 100%; overflow-y: auto; }
.sidebar nav { display: flex; flex-direction: column; gap: 4px; height: 100%; }
.sidebar-bottom { margin-top: auto; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: 15px; cursor: pointer; }
.nav-item:hover { background: var(--bg-soft); color: var(--navy); }
.nav-item.active { background: var(--navy); color: #fff; }
.nav-item svg { width: 19px; height: 19px; flex-shrink: 0; }

.content { padding: 32px; overflow-y: auto; }

/* Page header */
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; flex-wrap: wrap; gap: 12px; }
.page-head h1 { font-size: 27px; font-weight: 800; letter-spacing: -.3px; }
.page-head p { color: var(--muted); }

/* Stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 34px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.stat-icon { width: 44px; height: 44px; border-radius: 11px; background: var(--bg-soft); display: grid; place-items: center; font-size: 21px; margin-bottom: 14px; }
.stat-value { font-size: 32px; font-weight: 800; color: var(--navy); letter-spacing: -1px; }
.stat-label { color: var(--muted); font-size: 14px; }

/* Lists / cards */
.section-title { font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 14px; }
.list { display: flex; flex-direction: column; gap: 10px; }
.row-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; align-items: center; gap: 14px; cursor: pointer; transition: box-shadow .15s, transform .15s; }
.row-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.row-icon { width: 42px; height: 42px; border-radius: 11px; background: var(--bg-soft); display: grid; place-items: center; font-size: 19px; flex-shrink: 0; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 700; font-size: 15px; }
.row-sub { color: var(--muted); font-size: 13px; }
.row-tag { font-size: 12px; font-weight: 700; padding: 5px 12px; border-radius: 999px; }
.tag-green { background: #DCF3E4; color: var(--green); }
.tag-orange { background: #FCE6D9; color: var(--orange); }
.tag-red { background: #FBE0E0; color: var(--red); }

.search-input { width: 100%; padding: 12px 16px; border: 1.5px solid var(--line); border-radius: 11px; font-size: 15px; font-family: inherit; margin-bottom: 18px; transition: border-color .15s; }
.search-input:focus { outline: none; border-color: var(--navy); }

.count-pill { font-size: 12.5px; font-weight: 700; padding: 6px 13px; border-radius: 999px; background: var(--bg-soft); color: var(--navy); white-space: nowrap; }

.empty { text-align: center; color: var(--muted); padding: 50px 20px; }
.loading { text-align: center; color: var(--muted); padding: 50px 20px; }
.placeholder { background: #fff; border: 1px dashed var(--line); border-radius: var(--radius); padding: 60px 20px; text-align: center; color: var(--muted); }

/* Breadcrumb */
.crumbs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; font-size: 14px; }
.crumbs a { color: var(--navy); font-weight: 600; cursor: pointer; }
.crumbs a:hover { text-decoration: underline; }
.crumbs span { color: var(--muted); }

/* Small buttons in rows */
.row-actions { display: flex; gap: 6px; }
.icon-btn { background: none; border: none; cursor: pointer; font-size: 17px; padding: 6px 8px; border-radius: 8px; color: var(--muted); }
.icon-btn:hover { background: var(--bg-soft); color: var(--navy); }
.btn-sm { padding: 8px 14px; font-size: 13.5px; }

/* Forms */
.form label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; margin: 14px 0 6px; }
.form input, .form select, .form textarea { width: 100%; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 10px; font-size: 15px; font-family: inherit; transition: border-color .15s; }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--navy); }

/* Afkrydsnings-rækker (fx rapport-valg) */
.rep-row { display: flex; align-items: center; gap: 10px; margin: 9px 0; font-size: 15px; color: var(--text, #222); cursor: pointer; }
.rep-row input[type=checkbox] { width: 18px; height: 18px; flex: 0 0 auto; margin: 0; accent-color: var(--navy); }
.rep-row .rep-date { color: var(--muted); font-size: 13px; }
.rep-group-title { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; margin: 18px 0 8px; }
.form textarea { resize: vertical; min-height: 70px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.form-error { color: var(--red); font-size: 14px; margin-top: 10px; min-height: 18px; }

/* Detail rows */
.detail-row { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--bg-alt); font-size: 15px; }
.detail-row .k { color: var(--muted); }
.detail-row .v { font-weight: 600; text-align: right; }

/* Kort — egen stacking-kontekst så Leaflet ikke stikker op gennem modal */
#mapEl, #unitMapEl, #folderMapEl { position: relative; z-index: 0; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(10,20,40,.45); display: grid; place-items: center; z-index: 1500; padding: 20px; }
.modal { background: #fff; border-radius: 18px; width: 100%; max-width: 460px; max-height: 90vh; overflow: auto; box-shadow: 0 30px 80px rgba(0,0,0,.3); }
.modal.wide { max-width: 880px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 24px 14px; }
.modal-head h2 { font-size: 20px; }
.modal-close { background: none; border: none; font-size: 28px; line-height: 1; cursor: pointer; color: var(--muted); }
.modal-close:hover { color: var(--ink); }
.modal-body { padding: 0 24px 24px; }

/* Toast */
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 13px 22px; border-radius: 12px; font-weight: 600; font-size: 14.5px; z-index: 1600; box-shadow: 0 10px 30px rgba(0,0,0,.25); }

/* Responsive */
@media (max-width: 820px) {
    .app-body { grid-template-columns: 1fr; }
    .sidebar { position: fixed; top: 64px; left: 0; bottom: 0; width: 232px; z-index: 25; transform: translateX(-100%); transition: transform .2s; }
    .sidebar.open { transform: translateX(0); }
    .menu-toggle { display: block; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .user-meta { display: none; }
}
@media (max-width: 480px) {
    .stat-grid { grid-template-columns: 1fr; }
    .content { padding: 20px; }
}

/* ---------- Dokumentmapper under enhed ---------- */
.doc-folder .row-icon { background: #FFF4DC; }
.doc-back { background: var(--bg-soft); }
.doc-back .row-icon { background: #fff; color: var(--navy); font-weight: 700; }
.row-card[draggable="true"] { cursor: grab; }
.row-card.dragging { opacity: .45; }
.drag-active .doc-folder { border: 1.5px dashed var(--navy-light); }
.doc-folder.drop-over { border: 1.5px solid var(--navy); background: var(--bg-soft); box-shadow: 0 0 0 3px rgba(0,26,135,.12); transform: none; }
.doc-hint { color: var(--muted); font-size: 13px; margin: 2px 4px 0; }

/* Træk mapper/enheder under en kunde */
.browse-drag .row-card[data-folder]:not(.dragging) { border: 1.5px dashed var(--navy-light); }
.row-card[data-folder].drop-over { border: 1.5px solid var(--navy); background: var(--bg-soft); box-shadow: 0 0 0 3px rgba(0,26,135,.12); transform: none; }
.browse-drag .crumbs a[data-dropcrumb] { outline: 1.5px dashed var(--navy-light); outline-offset: 3px; border-radius: 6px; }
.crumbs a.drop-over { background: var(--bg-soft); outline: 2px solid var(--navy); outline-offset: 3px; border-radius: 6px; text-decoration: none; }

/* ---------- Pakke ---------- */
.plan-banner { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; padding: 9px 18px; background: #FFF4E5; color: #8A4B08; border-bottom: 1px solid #F6DDB8; font-size: 14px; font-weight: 600; }
.plan-banner[hidden] { display: none; }
.plan-banner.expired { background: #FBE0E0; color: #9A1F1F; border-bottom-color: #F3C4C4; }
.plan-banner .btn { background: #fff; color: var(--ink); border-color: rgba(0,0,0,.12); padding: 5px 12px; font-size: 13px; }
.plan-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.plan-name { font-size: 20px; font-weight: 800; color: var(--navy); }
.plan-price { color: var(--muted); font-size: 14px; margin-top: 2px; }
.plan-usages { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 18px; }
.plan-usage-top { display: flex; justify-content: space-between; font-size: 13.5px; margin-bottom: 6px; color: var(--muted); }
.plan-usage-top b { color: var(--ink); }
.plan-bar { height: 8px; border-radius: 99px; background: var(--bg-soft); overflow: hidden; }
.plan-bar i { display: block; height: 100%; border-radius: 99px; background: var(--navy); }
.plan-bar i.near { background: var(--orange); }
.plan-bar i.full { background: var(--red); }
.plan-unl { font-size: 13px; color: var(--green); font-weight: 600; }
.plan-feats { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; }
.plan-feats li { font-size: 14px; padding-left: 22px; position: relative; }
.plan-feats li::before { position: absolute; left: 0; font-weight: 800; }
.plan-feats li.on::before { content: "✓"; color: var(--green); }
.plan-feats li.off { color: var(--muted); }
.plan-feats li.off::before { content: "–"; color: #B7C2D6; }
.plan-foot { color: var(--muted); font-size: 13px; margin-top: 12px; }
.plan-opts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.plan-opt { display: flex; align-items: center; gap: 12px; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; transition: border-color .15s; text-transform: none !important; letter-spacing: 0 !important; font-weight: 400 !important; color: var(--ink) !important; font-size: 14px !important; margin: 0 !important; }
.plan-opt:hover { border-color: var(--navy-light); }
.plan-opt:has(input:checked) { border-color: var(--navy); background: var(--bg-soft); }
.plan-opt.current { opacity: .6; cursor: default; }
.plan-opt input { width: auto !important; margin: 0 !important; }
.plan-opt-main { flex: 1; display: flex; flex-direction: column; }
.plan-opt-main b { font-size: 15px; }
.plan-opt-main span { color: var(--muted); font-size: 13px; }
.plan-opt-price { font-weight: 700; font-size: 14px; text-align: right; white-space: nowrap; }
.plan-opt-price em { display: block; font-style: normal; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.plan-total { font-weight: 700; color: var(--navy); margin: -6px 0 12px; min-height: 20px; }
.plan-locked { max-width: 520px; margin: 0 auto; }
.plan-lock-ic { font-size: 34px; margin-bottom: 10px; }
.plan-locked h3 { color: var(--ink); margin-bottom: 6px; }
.plan-locked p { margin-bottom: 14px; }
@media (max-width: 640px) { .plan-usages, .plan-feats { grid-template-columns: 1fr; } }

/* ---------- Opret virksomhed ---------- */
.register-card { max-width: 460px; }
.login-card select { width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px; font-size: 15px; font-family: inherit; margin-bottom: 16px; background: #fff; color: var(--ink); }
.login-card select:focus { outline: none; border-color: var(--navy); }
.login-card label .opt { text-transform: none; letter-spacing: 0; font-weight: 500; }
.reg-note { color: var(--muted); font-size: 13px; text-align: center; margin-top: 10px; }

/* ---------- Låseskærm: udløbet prøveperiode ---------- */
.trial-lock { position: fixed; inset: 64px 0 0 0; z-index: 40; background: rgba(244, 247, 252, .97); display: flex; justify-content: center; align-items: flex-start; overflow-y: auto; padding: 48px 18px; }
.trial-lock[hidden] { display: none; }
.trial-lock-card { width: 100%; max-width: 860px; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 36px 32px; text-align: center; box-shadow: 0 20px 60px rgba(0,26,135,.10); }
.trial-lock-ic { font-size: 38px; margin-bottom: 8px; }
.trial-lock-card h2 { font-size: 26px; font-weight: 800; }
.trial-lead { color: var(--muted); margin: 8px auto 26px; max-width: 520px; }
.trial-plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; text-align: left; }
.trial-plan { position: relative; border: 1.5px solid var(--line); border-radius: 14px; padding: 20px 18px; display: flex; flex-direction: column; gap: 4px; }
.trial-plan.current { border-color: var(--navy); background: var(--bg-soft); }
.trial-plan b { font-size: 18px; }
.trial-tag { position: absolute; top: -11px; left: 16px; background: var(--navy); color: #fff; font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 99px; }
.trial-price { font-size: 30px; font-weight: 800; letter-spacing: -1px; }
.trial-price span { font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.trial-meta { color: var(--muted); font-size: 13.5px; margin-bottom: 12px; }
.trial-plan .btn { margin-top: auto; }
.trial-foot { color: var(--muted); font-size: 13.5px; margin: 18px 0 8px; }
@media (max-width: 720px) { .trial-plans { grid-template-columns: 1fr; } .trial-lock-card { padding: 28px 18px; } }

/* ---------- Ret placering på enhedens kort ---------- */
.unit-map { transition: box-shadow .15s, border-color .15s; }
.unit-map.loc-editing { border-color: var(--navy) !important; box-shadow: 0 0 0 3px rgba(0,26,135,.15); cursor: crosshair; }
.unit-map.loc-editing .leaflet-grab { cursor: crosshair; }
.loc-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 10px; padding: 10px 14px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 12px; font-size: 13.5px; color: var(--navy); font-weight: 600; }
.loc-bar[hidden] { display: none; }

/* ---------- Slet virksomhed ---------- */
.danger-list { margin: 0 0 4px 20px; color: var(--muted); font-size: 14px; display: grid; gap: 4px; }

/* ---------- Flere ansvarlige montører ---------- */
/* ---------- Biler og værktøj ---------- */
.plate { display: inline-flex; align-items: stretch; overflow: hidden; vertical-align: middle; white-space: nowrap;
    border: 1.5px solid #1F2937; border-radius: 5px; background: #fff; color: #111; font-weight: 800; font-size: 13px; letter-spacing: .06em; line-height: 1; }
.plate-dk { display: flex; align-items: flex-end; padding: 5px 4px 4px; background: #003399; color: #fff; font-size: 9px; font-weight: 700; letter-spacing: 0; }
.plate-no { display: flex; align-items: center; padding: 4px 8px; }
.plate.plate-empty { border-style: dashed; border-color: #B5C0D0; color: #9AA6B8; font-weight: 600; font-size: 12px; letter-spacing: 0; padding: 4px 8px; }
.car-row-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.muted-inline { color: var(--muted); font-weight: 500; }
.lent-inline { color: var(--orange); font-weight: 700; }
.car-head { display: flex; align-items: center; gap: 14px; }
.car-head-icon { width: 50px; height: 50px; font-size: 24px; }
.car-head-sub { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 6px; color: var(--muted); font-size: 14px; }
.section-head-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 28px 0 14px; }
.loan-history { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.loan-hist-row { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 16px; font-size: 13.5px; }
.loan-hist-row + .loan-hist-row { border-top: 1px solid var(--bg-alt); }
/* Værktøjsmapper og udlån af enkelte stk. */
.tool-folder { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; transition: border-color .12s, box-shadow .12s; }
.tool-folder-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; cursor: pointer; user-select: none; }
.tool-folder-head:hover { background: var(--bg-alt); }
.tool-folder-loose .tool-folder-head { cursor: default; }
.tool-folder-loose .tool-folder-head:hover { background: transparent; }
.tool-folder-chev { display: inline-block; width: 12px; font-size: 20px; line-height: 1; color: #9AA6B8; transition: transform .15s; }
.tool-folder.open .tool-folder-chev { transform: rotate(90deg); }
.tool-folder-icon { font-size: 18px; }
.tool-folder-name { flex: 1; min-width: 0; font-weight: 700; font-size: 15px; }
.tool-folder-body { display: none; border-top: 1px solid var(--line); }
.tool-folder.open .tool-folder-body { display: block; }
.tool-folder-plain .tool-folder-body { border-top: none; }
.tool-folder-empty { padding: 14px 16px; color: var(--muted); font-size: 13.5px; }
.tool-item { padding: 10px 16px; }
.tool-item + .tool-item { border-top: 1px solid var(--bg-alt); }
.tool-item[draggable="true"] { cursor: grab; }
.tool-item.dragging { opacity: .45; }
.tool-row { display: flex; align-items: center; gap: 14px; }
.tool-row .row-icon { width: 36px; height: 36px; font-size: 16px; }
.loan-lines { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 2px 50px; }
.loan-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 6px 10px; border-radius: 8px; background: var(--bg-alt); color: var(--muted); font-size: 13px; }
.loan-line strong { color: var(--ink); }
.loan-line-actions { display: flex; align-items: center; gap: 8px; }
.drag-active .tool-folder[data-drop] { border: 1.5px dashed var(--navy-light); }
.tool-folder.drop-over { border: 1.5px solid var(--navy); box-shadow: 0 0 0 3px rgba(0,26,135,.12); }
@media (max-width: 640px) {
    .tool-row { flex-wrap: wrap; }
    .loan-lines { margin-left: 0; }
}

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 520px) { .form-grid-2 { grid-template-columns: 1fr; } }

/* ---------- Kundens logo ---------- */
.row-icon.cust-logo { background: #fff; border: 1px solid var(--line); padding: 3px; overflow: hidden; }
.row-icon.cust-logo img { width: 100%; height: 100%; object-fit: contain; border-radius: 7px; }
.logo-field { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.form .logo-field label.btn { display: inline-flex; margin: 0; font-size: 13.5px; font-weight: 600; color: var(--navy); letter-spacing: 0; text-transform: none; cursor: pointer; }
.logo-remove { color: var(--red); }
.logo-remove:hover { background: #FBE0E0; }

/* ---------- Kundeoplysninger (ⓘ) ---------- */
.cinfo-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.cinfo-head .count-pill { margin-left: auto; }
.cinfo-name { font-size: 19px; font-weight: 800; }
.cinfo-list { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.cinfo-row { display: flex; align-items: flex-start; gap: 12px; padding: 11px 14px; }
.cinfo-row + .cinfo-row { border-top: 1px solid var(--bg-alt); }
.cinfo-icon { width: 22px; flex-shrink: 0; text-align: center; font-size: 16px; line-height: 1.4; }
.cinfo-main { flex: 1; min-width: 0; }
.cinfo-label { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.cinfo-value { font-size: 15px; margin-top: 2px; word-break: break-word; }
.cinfo-value a { color: var(--navy); font-weight: 600; }
.cinfo-value a:hover { text-decoration: underline; }
.cinfo-none { color: #9AA6B8; font-style: italic; }

/* ---------- Servicehistorik (besøg + tjekliste) ---------- */
.visit-list { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.visit-row { display: flex; align-items: center; gap: 16px; padding: 13px 18px; cursor: pointer; transition: background .12s; }
.visit-row + .visit-row { border-top: 1px solid var(--line); }
.visit-row:hover { background: var(--bg-alt); }
.visit-date { width: 52px; flex-shrink: 0; text-align: center; line-height: 1.15; padding: 6px 0 5px;
    border-radius: 10px; border-left: 3px solid var(--vc);
    background: var(--bg-soft); background: color-mix(in srgb, var(--vc) 9%, #fff); }
.vd-day { display: block; font-size: 18px; font-weight: 800; color: var(--ink); }
.vd-mon { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.vd-year { display: block; font-size: 10px; color: #9AA6B8; }
.visit-main { flex: 1; min-width: 0; }
.visit-type { font-weight: 700; font-size: 15px; }
.visit-sub { color: var(--muted); font-size: 13px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.visit-side { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.cl-chip { display: inline-flex; align-items: center; gap: 7px; max-width: 280px; padding: 4px 12px 4px 4px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.cl-chip.ok { background: #E3F5E9; color: #1F7A45; }
.cl-chip.fail { background: #FBE0E0; color: #B42B2B; }
.cl-chip-icon { display: inline-grid; place-items: center; flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 800; background: var(--green); }
.cl-chip.fail .cl-chip-icon { background: var(--red); }
.cl-chip-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-none { font-size: 12.5px; color: #9AA6B8; }
.visit-chev { font-size: 22px; line-height: 1; color: #B5C0D0; }
@media (max-width: 640px) {
    .visit-row { flex-wrap: wrap; row-gap: 8px; }
    .visit-side { width: 100%; padding-left: 68px; justify-content: space-between; }
}

/* Besøgsvindue */
.modal.medium { max-width: 640px; }
.vdet-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; color: var(--muted); font-size: 14px; margin-bottom: 14px; }
.type-pill { padding: 4px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 700; color: var(--vc);
    background: var(--bg-soft); background: color-mix(in srgb, var(--vc) 12%, #fff); }
.vdet-desc { background: var(--bg-alt); border-radius: 10px; padding: 12px 14px; font-size: 14.5px; white-space: pre-wrap; margin-bottom: 18px; }
.vdet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0 10px; }
.vdet-head > span { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.vdet-empty { color: var(--muted); font-size: 14px; padding: 18px 14px; border: 1.5px dashed var(--line); border-radius: 10px; text-align: center; }
.vdet-actions { border-top: 1px solid var(--line); padding-top: 16px; align-items: center; }
.vdet-del { color: var(--red); }
.vdet-del:hover { background: #FBE0E0; }

/* Visning af udfyldt tjekliste */
.cl-view { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.clv-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 14px; background: var(--bg-alt); font-weight: 700; font-size: 14.5px; }
.clv-sum { flex-shrink: 0; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; }
.clv-sum.ok { background: #E3F5E9; color: #1F7A45; }
.clv-sum.fail { background: #FBE0E0; color: #B42B2B; }
.clv-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 10px 14px; font-size: 14px; }
.clv-row + .clv-row { border-top: 1px solid var(--bg-alt); }
.clv-label { flex: 1; min-width: 0; }
.clv-answer { flex-shrink: 0; text-align: right; max-width: 45%; }
.clv-note { color: var(--muted); font-size: 13px; margin-top: 3px; }
.clv-photos { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.clv-photos img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-soft); cursor: pointer; }
.ans { display: inline-block; min-width: 44px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; text-align: center; }
.ans-ok { background: #E3F5E9; color: #1F7A45; }
.ans-fail { background: #FBE0E0; color: #B42B2B; }
.ans-na { background: #ECEEF2; color: #5A6B85; }
.ans-val { font-weight: 700; }
.ans-empty { color: #9AA6B8; font-size: 13px; font-style: italic; }
.clv-sig { padding: 12px 14px; border-top: 1px solid var(--line); }
.clv-sig img { display: block; max-width: 220px; max-height: 100px; margin-top: 6px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }

/* ---------- Adresseforslag under kort-søgning ---------- */
.addr-wrap { position: relative; margin-bottom: 18px; }
.addr-wrap .search-input { margin-bottom: 0; }
.addr-dd { z-index: 1000; }
.addr-dd .sd-item { font-size: 14px; }
.search-dd .sd-item.active { background: var(--bg-soft); }

.pill-btn { border: none; font-family: inherit; cursor: pointer; }
.pill-btn:hover { filter: brightness(.95); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #B82E2E; }
.assignee-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.assignee-chips:empty { display: none; }
.assignee-chip { display: inline-flex; align-items: center; gap: 2px; padding: 5px 5px 5px 12px; border-radius: 999px; background: var(--bg-soft); color: var(--navy); font-size: 13.5px; font-weight: 600; }
.assignee-chip button { background: none; border: none; cursor: pointer; font-size: 17px; line-height: 1; color: var(--navy); padding: 1px 6px; border-radius: 999px; }
.assignee-chip button:hover { background: #fff; }
