/* ==========================================================================
   DES Onlinesystem – stylesheet
   Colours from the logo: teal #00657C and near-black #231F20.
   Layout: computer = top bar + side menu; phone = top bar + bottom bar.
   ========================================================================== */

@font-face { font-family: "Barlow"; src: url("../fonts/barlow-400.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("../fonts/barlow-500.woff") format("woff"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("../fonts/barlow-600.woff") format("woff"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow Semi Condensed"; src: url("../fonts/barlow-semi-condensed-600.woff") format("woff"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow Semi Condensed"; src: url("../fonts/barlow-semi-condensed-700.woff") format("woff"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
    --teal: #00657C;
    --teal-dark: #004A5B;
    --teal-tint: #DCEFF3;
    --teal-wash: #EEF6F8;
    --ink: #231F20;
    --ink-soft: #3D3A3B;
    --muted: #5C6970;
    --line: #DDE3E6;
    --line-soft: #F0F3F4;
    --field-border: #C9D2D6;
    --ground: #F3F5F6;
    --surface: #FFFFFF;
    --hover: #E8EEF0;
    --danger: #C2410C;
    --danger-ink: #7C2D12;
    --danger-tint: #FFEDD5;
    --ok-ink: #14532D;
    --ok-tint: #DCFCE7;

    --radius: 10px;
    --radius-lg: 14px;
    --font: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-display: "Barlow Semi Condensed", "Barlow", system-ui, sans-serif;
    --topbar-h: 65px;
    --tabbar-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--ground);
}

img, svg { display: block; max-width: 100%; }
.icon { flex: none; }

a { color: var(--teal); }
a:hover { color: var(--teal-dark); }

h1, h2, h3 { font-family: var(--font-display); line-height: 1.2; margin: 0; }

p { margin: 0; }

:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }

.visually-hidden {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 14px; border-radius: var(--radius); }
.skip-link:focus { left: 8px; }

.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.stack { display: flex; flex-direction: column; gap: 16px; }
[hidden] { display: none !important; }

/* --- Buttons ------------------------------------------------------------ */

.button {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 0 18px;
    border: 1px solid transparent; border-radius: var(--radius);
    font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
    transition: background-color .15s, border-color .15s;
}
.button--primary { background: var(--teal); color: #FFFFFF; }
.button--primary:hover { background: var(--teal-dark); color: #FFFFFF; }
.button--outline { background: var(--surface); border-color: var(--field-border); color: var(--ink); }
.button--outline:hover { background: var(--hover); color: var(--ink); }
.button--danger { background: var(--danger); color: #FFFFFF; }
.button--block { width: 100%; }
.button--lg { min-height: 52px; font-size: 17px; }
.button:disabled { opacity: .6; cursor: progress; }

.icon-button {
    display: inline-grid; place-items: center; width: 44px; height: 44px;
    border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--surface); color: var(--ink); cursor: pointer;
}
.icon-button:hover { background: var(--hover); color: var(--ink); }

.link-button { border: 0; background: none; padding: 10px; color: var(--teal); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; }

/* --- Forms -------------------------------------------------------------- */

.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .field__row label { font-size: 14px; font-weight: 600; }
.field__row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.hint { font-size: 14px; color: var(--muted); }

input:not([type]), input[type="text"], input[type="password"], input[type="tel"], input[type="email"],
input[type="number"], input[type="date"], input[type="month"], input[type="time"], input[type="datetime-local"], input[type="url"], input[type="search"], select, textarea {
    width: 100%; min-height: 48px; padding: 0 14px;
    border: 1px solid var(--field-border); border-radius: var(--radius);
    background: var(--surface); color: var(--ink);
    font: inherit; font-size: 16px;
}
textarea { padding: 12px 14px; min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(0, 101, 124, .18); }

.input--code { font-size: 24px; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }

.input-group { display: flex; align-items: stretch; border: 1px solid var(--field-border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.input-group:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(0, 101, 124, .18); }
.input-group input { border: 0; border-radius: 0; min-width: 0; flex: 1; }
.input-group input:focus { box-shadow: none; }
.input-group__suffix { display: flex; align-items: center; padding: 0 12px; background: var(--ground); color: var(--muted); font-size: 15px; white-space: nowrap; }

.checkbox { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; cursor: pointer; }
.checkbox input { width: 20px; height: 20px; accent-color: var(--teal); }

/* --- Alerts ------------------------------------------------------------- */

.alert { padding: 12px 14px; border-radius: var(--radius); font-size: 15px; border: 1px solid transparent; }
.alert--error { background: var(--danger-tint); color: var(--danger-ink); border-color: #FDBA74; }
.alert--success { background: var(--ok-tint); color: var(--ok-ink); border-color: #86EFAC; }
.alert--info { background: var(--teal-wash); color: var(--teal-dark); border-color: #B5DCE5; }
.main > .alert { margin-bottom: 16px; }

/* --- Login screens ------------------------------------------------------ */

body.auth { background: var(--ground); min-height: 100vh; display: flex; align-items: flex-start; justify-content: center; padding: 48px 16px; }
.auth__card {
    width: 100%; max-width: 440px; background: var(--surface);
    border: 1px solid var(--line); border-radius: 18px; padding: 40px 32px 28px;
    display: flex; flex-direction: column; gap: 16px;
}
.auth__logo { width: 180px; height: auto; }
.auth__rule { width: 48px; height: 4px; border-radius: 2px; background: var(--teal); margin-top: 12px; }
.auth__title { font-weight: 700; font-size: 32px; }
.auth__lead { color: var(--muted); }
.auth__footer { margin-top: 12px; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; color: var(--muted); }
.back-link { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 600; text-decoration: none; min-height: 32px; }

.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; margin: 8px 0 16px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.passkey-only .button { border-color: var(--ink); }
.passkey-only .hint { margin-top: 10px; }
.passkey-only .alert { margin-top: 12px; }

@media (max-width: 520px) {
    body.auth { padding: 0; background: var(--surface); }
    .auth__card { border: 0; border-radius: 0; min-height: 100vh; padding: 48px 24px 24px; }
    .auth__footer { margin-top: auto; padding-top: 24px; }
}

/* --- App shell ---------------------------------------------------------- */

.topbar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: 24px;
    min-height: var(--topbar-h); padding: 12px 24px;
    background: var(--surface); border-bottom: 1px solid var(--line);
}
.topbar__logo img { height: 40px; width: auto; }
.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.search {
    flex: 1 1 320px; max-width: 560px; display: flex; align-items: center; gap: 10px;
    height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--ground); color: var(--muted);
}
.search:focus-within { border-color: var(--teal); background: var(--surface); }
.search input { border: 0; background: transparent; min-height: 0; height: 100%; padding: 0; box-shadow: none !important; }
.search-toggle { display: none; }

.avatar {
    width: 40px; height: 40px; border-radius: 50%; flex: none;
    display: grid; place-items: center;
    background: var(--teal); color: #FFFFFF; font-weight: 600; font-size: 15px;
}

.usermenu { position: relative; }
.usermenu summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 2px; border-radius: var(--radius); }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu__text { display: flex; flex-direction: column; line-height: 1.2; }
.usermenu__name { font-weight: 600; font-size: 15px; }
.usermenu__role { font-size: 13px; color: var(--muted); }
.usermenu__panel {
    position: absolute; right: 0; top: calc(100% + 8px); min-width: 200px; z-index: 30;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
    padding: 6px; box-shadow: 0 12px 32px rgba(35, 31, 32, .12);
}
.usermenu__panel a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.usermenu__panel a:hover { background: var(--hover); }

.shell { display: flex; align-items: flex-start; }

.sidebar {
    flex: none; width: 260px; padding: 20px 16px;
    position: sticky; top: var(--topbar-h); max-height: calc(100vh - var(--topbar-h)); overflow-y: auto;
}

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav__heading { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 18px 12px 6px; }
.nav__link {
    display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 12px;
    border-radius: 8px; color: var(--ink-soft); text-decoration: none; font-size: 15px;
}
.nav__link:hover { background: var(--hover); color: var(--ink); }
.nav__link.is-current { background: var(--teal); color: #FFFFFF; font-weight: 600; }

.main { flex: 1; min-width: 0; max-width: 1180px; padding: 28px 32px 48px; }
.main:focus { outline: none; }

.tabbar { display: none; }
.menu-sheet { display: none; }

/* --- Page building blocks ----------------------------------------------- */

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-head__meta { font-size: 14px; color: var(--muted); }
.page-head__meta a { color: var(--muted); }
.page-head__title { margin-top: 4px; font-weight: 700; font-size: 34px; letter-spacing: -.01em; }
.page-head__actions { display: flex; flex-wrap: wrap; gap: 10px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); margin-bottom: 24px; }
.card--accent { border-color: #B5DCE5; background: var(--teal-wash); }
.card__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--hover); }
.card__title { font-size: 20px; }
.card__body { padding: 20px; }

.columns { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.columns__wide { flex: 3 1 480px; min-width: 0; }
.columns__narrow { flex: 2 1 320px; min-width: 0; }
.columns .card { margin-bottom: 0; }

.callout { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.callout__icon { width: 52px; height: 52px; border-radius: 12px; background: var(--surface); color: var(--teal); display: grid; place-items: center; flex: none; }
.callout__text { flex: 1 1 280px; display: flex; flex-direction: column; gap: 4px; }

.shortcut-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; padding: 20px; }
.shortcut {
    display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center;
    padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none;
}
.shortcut:hover { border-color: var(--teal); background: var(--teal-wash); color: var(--ink); }
.shortcut__icon { grid-row: span 2; width: 40px; height: 40px; border-radius: 10px; background: var(--teal-tint); color: var(--teal-dark); display: grid; place-items: center; }
.shortcut__label { font-weight: 600; }
.shortcut__section { font-size: 13px; color: var(--muted); }

.item-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); }
.item-list__row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line-soft); }
.item-list__row:first-child { border-top: 0; }
.item-list__icon { color: var(--teal); }
.item-list__main { flex: 1; min-width: 0; }
.item-list__title { font-weight: 600; }
.item-list__meta { font-size: 13px; color: var(--muted); }

.details { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; }
.details dt { color: var(--muted); font-size: 14px; }
.details dd { margin: 0; overflow-wrap: anywhere; }

.badge { display: inline-block; font-size: 13px; font-weight: 600; border-radius: 6px; padding: 2px 8px; }
.badge--danger { background: var(--danger); color: #FFFFFF; }
.badge--warning { background: var(--danger-tint); color: var(--danger-ink); }
.badge--info { background: var(--teal-tint); color: var(--teal-dark); }
.badge--ok { background: var(--ok-tint); color: var(--ok-ink); }
.badge--neutral { background: #EEF1F2; color: var(--ink-soft); }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { text-align: left; font-size: 13px; font-weight: 600; color: var(--muted); padding: 12px 20px; background: #F7F9FA; }
.table td { padding: 12px 20px; border-top: 1px solid var(--line-soft); }
.table tbody tr:hover { background: #F7F9FA; }

.empty-state { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.empty-state__icon { width: 64px; height: 64px; border-radius: 16px; background: var(--teal-tint); color: var(--teal-dark); display: grid; place-items: center; }
.debug { white-space: pre-wrap; background: var(--ground); padding: 12px; border-radius: var(--radius); font-size: 13px; max-width: 100%; overflow: auto; }

/* --- Phones and small tablets ------------------------------------------- */

@media (max-width: 1023px) {
    :root { --topbar-h: 57px; }
    .topbar { gap: 12px; padding: 8px 16px; }
    .topbar__logo img { height: 30px; }
    .search { display: none; }
    .search-toggle { display: inline-grid; }
    .usermenu__text { display: none; }
    .sidebar { display: none; }

    .main { padding: 18px 16px calc(var(--tabbar-h) + 32px + env(safe-area-inset-bottom)); }
    .page-head { margin-bottom: 16px; align-items: flex-start; }
    .page-head__title { font-size: 28px; }
    .page-head__actions { width: 100%; }
    .page-head__actions .button { flex: 1; padding: 0 12px; white-space: nowrap; }
    .card { margin-bottom: 16px; }
    .card__header, .card__body { padding-left: 16px; padding-right: 16px; }
    .shortcut-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 16px; }
    .shortcut { grid-template-columns: 1fr; row-gap: 8px; }
    .shortcut__icon { grid-row: auto; }
    .shortcut__section { display: none; }

    .tabbar {
        display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
        padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
        background: var(--surface); border-top: 1px solid var(--line);
    }
    .tabbar__item {
        display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0;
        color: var(--muted); text-decoration: none; font: inherit; font-size: 12px;
        background: none; border: 0; cursor: pointer;
    }
    .tabbar__item.is-current { color: var(--teal); font-weight: 600; }

    .menu-sheet[open] {
        display: block; position: fixed; inset: 0; margin: 0; width: 100%; max-width: none; height: 100%; max-height: none;
        border: 0; padding: 0 16px calc(24px + env(safe-area-inset-bottom)); background: var(--surface); overflow-y: auto;
    }
    .menu-sheet::backdrop { background: rgba(35, 31, 32, .4); }
    .menu-sheet__header { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; padding: 12px 0; background: var(--surface); }
    .menu-sheet__title { font-family: var(--font-display); font-weight: 700; font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}

@media print {
    .topbar, .sidebar, .tabbar, .menu-sheet { display: none !important; }
    body { background: #FFFFFF; }
    .main { padding: 0; max-width: none; }
    .card { border-color: #999999; break-inside: avoid; }
}

/* ==========================================================================
   Kundekartotek and shared list/detail components
   ========================================================================== */

:root {
    --st-alarm: #B91C1C;      --st-alarm-tint: #FEE2E2;
    --st-rejected: #C2410C;   --st-rejected-tint: #FFEDD5;
    --st-remarks: #4338CA;    --st-remarks-tint: #E0E7FF;
    --st-battery: #A21CAF;    --st-battery-tint: #FAE8FF;
}

.page-head__text { min-width: 0; }
.page-head__sub { color: var(--muted); margin-top: 2px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.toolbar__search {
    flex: 1 1 280px; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px;
    border: 1px solid var(--field-border); border-radius: var(--radius); background: var(--surface); color: var(--muted);
}
.toolbar__search:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(0, 101, 124, .18); }
.toolbar__search input { border: 0; min-height: 46px; padding: 0; box-shadow: none !important; }
.toolbar__search--wide { flex-basis: 420px; }
.toolbar__select select { min-width: 220px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.chip {
    display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px;
    border: 1px solid var(--field-border); background: var(--surface); color: var(--ink); text-decoration: none; font-size: 15px;
}
.chip:hover { background: var(--hover); color: var(--ink); }
.chip.is-active { border-color: var(--teal); background: var(--teal-tint); color: var(--teal-dark); font-weight: 600; }
.chip--alarm.is-active { border-color: var(--st-alarm); background: var(--st-alarm-tint); color: var(--st-alarm); }
.chip--rejected.is-active { border-color: var(--st-rejected); background: var(--st-rejected-tint); color: var(--st-rejected); }
.chip--remarks.is-active { border-color: var(--st-remarks); background: var(--st-remarks-tint); color: var(--st-remarks); }
.chip--battery.is-active { border-color: var(--st-battery); background: var(--st-battery-tint); color: var(--st-battery); }
.chip--toggle { margin-left: auto; }

.badge--alarm { background: var(--st-alarm); color: #FFFFFF; }
.badge--rejected { background: var(--st-rejected-tint); color: #9A3412; }
.badge--remarks { background: var(--st-remarks-tint); color: var(--st-remarks); }
.badge--battery { background: var(--st-battery-tint); color: #86198F; }
.badge--lg { font-size: 14px; padding: 4px 10px; }
.badge + .badge { margin-left: 4px; }

.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #C9D2D6; flex: none; }
.dot--alarm { background: var(--st-alarm); }
.dot--rejected { background: var(--st-rejected); }
.dot--remarks { background: var(--st-remarks); }
.dot--battery { background: var(--st-battery); }

.table--clickable tbody tr { position: relative; }
.row-link { color: var(--ink); font-weight: 600; text-decoration: none; }
.row-link::after { content: ""; position: absolute; inset: 0; }
.row-link:hover { color: var(--teal); text-decoration: underline; }
.table td:first-child { box-shadow: inset 4px 0 0 transparent; }
tr.row--alarm td:first-child { box-shadow: inset 4px 0 0 var(--st-alarm); }
tr.row--rejected td:first-child { box-shadow: inset 4px 0 0 var(--st-rejected); }
tr.row--remarks td:first-child { box-shadow: inset 4px 0 0 var(--st-remarks); }
tr.row--battery td:first-child { box-shadow: inset 4px 0 0 var(--st-battery); }
.table__group th { background: var(--ground); color: var(--ink); font-size: 14px; font-weight: 600; padding: 8px 20px; }
.table tbody tr.table__group:hover { background: var(--ground); }

.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--hover); }
.pager__buttons { display: flex; gap: 8px; }

.result-list { list-style: none; margin: 0; padding: 0; }
.result-list li + li { border-top: 1px solid var(--line-soft); }
.result-list__item { display: flex; align-items: center; gap: 12px; padding: 14px 20px; color: var(--ink); text-decoration: none; box-shadow: inset 4px 0 0 transparent; }
.result-list__item:hover { background: #F7F9FA; color: var(--ink); }
.result-list__item.row--alarm { box-shadow: inset 4px 0 0 var(--st-alarm); }
.result-list__item.row--rejected { box-shadow: inset 4px 0 0 var(--st-rejected); }
.result-list__item.row--remarks { box-shadow: inset 4px 0 0 var(--st-remarks); }
.result-list__item.row--battery { box-shadow: inset 4px 0 0 var(--st-battery); }
.result-list__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.result-list__title { font-weight: 600; }
.result-list__meta { font-size: 14px; color: var(--muted); }
.result-list__badges { margin-top: 4px; }

.status-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }

.tabs { display: flex; gap: 4px; overflow-x: auto; margin: 0 0 20px; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.tabs__tab {
    flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px;
    color: var(--ink-soft); text-decoration: none; font-weight: 500; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tabs__tab:hover { color: var(--ink); background: var(--hover); border-radius: 8px 8px 0 0; }
.tabs__tab.is-current { color: var(--teal-dark); border-bottom-color: var(--teal); font-weight: 600; }
.tabs__count { font-size: 12px; background: var(--hover); color: var(--ink-soft); border-radius: 999px; padding: 1px 7px; }

.details--wide { grid-template-columns: 220px 1fr; }
.form-intro { margin-bottom: 16px; }
.pre-line { white-space: pre-line; }

.item-list--flush { border: 0; border-radius: 0; }
.item-list__heading { padding: 14px 20px 6px; font-family: var(--font-display); font-weight: 700; font-size: 18px; border-top: 1px solid var(--line-soft); }
.item-list--flush .item-list__heading:first-child { border-top: 0; }
.item-list--flush .item-list__row { padding-left: 20px; padding-right: 20px; }
a.item-list__title { color: var(--ink); }
a.item-list__title:hover { color: var(--teal); }

.disclosure-list { border: 1px solid var(--line); border-radius: var(--radius); }
.disclosure + .disclosure { border-top: 1px solid var(--line-soft); }
.disclosure summary { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 12px 14px; cursor: pointer; list-style-position: inside; }
.disclosure summary:hover { background: #F7F9FA; }
.disclosure__date { color: var(--muted); font-size: 14px; min-width: 130px; font-variant-numeric: tabular-nums; }
.disclosure__title { font-weight: 600; flex: 1; min-width: 200px; }
.disclosure__body { padding: 4px 14px 16px; font-size: 14px; color: var(--ink-soft); overflow-wrap: anywhere; }

.sibling-list { list-style: none; margin: 0; padding: 6px; }
.sibling-list__item { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 15px; }
.sibling-list__item:hover { background: var(--hover); color: var(--ink); }
.sibling-list__item.is-current { background: var(--teal-tint); color: var(--teal-dark); font-weight: 600; }

.upload { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding-top: 16px; border-top: 1px solid var(--hover); }
.upload .field { flex: 1 1 260px; }
.upload input[type="file"] { min-height: 44px; padding: 8px 0; }

.jump-links { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 16px; padding-bottom: 4px; }
.jump-links a { flex: none; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-soft); text-decoration: none; font-size: 14px; }
.jump-links a:hover { border-color: var(--teal); color: var(--teal-dark); }

.customer-form .card { scroll-margin-top: calc(var(--topbar-h) + 12px); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px 20px; }
.field--full { grid-column: 1 / -1; }
.field__row { flex-wrap: wrap; }
.field__error { font-size: 14px; color: var(--danger-ink); font-weight: 600; }
.field.has-error input, .field.has-error textarea, .field.has-error select { border-color: var(--danger); }
.required { color: var(--danger); }
.share-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 400; color: var(--muted); cursor: pointer; }
.share-toggle input { width: 16px; height: 16px; accent-color: var(--teal); }
.link-button--small { font-size: 13px; padding: 0; line-height: 1.4; }
input:disabled, select:disabled, textarea:disabled { background: var(--ground); color: var(--ink-soft); cursor: not-allowed; }

.checks { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.checks legend { font-weight: 600; font-size: 15px; margin-bottom: 6px; padding: 0; }
.checks .checkbox { min-height: 40px; }
.checks input[type="radio"] { width: 20px; height: 20px; accent-color: var(--teal); flex: none; }

.sibling-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.sibling-buttons .button { font-weight: 500; }

.form-actions {
    position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px;
    margin: 0 -32px -48px; padding: 14px 32px; background: rgba(255, 255, 255, .96); border-top: 1px solid var(--line);
    backdrop-filter: blur(6px);
}

@media (max-width: 1023px) {
    .hide-sm { display: none; }
    .chip--toggle { margin-left: 0; }
    .toolbar__select, .toolbar__select select { width: 100%; }
    .details--wide { grid-template-columns: 1fr; gap: 2px; }
    .details--wide dd { margin-bottom: 10px; }
    .form-actions { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); margin: 0 -16px; padding: 12px 16px; }
    .form-actions .button { flex: 1; }
    .table th, .table td { padding-left: 14px; padding-right: 14px; }
}

/* ==========================================================================
   Timesedler
   ========================================================================== */

fieldset.plain { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.field { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.field legend { font-size: 14px; font-weight: 600; padding: 0; margin-bottom: 6px; }

.picker { position: relative; }
.picker__control {
    display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 14px;
    border: 1px solid var(--field-border); border-radius: var(--radius); background: var(--surface); color: var(--muted);
}
.picker__control:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(0, 101, 124, .18); }
.picker__control.has-error { border-color: var(--danger); }
.picker__control input { border: 0; min-height: 50px; padding: 0; box-shadow: none !important; }
.picker__results {
    position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 15; list-style: none; margin: 0; padding: 6px;
    max-height: 320px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: 0 12px 32px rgba(35, 31, 32, .14);
}
.picker__results [role="option"] { padding: 10px 12px; border-radius: 8px; cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.picker__results [role="option"]:hover, .picker__results [aria-selected="true"] { background: var(--teal-tint); color: var(--teal-dark); }
.picker__empty { padding: 10px 12px; color: var(--muted); }

.segmented { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--field-border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: flex; align-items: center; min-height: 46px; padding: 0 18px; font-weight: 500; }
.segmented label + label span { border-left: 1px solid var(--field-border); }
.segmented input:checked + span { background: var(--teal); color: #FFFFFF; font-weight: 600; }
.segmented input:focus-visible + span { outline: 3px solid var(--teal); outline-offset: -3px; }

.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span {
    display: flex; align-items: center; justify-content: center; text-align: center; min-height: 48px; padding: 6px 12px;
    border: 1px solid var(--field-border); border-radius: var(--radius); background: var(--surface); font-weight: 500;
}
.choice input:checked + span { background: var(--teal); border-color: var(--teal); color: #FFFFFF; font-weight: 600; }
.choice input:focus-visible + span { outline: 3px solid var(--teal); outline-offset: 2px; }
fieldset:disabled .choice span, fieldset:disabled .segmented span { cursor: not-allowed; opacity: .75; }

.duration { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.part-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.part-list:empty { display: none; }
.part-list__item { display: flex; align-items: center; gap: 10px; padding: 4px 4px 4px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--ground); }
.part-list__name { flex: 1; min-width: 0; }
.part-list__item .icon-button { border: 0; background: transparent; }

.thumbs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.thumbs__item { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.thumbs__link { display: flex; flex-direction: column; gap: 6px; color: var(--ink); text-decoration: none; }
.thumbs__link img, .thumbs__file { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); background: var(--ground); }
.thumbs__file { display: grid; place-items: center; color: var(--muted); }
.thumbs__name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.col-check { width: 44px; position: relative; z-index: 1; }
.col-check input { width: 20px; height: 20px; accent-color: var(--teal); }
.bulk-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.form-actions__left { margin-right: auto; }

@media (max-width: 1023px) {
    .choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .segmented { display: flex; }
    .segmented label { flex: 1; }
    .segmented span { justify-content: center; padding: 0 10px; }
    .form-actions__left { margin-right: 0; order: 5; flex-basis: 100%; }
}

/* ==========================================================================
   Tilkald og opgaver
   ========================================================================== */

.result-list__heading { padding: 12px 20px 6px; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: #F7F9FA; }
.result-list li.result-list__heading + li { border-top: 0; }
.card--info { border-color: #FDBA74; background: #FFF7ED; }
.card--info .card__header { border-bottom-color: #FED7AA; }
.details--stack { grid-template-columns: 1fr; gap: 2px; }
.details--stack dd { margin-bottom: 10px; }
.details--stack a { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }

/* --- Forside ------------------------------------------------------------ */

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi {
    display: flex; flex-direction: column; gap: 2px; padding: 16px 20px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
    color: var(--ink); text-decoration: none; box-shadow: inset 0 4px 0 var(--teal);
}
.kpi:hover { border-color: var(--teal); color: var(--ink); }
.kpi__label { font-size: 14px; font-weight: 600; color: var(--muted); }
.kpi__value { font-family: var(--font-display); font-size: 40px; font-weight: 700; line-height: 1.1; }
.kpi__sub { font-size: 14px; color: var(--muted); }
.kpi--alarm { box-shadow: inset 0 4px 0 var(--st-alarm); }
.kpi--alarm .kpi__value, .kpi--alarm .kpi__sub { color: var(--st-alarm); }
.kpi--warning { box-shadow: inset 0 4px 0 var(--st-rejected); }
.kpi--warning .kpi__value { color: var(--st-rejected); }
.columns + .section-title, .columns + .columns { margin-top: 32px; }
.section-title { font-size: 22px; margin-bottom: 16px; }

.type-dot { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.type-dot--call { background: var(--st-alarm-tint); color: var(--st-alarm); }
.type-dot--task { background: var(--teal-tint); color: var(--teal-dark); }
.result-list--compact .result-list__item { padding: 10px 20px; }
.result-list__item > svg:last-child { color: var(--muted); flex: none; }

.link-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; padding: 16px; }

.status-pill { flex: none; font-size: 13px; font-weight: 600; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.status-pill--ok { background: var(--ok-tint); color: var(--ok-ink); }
.status-pill--fine { background: #ECFDF5; color: #166534; }
.status-pill--warning { background: var(--st-rejected-tint); color: #9A3412; }
.status-pill--late { background: var(--st-alarm-tint); color: var(--st-alarm); }

.meters { display: flex; flex-direction: column; gap: 16px; }
.meter__head { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; }
.meter__value { font-variant-numeric: tabular-nums; }
.meter__bar { appearance: none; width: 100%; height: 10px; margin: 6px 0 4px; border: 0; border-radius: 999px; background: var(--line-soft); overflow: hidden; display: block; }
.meter__bar::-webkit-progress-bar { background: var(--line-soft); border-radius: 999px; }
.meter__bar::-webkit-progress-value { background: var(--teal); border-radius: 999px; }
.meter__bar::-moz-progress-bar { background: var(--teal); border-radius: 999px; }

.staff-list { list-style: none; margin: 0; padding: 0; columns: 2 400px; column-gap: 0; }
.staff-list__row { display: flex; align-items: center; gap: 10px; padding: 8px 20px; break-inside: avoid; border-bottom: 1px solid var(--line-soft); }
.staff-list__row input { width: 20px; height: 20px; accent-color: var(--teal); flex: none; }
.staff-list__nocheck { width: 20px; flex: none; }
.staff-list__name { flex: 1; min-width: 0; font-weight: 600; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.staff-list__phone { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.avatar--sm { width: 32px; height: 32px; font-size: 13px; }
.staff-sms { display: flex; flex-direction: column; gap: 8px; }
.staff-sms label { font-weight: 600; }
.staff-sms__bar, .staff-sms__actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

@media (max-width: 1023px) {
    .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
    .kpi { padding: 12px 14px; }
    .kpi__value { font-size: 32px; }
    .kpi__sub { font-size: 13px; }
}

/* --- GPS ---------------------------------------------------------------- */

.gps-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
.gps-layout .card { margin-bottom: 0; }
.gps-map { position: relative; height: calc(100vh - 260px); min-height: 420px; overflow: hidden; background: #E5ECEE; }
.gps-map__message { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--muted); font-weight: 600; }
.gps-list { max-height: calc(100vh - 260px); min-height: 420px; overflow-y: auto; }
.gps-target { margin-bottom: 16px; }

.car-list { list-style: none; margin: 0; padding: 0; }
.car + .car { border-top: 1px solid var(--line-soft); }
.car { box-shadow: inset 4px 0 0 transparent; }
.car.is-active { box-shadow: inset 4px 0 0 var(--teal); background: var(--teal-wash); }
.car__main {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 16px 4px; border: 0; background: none;
    text-align: left; font: inherit; color: var(--ink); cursor: pointer;
}
.car__main:disabled { cursor: default; }
.car__main:disabled .avatar { background: #9CA3AF; }
.car__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.car__name { font-weight: 600; }
.car__address { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.car__side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; }
.car__distance { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.car__links { display: flex; gap: 16px; padding: 0 16px 12px 58px; font-size: 14px; }

.status-pill--moving { background: var(--teal-tint); color: var(--teal-dark); }
.status-pill--parked { background: var(--ok-tint); color: var(--ok-ink); }
.status-pill--offline { background: #EEF1F2; color: var(--ink-soft); }
.status-pill--off { background: #F3F4F6; color: #6B7280; }

.gps-pin {
    width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
    background: var(--pin, var(--teal)); color: #FFFFFF; border: 2px solid #FFFFFF;
    font: 600 12px var(--font); box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
}
.gps-info { font: 14px/1.4 var(--font); color: var(--ink); display: flex; flex-direction: column; gap: 2px; }

.day-nav { align-items: center; }
.day-nav .button { flex: none; min-width: 48px; padding-left: 12px; padding-right: 12px; }
.day-nav input[type="date"] { width: auto; min-height: 44px; }
.kpis--compact .kpi { box-shadow: none; }
.kpis--compact .kpi__value { font-size: 30px; }
.kpis--compact .kpi__value small { font-size: 16px; font-weight: 600; color: var(--muted); }

.timeline { list-style: none; margin: 0; padding: 8px 0; }
.timeline__button { display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 8px 16px; border: 0; background: none; font: inherit; color: var(--ink); text-align: left; cursor: pointer; }
.timeline__item.is-active .timeline__button, .timeline__button:hover { background: var(--teal-wash); }
.timeline__time { flex: none; width: 46px; font-weight: 600; font-variant-numeric: tabular-nums; padding-top: 1px; }
.timeline__dot { flex: none; width: 12px; height: 12px; margin-top: 5px; border-radius: 50%; background: var(--st-alarm); box-shadow: 0 0 0 3px var(--st-alarm-tint); }
.timeline__item--start .timeline__dot { background: #15803D; box-shadow: 0 0 0 3px var(--ok-tint); }
.timeline__text { display: flex; flex-direction: column; min-width: 0; }
.timeline__label { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.timeline__address { overflow-wrap: anywhere; }

@media (max-width: 1023px) {
    .gps-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .gps-map { height: 55vh; min-height: 300px; }
    .gps-list { max-height: none; min-height: 0; }
    .day-nav { width: 100%; flex-wrap: nowrap; }
    .day-nav input[type="date"] { flex: 1; }
}
.address-option { flex-direction: column; align-items: flex-start !important; justify-content: center; gap: 0; }
.address-option__main { font-weight: 600; }
.address-option__secondary { font-size: 14px; color: var(--muted); }
[data-address-search] textarea { width: 100%; }

/* --- Filter bar (service, fall test …) ------------------------------------ */

.filter-bar { padding: 16px 20px; margin-bottom: 16px; }
.filter-bar__fields { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; }
.filter-bar__fields .field { margin: 0; min-width: 160px; }
.filter-bar__search { flex: 1 1 220px; }
.filter-bar__checks { display: flex; flex-direction: column; gap: 0; min-width: 0 !important; }
.filter-bar__checks .checkbox { min-height: 30px; }

/* --- Service ------------------------------------------------------------ */

.service-summary .card__body { display: flex; flex-direction: column; gap: 12px; }
.service-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; }
.service-legend span { display: inline-flex; align-items: center; gap: 6px; }
.service-legend .strip__day { width: 14px; height: 14px; min-height: 0; padding: 0; border-radius: 4px; display: inline-block; }
.service-legend__sort { margin-left: auto; }

.service-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.service-item { margin: 0; padding: 14px 20px; display: flex; flex-direction: column; gap: 10px; box-shadow: inset 4px 0 0 transparent; }
.service-item.has-warning { box-shadow: inset 4px 0 0 var(--st-alarm); }
.service-item.is-done { box-shadow: inset 4px 0 0 #15803D; }
.service-item__head { display: flex; align-items: flex-start; gap: 12px; }
.service-item__sort { flex: none; min-width: 34px; height: 34px; padding: 0 6px; border-radius: 10px; background: var(--teal-tint); color: var(--teal-dark); display: grid; place-items: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.service-item__title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.service-item__address { font-weight: 600; font-size: 17px; color: var(--ink); text-decoration: none; }
.service-item__address:hover { color: var(--teal); text-decoration: underline; }
.service-item__meta { font-size: 14px; color: var(--muted); }
.service-item__meta strong { color: var(--ink); font-weight: 600; }
.service-item__warnings { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.service-item__warnings .badge { margin: 0; }
.service-item__warnings a { color: inherit; }
.service-item__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.service-item__done { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.service-item__done li { display: flex; align-items: center; gap: 8px; color: var(--ok-ink); }
.service-item__done form { display: inline; }
.service-register { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.service-register input[type="date"] { width: auto; min-height: 44px; }
.service-blocked { margin-left: auto; max-width: 520px; font-size: 14px; }
.service-blocked summary { cursor: pointer; color: var(--st-alarm); font-weight: 600; }
.service-blocked .service-register { margin-top: 8px; }

.strip { display: grid; grid-template-columns: repeat(51, minmax(0, 1fr)); gap: 2px; }
.strip--48 { grid-template-columns: repeat(48, minmax(0, 1fr)); }
.strip--49 { grid-template-columns: repeat(49, minmax(0, 1fr)); }
.strip--50 { grid-template-columns: repeat(50, minmax(0, 1fr)); }
.strip__day {
    min-height: 30px; padding: 0; border: 0; border-radius: 5px; background: #F1F4F5; color: var(--ink-soft);
    font: 600 11px var(--font); min-width: 0; font-variant-numeric: tabular-nums; cursor: pointer;
}
.strip__day.is-weekend { background: #E4E9EB; }
.strip__day.is-outside { opacity: .55; }
.strip__day.is-window { background: var(--teal-tint); color: var(--teal-dark); }
.strip__day.is-due { background: var(--teal); color: #FFFFFF; }
.strip__day.is-done { background: #15803D; color: #FFFFFF; box-shadow: inset 0 0 0 2px #0B4F25; }
.strip__day.is-today { outline: 2px solid var(--ink); outline-offset: -2px; }
.strip__day.is-picked { outline: 3px solid var(--st-rejected); outline-offset: -1px; }
.strip__day:disabled { cursor: default; }
.strip__day:not(:disabled):hover { filter: brightness(.92); }

.sort-row { gap: 14px; }
.sort-row__input { width: 76px; min-height: 44px; text-align: center; font-variant-numeric: tabular-nums; }

@media (max-width: 1023px) {
    .strip { display: none; }
    .service-item { padding: 14px 16px; }
    .service-register { margin-left: 0; width: 100%; }
    .service-register input[type="date"] { flex: 1; }
    .service-blocked { margin-left: 0; }
    .service-legend .strip__day { display: none; }
    .service-legend span:not(:has(a)) { display: none; }
}

/* --- Faldprøve ---------------------------------------------------------- */

.tabs__tab--right { margin-left: auto; }
.falltest-table .num { width: 40px; text-align: right; font-variant-numeric: tabular-nums; }
.falltest-table td { vertical-align: top; }
.falltest-table .badge { margin-left: 6px; }
.falltest-table tr.row-alarm td:first-child { box-shadow: inset 4px 0 0 var(--st-alarm); }
.falltest-note summary { cursor: pointer; color: var(--teal); }
.falltest-note div { margin-top: 6px; font-size: 14px; white-space: normal; }
@media print {
    .no-print, .chips, .tabs { display: none !important; }
    .falltest-section { break-inside: auto; }
    .falltest-table a { color: inherit; text-decoration: none; }
}

/* --- Vagtplan ----------------------------------------------------------- */

.my-shifts__list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 20px; }
.rota { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 12px; }
.rota__head, .rota__row { display: grid; grid-template-columns: 52px repeat(7, minmax(0, 1fr)); }
.rota__head { background: #F7F9FA; font-size: 13px; font-weight: 600; color: var(--muted); }
.rota__head > span { padding: 10px 8px; }
.rota__row + .rota__row, .rota__head + .rota__row { border-top: 1px solid var(--line-soft); }
.rota__week { display: grid; place-items: center; font-weight: 700; color: var(--muted); background: #F7F9FA; font-variant-numeric: tabular-nums; }
.rota__day { min-height: 104px; padding: 8px; border-left: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 4px; }
.rota__day.is-weekend { background: #FBFCFC; }
.rota__day.is-outside { opacity: .5; }
.rota__day.is-today { box-shadow: inset 0 0 0 2px var(--teal); }
.rota__day.is-swapped .rota__person { color: var(--st-rejected); }
.rota__date { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; }
.rota__wd { display: none; color: var(--muted); }
.rota__slot { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rota__person { font-weight: 600; flex: 1; overflow-wrap: anywhere; }
.rota__regular { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }
.rota__edit summary { font-size: 13px; color: var(--teal); cursor: pointer; }
.rota__edit form { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.rota__edit select { font-size: 14px; min-height: 40px; }
.rota__edit .button { min-height: 38px; }

@media (max-width: 1023px) {
    .rota { border: 0; background: none; }
    .rota__head { display: none; }
    .rota__row { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; border: 0 !important; }
    .rota__week { justify-content: start; place-items: start; background: none; padding: 8px 4px 0; }
    .rota__week::before { content: 'Uge '; }
    .rota__day { min-height: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
    .rota__day.is-outside { display: none; }
    .rota__wd { display: inline; }
}

/* --- Ugerapport --------------------------------------------------------- */

.week-day.is-today { border-color: var(--teal); box-shadow: 0 0 0 1px var(--teal); }
.week-day { overflow: hidden; }
.week-day.is-empty .card__header { border-bottom: 0; }
.week-day__total { font-weight: 700; font-variant-numeric: tabular-nums; }
.week-entries { list-style: none; margin: 0; padding: 0; }
.week-entry { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; padding: 12px 20px; }
.week-entry + .week-entry { border-top: 1px solid var(--line-soft); }
.week-entry--sheet { background: #FAFBFB; }
.week-entry__title { font-weight: 600; }
.week-entry__title .badge { margin-left: 6px; }
.week-entry__text { font-size: 14px; color: var(--ink-soft); margin-top: 2px; overflow-wrap: anywhere; }
.week-entry__time { display: flex; flex-direction: column; align-items: flex-end; font-variant-numeric: tabular-nums; }
.week-entry__edit { grid-column: 1 / -1; }
.week-entry__edit summary { font-size: 14px; color: var(--teal); cursor: pointer; width: fit-content; }
.week-entry__edit form { margin-top: 8px; }
.week-edit { display: flex; flex-direction: column; gap: 8px; }
.week-edit__row { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.week-edit__row label { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.week-edit__row select { width: auto; }
.week-edit__actions { display: flex; justify-content: flex-end; }
.button--small { min-height: 36px; padding: 0 12px; font-size: 14px; }
.week-add { position: sticky; top: calc(var(--topbar-h) + 16px); }
.week-note { padding: 12px 14px; border-radius: var(--radius); display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 1023px) {
    .week-add { position: static; }
    .week-entry { padding: 12px 16px; }
}
@media (min-width: 1024px) and (max-width: 1279px) {
    .strip__day { font-size: 9px; min-height: 26px; border-radius: 4px; }
}
@media (max-width: 1023px) {
    .filter-bar { padding: 14px 16px; }
    .filter-bar__fields > .field { flex: 1 1 140px; min-width: 0; }
    .filter-bar__fields > .filter-bar__search { flex-basis: 100%; }
    .filter-bar__fields > .button { flex: 1 1 auto; }
    .meter__head { flex-wrap: wrap; }
}

/* --- Lager / Værktøj ---------------------------------------------------- */

.catalog { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; align-items: start; }
.catalog .card { margin-bottom: 16px; }
.catalog-groups > summary { list-style: none; cursor: default; }
.catalog-groups > summary::-webkit-details-marker { display: none; }
.catalog-groups__toggle { display: none; }
.group-tree { list-style: none; margin: 0; padding: 6px 0; max-height: calc(100vh - 280px); overflow-y: auto; }
.group-tree__link { display: flex; justify-content: space-between; gap: 8px; padding: 7px 16px; color: var(--ink); text-decoration: none; font-size: 15px; border-left: 3px solid transparent; }
.group-tree__link:hover { background: var(--hover); color: var(--ink); }
.group-tree__link.is-current { background: var(--teal-tint); color: var(--teal-dark); font-weight: 600; border-left-color: var(--teal); }
.group-tree__count { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.depth-1 { padding-left: 32px; } .depth-2 { padding-left: 48px; } .depth-3 { padding-left: 64px; }
.depth-4 { padding-left: 80px; } .depth-5, .depth-6 { padding-left: 96px; }
.catalog-groups__foot { display: flex; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--line-soft); }
.location-search { margin-top: 12px; }
.location-search summary { cursor: pointer; color: var(--teal); font-weight: 600; font-size: 15px; }
.location-fields { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; margin-top: 10px; }
.location-fields label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 600; }
.location-fields select { width: auto; min-width: 80px; }
.location-fields--form { margin-top: 0; }
.catalog-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.catalog-table td { vertical-align: top; }
.catalog-table__desc { margin-top: 2px; font-weight: 400; }
.nowrap { white-space: nowrap; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.thumb { position: relative; margin: 0; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--ground); border: 1px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb form { position: absolute; top: 4px; right: 4px; }
.thumb__delete { width: 30px; height: 30px; border: 0; border-radius: 8px; background: rgba(255, 255, 255, .92); color: var(--danger); display: grid; place-items: center; cursor: pointer; }
.file-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.file-list li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.file-list a { display: inline-flex; align-items: center; gap: 6px; }
.file-list form { margin-left: auto; }
.upload-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.upload-row input[type="file"] { flex: 1 1 180px; min-width: 0; font-size: 14px; }
.borrow-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.borrow-history { list-style: none; margin: 0; padding: 0; font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.group-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.group-row input[name="name"] { flex: 1 1 200px; min-width: 0; }
.group-row select { flex: 0 1 240px; width: auto; }
.group-row__count { min-width: 48px; text-align: right; }
.group-admin { list-style: none; margin: 0; padding: 0; }
.group-admin__item { padding: 8px 20px; border-top: 1px solid var(--line-soft); }
.group-admin__item.depth-1 { padding-left: 44px; } .group-admin__item.depth-2 { padding-left: 68px; }
.group-admin__item.depth-3, .group-admin__item.depth-4, .group-admin__item.depth-5, .group-admin__item.depth-6 { padding-left: 92px; }

@media (max-width: 1023px) {
    .catalog { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .catalog-groups:not([open]) .card__header { border-bottom: 0; }
    .catalog-groups > summary { cursor: pointer; }
    .catalog-groups__toggle { display: inline-flex; transition: transform .15s; }
    .catalog-groups[open] .catalog-groups__toggle { transform: rotate(90deg); }
    .group-tree { max-height: 50vh; }
    .group-admin__item[class*="depth-"] { padding-left: 16px; }
    .group-row select { flex-basis: 100%; }
}

/* --- Adressebog ---------------------------------------------------------- */
.address-row { position: relative; }
.row-link-plain { color: var(--ink); text-decoration: none; }
.row-link-plain::after { content: ""; position: absolute; inset: 0; }
.address-row .button, .address-row .badge { position: relative; z-index: 1; }

/* --- Dokumenter ---------------------------------------------------------- */
.doc-list { list-style: none; margin: 0; padding: 0; }
.doc-list li + li { border-top: 1px solid var(--line-soft); }
.doc-list__item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; color: var(--ink); text-decoration: none; }
.doc-list__item:hover { background: #F7F9FA; color: var(--ink); }
.doc-list__item > svg:last-child { color: var(--muted); margin-left: auto; flex: none; }
.doc-list__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.doc-list__name { font-weight: 600; overflow-wrap: anywhere; }
.doc-list__meta { font-size: 14px; color: var(--muted); }
.doc-icon { flex: none; width: 42px; height: 42px; border-radius: 10px; background: #EEF1F2; color: var(--ink-soft); display: grid; place-items: center; font-size: 11px; font-weight: 700; letter-spacing: .02em; }
.doc-icon--folder { background: var(--teal-tint); color: var(--teal-dark); }

/* --- Sagssystem ---------------------------------------------------------- */
.case-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.case-card { margin: 0 !important; display: flex; align-items: stretch; }
.case-card__link { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; padding: 14px 20px; color: var(--ink); text-decoration: none; }
.case-card__link:hover { background: #F7F9FA; color: var(--ink); }
.case-card__head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.case-card__name { font-weight: 600; font-size: 17px; }
.case-card__meta, .case-card__percent { font-size: 14px; color: var(--muted); }
.case-card__move { display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 8px; border-left: 1px solid var(--line-soft); }
.case-card__move button:first-child svg { transform: rotate(90deg); } .case-card__move button:last-child svg { transform: rotate(90deg); }
.progress { display: block; height: 8px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.progress__bar { display: block; height: 100%; border-radius: 999px; background: var(--st-rejected); transition: width .2s; }
.progress--half { background: #CA8A04; } .progress--done { background: #15803D; }
.w-0 { width: 0%; } .w-5 { width: 5%; } .w-10 { width: 10%; } .w-15 { width: 15%; } .w-20 { width: 20%; } .w-25 { width: 25%; } .w-30 { width: 30%; } .w-35 { width: 35%; } .w-40 { width: 40%; } .w-45 { width: 45%; } .w-50 { width: 50%; } .w-55 { width: 55%; } .w-60 { width: 60%; } .w-65 { width: 65%; } .w-70 { width: 70%; } .w-75 { width: 75%; } .w-80 { width: 80%; } .w-85 { width: 85%; } .w-90 { width: 90%; } .w-95 { width: 95%; } .w-100 { width: 100%; } 
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist__item { padding: 10px 20px; border-top: 1px solid var(--line-soft); }
.checklist__item:first-child { border-top: 0; }
.checklist__row { display: flex; align-items: flex-start; gap: 12px; }
.checklist__row input[type=checkbox] { width: 22px; height: 22px; margin-top: 2px; accent-color: #15803D; flex: none; }
.checklist__name { flex: 1; min-width: 0; font-weight: 600; }
.checklist__item.is-done .checklist__name { color: var(--ok-ink); }
.checklist__done { display: block; font-size: 13px; font-weight: 400; color: var(--muted); }
.checklist__tools { display: flex; gap: 6px; align-items: center; }
.checklist__order { width: 64px; min-height: 36px !important; padding: 0 8px !important; text-align: center; }
.comments { margin: 8px 0 0 34px; display: flex; flex-direction: column; gap: 6px; }
.comments summary { font-size: 14px; color: var(--teal); cursor: pointer; width: fit-content; }
.comment { background: var(--ground); border-radius: 8px; padding: 8px 10px; font-size: 14px; white-space: pre-line; }
.comment__when { display: block; font-size: 12px; color: var(--muted); }
.comment-form { display: flex; gap: 8px; margin-top: 6px; }
.comment-form input { flex: 1; min-width: 0; }
.template-card .card__body { display: flex; flex-direction: column; gap: 8px; }
.template-item { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.template-item input[name=name] { flex: 1 1 220px; min-width: 0; }
.template-item input[name=sort] { width: 80px; }
.form-actions.form-actions--inline { position: static; margin: 0; padding: 0; background: none; border: 0; backdrop-filter: none; }

/* --- Andet --------------------------------------------------------------- */
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 24px; margin: 0 0 12px; }
.facts dt { font-size: 13px; color: var(--muted); font-weight: 600; }
.facts dd { margin: 2px 0 0; }
.result-list__item.is-current { background: var(--teal-wash); box-shadow: inset 4px 0 0 var(--teal); }
.alarm-log { list-style: none; margin: 0; padding: 0; }
.alarm-log__item + .alarm-log__item { border-top: 1px solid var(--line-soft); }
.alarm-log summary { display: flex; gap: 14px; padding: 12px 20px; cursor: pointer; list-style: none; }
.alarm-log summary::-webkit-details-marker { display: none; }
.alarm-log summary:hover { background: #F7F9FA; }
.alarm-log__time { font-weight: 700; font-variant-numeric: tabular-nums; width: 46px; flex: none; }
.alarm-log__main { display: flex; flex-direction: column; min-width: 0; }
.alarm-log__subject { font-weight: 600; overflow-wrap: anywhere; }
.alarm-log__body { padding: 0 20px 14px 80px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.alarm-log__body pre { margin: 0; white-space: pre-wrap; font: 14px/1.5 var(--font); background: var(--ground); padding: 10px 12px; border-radius: 8px; width: 100%; overflow-wrap: anywhere; }
.service-total { border-top: 1px solid var(--line); padding-top: 12px; font-size: 18px; }
.holiday-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 16px; }
.holiday-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.hcell { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 5px; font-size: 12px; font-weight: 700; }
.hcell--ok { background: var(--ok-tint); color: var(--ok-ink); }
.hcell--rejected { background: #FEF9C3; color: #854D0E; }
.hcell--info { background: var(--teal-tint); color: var(--teal-dark); }
.hcell--remarks { background: var(--st-remarks-tint); color: var(--st-remarks); }
.hcell--holiday { background: #EDE9FE; color: #5B21B6; }
.holiday-table { border-collapse: collapse; font-size: 13px; }
.holiday-table th, .holiday-table td { border-top: 1px solid var(--line-soft); padding: 4px 2px; text-align: center; min-width: 26px; font-variant-numeric: tabular-nums; }
.holiday-table thead th { color: var(--muted); font-weight: 600; vertical-align: top; }
.holiday-table__week { display: block; font-size: 10px; color: var(--teal); }
.holiday-table__name { text-align: left !important; padding: 4px 12px 4px 20px !important; white-space: nowrap; position: sticky; left: 0; background: var(--surface); font-weight: 600; }
.holiday-table .is-weekend { background: #F3F5F6; }
.absence summary { cursor: pointer; }
.absence__label { font-weight: 600; }
.absence__days { margin: 8px 0 0; padding-left: 20px; font-size: 14px; columns: 3 160px; }
@media (max-width: 1023px) { .alarm-log__body { padding-left: 20px; } }
