﻿.test-custom {
    border: 5px solid red;
}

/* Column resize handle used by resizableTable.js */
.resizer {
    position: absolute;
    top: 0;
    right: 0;
    width: 5px;
    height: 100%;
    cursor: col-resize;
    user-select: none;
    /* A touch drag on the handle resizes the column; it must not scroll the page. */
    touch-action: none;
    z-index: 5;
}

.resizer:hover,
.resizer.resizing {
    border-right: 2px solid #aba8a6;
}

h1:focus {
    outline: none;
}

/* Use the application's palette even when the OS prefers a different theme.
   Override on the menu itself because the library declares its tokens there. */
:root .mhd-context-menu {
    --mhd-context-menu-bg: var(--pm-color-surface);
    --mhd-context-menu-border: var(--pm-color-border);
    --mhd-context-menu-color: var(--pm-color-text);
    --mhd-context-menu-hover-bg: var(--pm-color-surface-muted);
    --mhd-context-menu-separator: var(--pm-color-border);
}

/* Mouse and keyboard focus must keep the same highlight after pointer leave. */
.mhd-context-menu .mhd-context-menu-item:hover,
.mhd-context-menu .mhd-context-menu-item--focused {
    background-color: var(--mhd-context-menu-hover-bg);
}

/* Package 43, §04: the browser's text selection belongs to TEXT, not to controls. Ctrl/Cmd+A - in
   Safari also from an empty text area, which hands select-all to the whole document - painted the
   topbar, the tabs, every button and label, the dialog titles and the context menus blue. What is a
   control or a label of one is taken out of the selection here: the topbar, the tab strip, dialog
   chrome (title, footer, minimized bar), context menus, buttons and the menu/tab/option roles,
   labels and table headers, icons and images. Body text and values stay selectable, so a user can
   still copy an address or a note out of a form.

   Nothing here blocks the key itself: Ctrl/Cmd+A is the browser's, and in a field it selects the
   field. The rule after this one makes sure of that, whatever container a field sits in - the
   used value of user-select is passed down from the parent unless the element says otherwise,
   and a field inside a `none` container would otherwise be a field the user cannot select in. */
.pm-topbar,
.mhd-tabs-horizontal-bar,
.mhd-dialog-title-wrap,
.mhd-dialog-footer,
.mhd-dialog-minimized-bar,
.mhd-context-menu,
button,
[role="button"],
[role="menuitem"],
[role="menuitemcheckbox"],
[role="menuitemradio"],
[role="tab"],
[role="option"],
summary,
label,
legend,
th,
svg,
img {
    user-select: none;
}

input,
textarea,
[contenteditable]:not([contenteditable="false"]) {
    user-select: text;
}

/* The shared validation standard:
   - NO green border on valid fields (the former `.valid.modified` rule has been removed).
   - `.required-empty` no longer gives a red border merely because a freshly opened required field is
     empty (opening a form is not an error). A red border shows only for `.invalid`, that is once
     validation has actually run on blur or on a save attempt, in line with the PmField standard. */
input.invalid:not([type=checkbox]),
select.invalid,
textarea.invalid {
    border-color: #e50000 !important;
    outline: 1px solid #e50000;
    outline-offset: 0;
    box-shadow: 0 0 0 1px rgba(229, 0, 0, 0.12);
}

input.invalid:focus:not([type=checkbox]),
select.invalid:focus,
textarea.invalid:focus {
    border-color: #e50000 !important;
    outline: 1px solid #e50000;
    box-shadow: 0 0 0 2px rgba(229, 0, 0, 0.2);
}

.validation-message {
    color: #e50000;
}

/* §7 (self-inspection and others): a changed but valid field must NEVER get a green border. Blazor's
   built-in `.valid.modified` paints a green outline as soon as a value changes, and it is neutralised
   here. Only focus (the blue border from pm-input :focus-visible) and errors (the red `.invalid` rule
   above) alter the border. `:not(:focus)` preserves any focus outline on fields with no focus style
   of their own. */
.valid.modified:not(:focus):not([type=checkbox]) {
    outline: none;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/*Additional*/
@-webkit-keyframes spin {
    0% {
        -webkit-transform: rotate(0deg);
    }

    100% {
        -webkit-transform: rotate(360deg);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

:root {
    --pm-scrollbar-size: 9px;
    --pm-scrollbar-track: rgba(148, 163, 184, 0.14);
    --pm-scrollbar-thumb: rgba(100, 116, 139, 0.78);
    --pm-scrollbar-thumb-hover: rgba(129, 140, 248, 0.82);
    --pm-scrollbar-thumb-active: rgba(165, 180, 252, 0.92);
}

html.dark {
    --pm-scrollbar-track: rgba(148, 163, 184, 0.12);
    --pm-scrollbar-thumb: rgba(148, 163, 184, 0.56);
    --pm-scrollbar-thumb-hover: rgba(129, 140, 248, 0.78);
    --pm-scrollbar-thumb-active: rgba(165, 180, 252, 0.9);
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--pm-scrollbar-thumb) var(--pm-scrollbar-track);
}

*::-webkit-scrollbar {
    width: var(--pm-scrollbar-size);
    height: var(--pm-scrollbar-size);
}

*::-webkit-scrollbar-track {
    background: var(--pm-scrollbar-track);
    border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
    background-color: var(--pm-scrollbar-thumb);
    border: 2px solid transparent;
    border-radius: 999px;
    background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
    background-color: var(--pm-scrollbar-thumb-hover);
}

*::-webkit-scrollbar-thumb:active {
    background-color: var(--pm-scrollbar-thumb-active);
}

*::-webkit-scrollbar-corner {
    background: transparent;
}
.pm-hover-tooltip {
    position: fixed;
    z-index: 2147483647;
    max-width: min(20rem, calc(100vw - 1rem));
    padding: 0.35rem 0.5rem;
    border-radius: 0.375rem;
    background: rgb(51 65 85 / 0.97);
    color: white;
    font-size: 0.6875rem;
    font-weight: 400;
    line-height: 1rem;
    text-align: left;
    /* pre-line preserves line breaks (\n) in grouped tooltips, the access column for example, while
       behaving like normal for single-line tooltips (no \n means no difference). */
    white-space: pre-line;
    overflow-wrap: anywhere;
    box-shadow: 0 4px 12px rgb(15 23 42 / 0.22);
    pointer-events: none;
}

.dark .pm-hover-tooltip {
    border: 1px solid rgb(71 85 105);
    background: rgb(15 23 42 / 0.98);
    color: rgb(226 232 240);
}

/* Drag-and-drop drop indicator: a single blue line across the WHOLE dragged-over row.
   Painted as an inset box-shadow on every cell (including sticky/frozen left columns) so the
   line is continuous from the frozen part to the scrollable part and never breaks at the sticky
   boundary. Using a shadow (not a border) avoids any 2px layout shift while dragging. */
tr.pm-drop-row > td {
    box-shadow: inset 0 2px 0 0 #0ea5e9; /* sky-500 */
}

.dark tr.pm-drop-row > td {
    box-shadow: inset 0 2px 0 0 #38bdf8; /* sky-400 - a little lighter for dark mode */
}

/* ── Package N06: "Prislistor" ───────────────────────────────────────────────────────────────
   Global (not scoped) because the tab, its panels and its dialogs share the classes and the
   dialogs render in the modal portal. Dense like the Nettokalkyl: numbers right-aligned in
   tabular figures, a sticky header, the hierarchy by indent and weight, colour never alone. */
.price-lists .pl-select { max-width: 28rem; }

.pl-empty {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
    padding: 3rem 1rem;
    border: 1px dashed rgb(203 213 225);
    border-radius: 0.5rem;
    text-align: center;
}

.pl-impact {
    display: inline-flex;
    align-items: center;
    padding: 0 0.5rem;
    border-radius: 9999px;
    border: 1px solid rgb(203 213 225);
    font-size: 0.75rem;
    line-height: 1.25rem;
    color: rgb(51 65 85);
    background: rgb(248 250 252);
}
.pl-impact-eval { border-color: rgb(125 211 252); color: rgb(3 105 161); background: rgb(240 249 255); }
.pl-impact-bid { border-color: rgb(134 239 172); color: rgb(21 128 61); background: rgb(240 253 244); }
.dark .pl-impact { border-color: rgb(71 85 105); color: rgb(226 232 240); background: rgb(30 41 59); }
.dark .pl-impact-eval { border-color: rgb(3 105 161); color: rgb(125 211 252); }
.dark .pl-impact-bid { border-color: rgb(21 128 61); color: rgb(134 239 172); }

.pl-warn { color: rgb(180 83 9); }
.dark .pl-warn { color: rgb(252 211 77); }
.pl-negative { color: rgb(180 83 9); font-weight: 500; }
.dark .pl-negative { color: rgb(252 211 77); }
.pl-muted { color: rgb(148 163 184); }
.pl-unpriced { color: rgb(180 83 9); font-style: italic; }
.dark .pl-unpriced { color: rgb(252 211 77); }
.pl-inherited { color: rgb(100 116 139); font-style: italic; }
.pl-derived { text-decoration: underline dotted; }
.pl-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.75rem; }
.pl-sep { width: 1px; height: 1rem; background: rgb(203 213 225); }

.pl-save { font-size: 0.75rem; color: rgb(100 116 139); min-width: 5rem; text-align: end; }
.pl-save-ok { color: rgb(21 128 61); }
.pl-save-error { color: rgb(185 28 28); font-weight: 600; }
.dark .pl-save-ok { color: rgb(134 239 172); }
.dark .pl-save-error { color: rgb(252 165 165); }

.pl-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0 0.5rem;
    border: 1px solid rgb(203 213 225);
    border-radius: 9999px;
    font-size: 0.75rem;
    line-height: 1.5rem;
    background: transparent;
    color: inherit;
    cursor: pointer;
}
.pl-chip-on { border-color: rgb(59 130 246); background: rgb(239 246 255); color: rgb(29 78 216); }
.pl-chip-inactive { border-style: dashed; color: rgb(148 163 184); text-decoration: line-through; }
.dark .pl-chip { border-color: rgb(71 85 105); }
.dark .pl-chip-on { border-color: rgb(96 165 250); background: rgb(30 58 138 / 0.4); color: rgb(191 219 254); }
.pl-chip-x { border: 0; background: transparent; cursor: pointer; font-size: 0.875rem; line-height: 1; color: inherit; }

.pl-seg {
    padding: 0 0.625rem;
    border: 1px solid rgb(203 213 225);
    font-size: 0.75rem;
    line-height: 1.625rem;
    background: transparent;
    color: inherit;
    cursor: pointer;
}
.pl-seg:first-child { border-start-start-radius: 0.375rem; border-end-start-radius: 0.375rem; }
.pl-seg:last-child { border-start-end-radius: 0.375rem; border-end-end-radius: 0.375rem; border-inline-start: 0; }
.pl-seg-on { background: rgb(239 246 255); color: rgb(29 78 216); border-color: rgb(59 130 246); }
.dark .pl-seg { border-color: rgb(71 85 105); }
.dark .pl-seg-on { background: rgb(30 58 138 / 0.4); color: rgb(191 219 254); border-color: rgb(96 165 250); }

.pl-panel {
    border: 1px solid rgb(226 232 240);
    border-radius: 0.5rem;
    padding: 0.5rem;
    font-size: 0.75rem;
    background: rgb(255 255 255);
}
.dark .pl-panel { border-color: rgb(51 65 85); background: rgb(15 23 42); }
.pl-enum-values { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; max-width: 40rem; }
.pl-check { display: inline-flex; align-items: center; gap: 0.375rem; cursor: pointer; }
.pl-column-list { list-style: none; margin: 0; padding: 0; columns: 2 16rem; }
.pl-column-item { display: flex; align-items: center; gap: 0.375rem; padding: 0.125rem 0.25rem; border-radius: 0.25rem; break-inside: avoid; }
.pl-column-item.is-dragging { opacity: 0.5; }
.pl-column-item:hover { background: rgb(241 245 249); }
.dark .pl-column-item:hover { background: rgb(30 41 59); }
.pl-drag { cursor: grab; color: rgb(148 163 184); }
.pl-mini {
    min-width: 1.5rem;
    height: 1.5rem;
    border: 1px solid rgb(203 213 225);
    border-radius: 0.25rem;
    background: transparent;
    color: inherit;
    font-size: 0.75rem;
    cursor: pointer;
}
.pl-mini:disabled { opacity: 0.4; cursor: default; }
.pl-danger { color: rgb(185 28 28); }
.dark .pl-danger { color: rgb(252 165 165); }
.pl-tag { display: inline-block; margin-inline-start: 0.375rem; padding: 0 0.375rem; border-radius: 0.25rem; font-size: 0.75rem; background: rgb(241 245 249); color: rgb(71 85 105); }
.dark .pl-tag { background: rgb(30 41 59); color: rgb(203 213 225); }

.pl-totals {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.5rem;
    align-items: baseline;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    font-variant-numeric: tabular-nums;
    background: rgb(248 250 252);
}
.dark .pl-totals { background: rgb(15 23 42); }

.pl-scroll { overflow: auto; max-height: calc(100vh - 16rem); border: 1px solid rgb(226 232 240); border-radius: 0.375rem; }
.dark .pl-scroll { border-color: rgb(51 65 85); }
.pl-table { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 0.8125rem; }
.pl-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: rgb(241 245 249);
    border-bottom: 1px solid rgb(203 213 225);
    font-size: 0.8125rem;
    font-weight: 600;
    color: rgb(30 41 59);
    text-align: start;
    padding: 0.25rem 0.5rem;
    white-space: nowrap;
}
.dark .pl-table thead th { background: rgb(30 41 59); border-color: rgb(71 85 105); color: rgb(226 232 240); }
.pl-table .pl-th { position: sticky; }
.pl-table th.pl-num, .pl-table td.pl-num { text-align: end; font-variant-numeric: tabular-nums; }
.pl-sort { display: inline-flex; align-items: center; gap: 0.25rem; border: 0; background: transparent; padding: 0; font: inherit; color: inherit; text-transform: inherit; cursor: pointer; }
.pl-sort-ind { color: rgb(37 99 235); font-weight: 700; }
.dark .pl-sort-ind { color: rgb(147 197 253); }
.pl-resize { position: absolute; inset-block: 0; inset-inline-end: -3px; width: 6px; cursor: col-resize; z-index: 3; }
.pl-resize:hover, .pl-resizing .pl-resize { background: rgb(59 130 246 / 0.35); }
.pl-table td { padding: 0.1875rem 0.5rem; border-bottom: 1px solid rgb(241 245 249); vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dark .pl-table td { border-color: rgb(30 41 59); }
.pl-row { cursor: default; }
.pl-row:hover > td { background: rgb(239 246 255 / 0.6); }
.dark .pl-row:hover > td { background: rgb(30 58 138 / 0.25); }
.pl-selected > td { background: rgb(219 234 254) !important; }
.dark .pl-selected > td { background: rgb(30 58 138 / 0.5) !important; }
.pl-section > td { background: rgb(248 250 252); font-weight: 600; }
.pl-section-top > td { background: rgb(241 245 249); }
.dark .pl-section > td { background: rgb(15 23 42); }
.dark .pl-section-top > td { background: rgb(30 41 59); }
.pl-section-code { color: rgb(71 85 105); margin-inline-end: 0.25rem; }
.pl-textrow > td { color: rgb(71 85 105); font-style: italic; white-space: normal; }
.dark .pl-textrow > td { color: rgb(148 163 184); }
.pl-context > td { opacity: 0.55; }
.pl-missing > td { text-decoration: line-through; text-decoration-color: rgb(180 83 9 / 0.6); }
.pl-variant > td { background: rgb(248 250 252 / 0.6); font-size: 0.75rem; }
.dark .pl-variant > td { background: rgb(15 23 42 / 0.6); }
.pl-inactive > td { opacity: 0.5; }
.pl-grand-total > td { position: sticky; bottom: 0; font-weight: 700; background: rgb(226 232 240); border-top: 2px solid rgb(148 163 184); }
.dark .pl-grand-total > td { background: rgb(51 65 85); }
.pl-selection-total > td { font-weight: 600; background: rgb(239 246 255); }
.dark .pl-selection-total > td { background: rgb(30 58 138 / 0.35); }
.pl-actions { position: relative; white-space: nowrap; }
.pl-fold, .pl-row-menu-btn, .pl-variants-toggle { border: 0; background: transparent; cursor: pointer; color: rgb(71 85 105); font-size: 0.8125rem; padding: 0 0.125rem; }
.dark .pl-fold, .dark .pl-row-menu-btn, .dark .pl-variants-toggle { color: rgb(203 213 225); }
.pl-variants-toggle { font-size: 0.75rem; margin-inline-start: 0.375rem; color: rgb(37 99 235); }
.pl-menu {
    position: absolute;
    inset-inline-start: 1.5rem;
    top: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    min-width: 12rem;
    padding: 0.25rem;
    border: 1px solid rgb(203 213 225);
    border-radius: 0.375rem;
    background: rgb(255 255 255);
    box-shadow: 0 8px 24px rgb(15 23 42 / 0.18);
}
.dark .pl-menu { background: rgb(15 23 42); border-color: rgb(71 85 105); }
.pl-menu button { text-align: start; padding: 0.25rem 0.5rem; border: 0; background: transparent; color: inherit; font-size: 0.8125rem; border-radius: 0.25rem; cursor: pointer; }
.pl-menu button:hover { background: rgb(241 245 249); }
.dark .pl-menu button:hover { background: rgb(30 41 59); }
.pl-menu .pl-menu-danger { color: rgb(185 28 28); }
.pl-in { width: 100%; min-width: 0; height: 1.625rem; padding: 0 0.375rem; font-size: 0.8125rem; }
.pl-in-num { text-align: end; }
.pl-in-code { width: 5.5rem; margin-inline-end: 0.375rem; }
.pl-in-wide { width: min(36rem, 100%); }
.pl-invalid { border-color: rgb(180 83 9); }
.pl-indent { display: inline-flex; align-items: center; gap: 0.25rem; max-width: 100%; }
.pl-name { overflow: hidden; text-overflow: ellipsis; }
.pl-badge { display: inline-block; padding: 0 0.375rem; border-radius: 0.25rem; font-size: 0.75rem; line-height: 1.125rem; background: rgb(241 245 249); color: rgb(51 65 85); white-space: nowrap; }
.pl-badge-warn { background: rgb(254 243 199); color: rgb(146 64 14); }
.pl-badge-info { background: rgb(219 234 254); color: rgb(30 64 175); }
.pl-badge-error { background: rgb(254 226 226); color: rgb(153 27 27); }
.pl-badge-derived { font-style: italic; }
.dark .pl-badge { background: rgb(30 41 59); color: rgb(226 232 240); }
.dark .pl-badge-warn { background: rgb(120 53 15 / 0.5); color: rgb(253 230 138); }
.dark .pl-badge-info { background: rgb(30 58 138 / 0.5); color: rgb(191 219 254); }
.dark .pl-badge-error { background: rgb(127 29 29 / 0.5); color: rgb(254 202 202); }

.pl-manage-table { width: 100%; font-size: 0.8125rem; border-collapse: collapse; }
.pl-manage-table th, .pl-manage-table td { padding: 0.25rem 0.375rem; border-bottom: 1px solid rgb(226 232 240); text-align: start; }
.dark .pl-manage-table th, .dark .pl-manage-table td { border-color: rgb(51 65 85); }
.pl-manage-table .pl-num { text-align: end; }
/* N058 §F2: a wide, calm table - full labels, an internal sideways scroll before any control is cut. */
.pl-manage-scroll { overflow-x: auto; }
.pl-manage-table { min-width: 52rem; }
.pl-manage-table th { white-space: nowrap; font-weight: 600; }
.pl-manage-code { width: 7rem; }
.pl-manage-name { min-width: 16rem; }
.pl-manage-totals { width: 12.5rem; }
.pl-manage-status { min-width: 13rem; }
.pl-confirm { margin-bottom: 0.5rem; padding: 0.5rem 0.75rem; border: 1px solid rgb(252 211 77); border-radius: 0.375rem; background: rgb(255 251 235); }
.dark .pl-confirm { border-color: rgb(180 83 9); background: rgb(69 26 3 / 0.5); }

.pl-import { display: flex; flex-direction: column; gap: 0.75rem; height: 100%; min-height: 0; }
.pl-import-table-wrap { flex: 1 1 auto; min-height: 12rem; }
.pl-import-summary { display: flex; flex-direction: column; gap: 0.25rem; }

/* N024: the import dialog - a drop zone that IS the file input, a sticky footer, and a preview
   that is a review (no inputs besides the choices). */
.pl-drop {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    min-width: 16rem;
    padding: 0.75rem 1.25rem;
    border: 1px dashed rgb(148 163 184);
    border-radius: 0.5rem;
    text-align: center;
    cursor: pointer;
}
.pl-drop:hover, .pl-drop:focus-within { border-color: rgb(59 130 246); background: rgb(239 246 255); }
.dark .pl-drop { border-color: rgb(71 85 105); }
.dark .pl-drop:hover, .dark .pl-drop:focus-within { border-color: rgb(96 165 250); background: rgb(30 58 138 / 0.3); }
.pl-drop-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.pl-drop-link { color: rgb(29 78 216); text-decoration: underline; }
.dark .pl-drop-link { color: rgb(147 197 253); }
.pl-import-footer {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-top: 1px solid rgb(226 232 240);
    background: rgb(255 255 255);
}
.dark .pl-import-footer { border-color: rgb(51 65 85); background: rgb(15 23 42); }
.pl-ok { color: rgb(21 128 61); }
.dark .pl-ok { color: rgb(134 239 172); }

/* N024 §4: "Kolumner" is a bounded popover under its button, never a panel across the page. */
.pl-popover-anchor { position: relative; }
.pl-popover {
    position: absolute;
    inset-inline-end: 0;
    top: calc(100% + 0.25rem);
    z-index: 30;
    display: flex;
    flex-direction: column;
    width: min(22rem, 90vw);
    max-height: min(32rem, 70vh);
    border: 1px solid rgb(226 232 240);
    border-radius: 0.5rem;
    background: rgb(255 255 255);
    box-shadow: 0 10px 25px -5px rgb(15 23 42 / 0.2);
    font-size: 0.75rem;
}
.dark .pl-popover { border-color: rgb(51 65 85); background: rgb(15 23 42); }
.pl-popover-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.5rem; border-bottom: 1px solid rgb(226 232 240); }
.dark .pl-popover-head { border-color: rgb(51 65 85); }
.pl-popover-body { overflow-y: auto; padding: 0.25rem 0.5rem 0.5rem; }
.pl-columns-popover .pl-column-list { columns: auto; }
.pl-column-group { border: 0; margin: 0.25rem 0 0; padding: 0; }
.pl-column-group-title { font-weight: 600; color: rgb(71 85 105); padding: 0.25rem 0.25rem 0.125rem; }
.dark .pl-column-group-title { color: rgb(203 213 225); }

/* The edit toggle when the mode is off: a compact pencil, like the Kostnadskalkyl's. */
.pl-icon-btn { min-width: 2rem; justify-content: center; }

/* A text row wraps inside "Benämning" instead of spanning the table (one geometry for all rows). */
.pl-table td.pl-wrap { white-space: normal; overflow: visible; }

.pl-editor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 0.5rem 0.75rem; align-items: end; }
.pl-editor-wide { grid-column: 1 / -1; }
.pl-editor-variants { font-size: 0.75rem; }
.pl-provenance { display: grid; grid-template-columns: max-content 1fr; gap: 0.125rem 0.75rem; margin-top: 0.25rem; }
.pl-provenance dt { color: rgb(100 116 139); }

.summary-price-lists { margin-top: 1rem; border: 1px solid rgb(226 232 240); border-radius: 0.5rem; padding: 0.5rem; }
.dark .summary-price-lists { border-color: rgb(51 65 85); }

/* ── Package N07: the shared table shell - "Risker & möjligheter", "Offerter", "Prislistor" ──────
   ONE controlled scroll host per table, ONE table for header and body, ONE sticky header row.
   The tab root (pm-table-shell) fills the calculation page's content area as a flex column, so the
   scroll host takes exactly the height that is left (toolbar, cards and filters above it stay put)
   and the page itself never scrolls around it - no outer + inner scrollbar, no fixed max-height.
   A header cell is sticky to the top of the host; horizontal scrolling moves header and body
   together because they are the same table. A frozen identifier column (pm-sticky-left) sticks to
   the start edge with a solid background; its header cell sits above both (z-index 4 > 3 > 2). */
.pm-table-shell {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
}

.pm-table-scroll {
    flex: 1 1 auto;
    min-height: 14rem;
    min-width: 0;
    overflow: auto;
    border: 1px solid rgb(226 232 240);
    border-radius: 0.375rem;
    background: rgb(255 255 255);
    --pm-grid-head-bg: rgb(241 245 249);
    --pm-grid-row-bg: rgb(255 255 255);
    --pm-grid-line: rgb(203 213 225);
}
.dark .pm-table-scroll {
    border-color: rgb(51 65 85);
    background: rgb(2 6 23);
    --pm-grid-head-bg: rgb(30 41 59);
    --pm-grid-row-bg: rgb(2 6 23);
    --pm-grid-line: rgb(71 85 105);
}
.pm-table-scroll:focus-visible { outline: 2px solid rgb(59 130 246); outline-offset: 1px; }

.pm-data-table { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 0.8125rem; }
.pm-data-table > thead > tr > th,
.pm-sticky-head > thead > tr > th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: var(--pm-grid-head-bg);
    box-shadow: inset 0 -1px 0 var(--pm-grid-line), 0 1px 2px rgb(15 23 42 / 0.06);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgb(51 65 85);
}
.pm-data-table > thead > tr > th {
    text-align: start;
    padding: 0.3125rem 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dark .pm-data-table > thead > tr > th,
.dark .pm-sticky-head > thead > tr > th { color: rgb(226 232 240); }
.pm-data-table > tbody > tr > td { padding: 0.25rem 0.5rem; border-bottom: 1px solid rgb(241 245 249); vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: var(--pm-grid-row-bg); }
.dark .pm-data-table > tbody > tr > td { border-color: rgb(30 41 59); }
.pm-data-table .pm-num { text-align: end; font-variant-numeric: tabular-nums; }
.pm-data-table .pm-sticky-left { position: sticky; z-index: 2; }
.pm-data-table > thead > tr > th.pm-sticky-left { z-index: 4; }
.pm-data-table .pm-sticky-edge { box-shadow: inset -1px 0 0 var(--pm-grid-line), 6px 0 6px -6px rgb(15 23 42 / 0.25); }
.pm-data-table > thead > tr > th.pm-sticky-edge { box-shadow: inset 0 -1px 0 var(--pm-grid-line), inset -1px 0 0 var(--pm-grid-line), 6px 0 6px -6px rgb(15 23 42 / 0.25); }
[dir="rtl"] .pm-data-table .pm-sticky-edge { box-shadow: inset 1px 0 0 var(--pm-grid-line), -6px 0 6px -6px rgb(15 23 42 / 0.25); }
.pm-sort { display: inline-flex; align-items: center; gap: 0.25rem; max-width: 100%; border: 0; background: transparent; padding: 0; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; }
.pm-sort > span:first-child { overflow: hidden; text-overflow: ellipsis; }
.pm-sort:focus-visible { outline: 2px solid rgb(59 130 246); outline-offset: 2px; border-radius: 2px; }
.pm-sort-ind { color: rgb(37 99 235); font-weight: 700; }
.dark .pm-sort-ind { color: rgb(147 197 253); }

/* The offers views keep their own dense layout (package N05b markup) and take only the sticky
   header (pm-sticky-head) inside the same shell and scroll host. */
.pm-sticky-head .pm-sticky-left { position: sticky; inset-inline-start: 0; z-index: 2; background: var(--pm-grid-row-bg); }
.pm-sticky-head > thead > tr > th.pm-sticky-left { z-index: 4; background: var(--pm-grid-head-bg); }
.pm-sticky-head .pm-sticky-edge { box-shadow: inset -1px 0 0 var(--pm-grid-line), 6px 0 6px -6px rgb(15 23 42 / 0.25); }
.pm-sticky-head > thead > tr > th.pm-sticky-edge { box-shadow: inset 0 -1px 0 var(--pm-grid-line), inset -1px 0 0 var(--pm-grid-line), 6px 0 6px -6px rgb(15 23 42 / 0.25); }
.offers-blocks { display: flex; flex-direction: column; gap: 0.5rem; }
.offers-blocks > * + * { margin-top: 0.25rem; }

/* ── Package N07: "Risker & möjligheter" ─────────────────────────────────────────────────────── */
.risk-register { padding: 0.25rem; gap: 0.375rem; }
/* N072 G1: "Risker & möjligheter" - the combined page scrolls as a whole; each section keeps the N071 table shell with a
   bounded table height, so two registers never fight over one flexible height. */
.rk-combined { display: flex; flex-direction: column; gap: 0.5rem; height: 100%; min-height: 0; overflow-y: auto; padding: 0.25rem; }
.rk-section { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.rk-section-title { font-size: 0.875rem; font-weight: 700; margin: 0.25rem 0 0; }
.risk-register.is-embedded { height: auto; padding: 0; }
.risk-register.is-embedded .pm-table-scroll { flex: 0 1 auto; max-height: 24rem; }
.rk-layout { display: flex; gap: 0.5rem; flex: 1 1 auto; min-height: 0; min-width: 0; }
.rk-main { display: flex; flex-direction: column; gap: 0.375rem; flex: 1 1 auto; min-width: 0; min-height: 0; }

.rk-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: 0.375rem; }
.rk-card { display: flex; flex-direction: column; gap: 0.125rem; padding: 0.375rem 0.625rem; border: 1px solid rgb(226 232 240); border-radius: 0.5rem; background: rgb(248 250 252); }
.dark .rk-card { border-color: rgb(51 65 85); background: rgb(15 23 42); }
.rk-card-label { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: rgb(100 116 139); }
.dark .rk-card-label { color: rgb(148 163 184); }
.rk-card-value { font-size: 1.125rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.rk-card-text { font-size: 0.875rem; font-weight: 600; }
.rk-card-warn { font-size: 0.75rem; color: rgb(180 83 9); }
.dark .rk-card-warn { color: rgb(252 211 77); }
.rk-text-high { color: rgb(194 65 12); }
.dark .rk-text-high { color: rgb(253 186 116); }
.rk-money-neg { color: rgb(185 28 28); }
.rk-money-pos { color: rgb(21 128 61); }
.dark .rk-money-neg { color: rgb(252 165 165); }
.dark .rk-money-pos { color: rgb(134 239 172); }

.rk-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem; }
.rk-search { width: 14rem; max-width: 100%; }
.rk-spacer { flex: 1 1 auto; }
.rk-quick { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.rk-filtered { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1.25rem; padding: 0.25rem 0.5rem; border-radius: 0.375rem; font-size: 0.8125rem; font-variant-numeric: tabular-nums; background: rgb(239 246 255); }
.dark .rk-filtered { background: rgb(30 58 138 / 0.3); }
.rk-filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 0.5rem 1rem; }
.rk-filter-group { display: flex; flex-direction: column; gap: 0.125rem; }
.rk-range { display: flex; align-items: center; gap: 0.25rem; margin-top: 0.375rem; }
.rk-num { width: 5.5rem; text-align: end; }
.rk-num-wide { width: 9rem; }

/* N071 D1/D3/D5: "Filtrera" and "Kolumner" are overlays anchored under the toolbar - the register never moves below them. */
.rk-toolbar-anchor { position: relative; }
.rk-overlay {
    position: absolute;
    top: calc(100% + 0.25rem);
    left: 0;
    z-index: 40;
    width: min(42rem, 100%);
    max-height: min(70vh, 34rem);
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 25px rgb(15 23 42 / 0.18);
}
.rk-overlay.rk-columns-panel { width: min(30rem, 100%); }
.rk-overlay-backdrop { position: fixed; inset: 0; z-index: 39; background: transparent; }
.rk-overlay-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding-bottom: 0.375rem; border-bottom: 1px solid rgb(226 232 240); }
.dark .rk-overlay-head { border-color: rgb(51 65 85); }
.rk-overlay-body { display: flex; flex-direction: column; gap: 0.5rem; padding-top: 0.5rem; overflow: auto; min-height: 0; }
.rk-filter-section { display: flex; flex-direction: column; gap: 0.25rem; }
.rk-filter-fold > summary { cursor: pointer; font-weight: 600; padding: 0.125rem 0; }
.rk-filter-options { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; max-height: 12rem; overflow: auto; padding: 0.125rem 0; }
.rk-filter-search { width: 16rem; max-width: 100%; margin: 0.25rem 0; }
.rk-column-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.125rem; }
.rk-column-list .pl-column-item:focus-visible { outline: 2px solid rgb(59 130 246); outline-offset: 1px; }
.rk-column-add { display: flex; flex-direction: column; gap: 0.25rem; border-top: 1px solid rgb(226 232 240); padding-top: 0.375rem; }
.dark .rk-column-add { border-color: rgb(51 65 85); }
@media (max-width: 640px) {
    .rk-overlay, .rk-overlay.rk-columns-panel { position: fixed; top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: 80vh; border-radius: 0.75rem 0.75rem 0 0; }
}

.rk-table .rk-row { cursor: default; }
.rk-table .rk-row:hover > td { background: rgb(245 249 255); }
.dark .rk-table .rk-row:hover > td { background: rgb(23 37 84); }
.rk-table .rk-row.is-selected > td { background: rgb(219 234 254); }
.dark .rk-table .rk-row.is-selected > td { background: rgb(30 58 138); }
.rk-table .rk-row:focus-visible { outline: 2px solid rgb(59 130 246); outline-offset: -2px; }
.rk-table .rk-row.is-closed > td { color: rgb(148 163 184); }
.rk-table .rk-empty-row > td { padding: 1.5rem 0.5rem; text-align: center; color: rgb(100 116 139); white-space: normal; }
.rk-cell-event .rk-event { font-weight: 500; }
.rk-cell-event .pl-badge { margin-inline-start: 0.375rem; }
.rk-id { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.75rem; color: rgb(71 85 105); }
.rk-type { display: inline-block; padding: 0 0.5rem; border-radius: 9999px; font-size: 0.75rem; line-height: 1.25rem; font-weight: 600; }
.rk-type-risk { background: rgb(255 228 230); color: rgb(159 18 57); }
.rk-type-opp { background: rgb(220 252 231); color: rgb(22 101 52); }
.dark .rk-type-risk { background: rgb(136 19 55 / 0.45); color: rgb(254 205 211); }
.dark .rk-type-opp { background: rgb(20 83 45 / 0.5); color: rgb(187 247 208); }
.rk-tags { display: inline-flex; gap: 0.25rem; max-width: 100%; overflow: hidden; }
.rk-tag { display: inline-block; padding: 0 0.375rem; border-radius: 0.25rem; font-size: 0.75rem; line-height: 1.125rem; white-space: nowrap; background: rgb(241 245 249); color: rgb(51 65 85); border: 1px solid rgb(226 232 240); }
.dark .rk-tag { background: rgb(30 41 59); color: rgb(226 232 240); border-color: rgb(51 65 85); }
.rk-tag-more { font-weight: 600; }
.rk-status { font-size: 0.75rem; }
.rk-status-actionrequired { color: rgb(180 83 9); font-weight: 600; }
.rk-status-occurred { color: rgb(185 28 28); font-weight: 600; }
.dark .rk-status-actionrequired { color: rgb(252 211 77); }
.dark .rk-status-occurred { color: rgb(252 165 165); }

/* The level: colour AND word, never colour alone. */
.rk-level { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0 0.5rem; border-radius: 9999px; font-size: 0.75rem; line-height: 1.375rem; border: 1px solid transparent; }
.rk-level-score { font-weight: 700; font-variant-numeric: tabular-nums; }
.rk-level-low { background: rgb(220 252 231); color: rgb(22 101 52); border-color: rgb(134 239 172); }
.rk-level-moderate { background: rgb(254 249 195); color: rgb(113 63 18); border-color: rgb(253 224 71); }
.rk-level-high { background: rgb(255 237 213); color: rgb(154 52 18); border-color: rgb(253 186 116); }
.rk-level-veryhigh { background: rgb(254 226 226); color: rgb(153 27 27); border-color: rgb(252 165 165); }
.rk-level-none { background: rgb(241 245 249); color: rgb(71 85 105); }
.dark .rk-level-low { background: rgb(20 83 45 / 0.5); color: rgb(187 247 208); border-color: rgb(21 128 61); }
.dark .rk-level-moderate { background: rgb(113 63 18 / 0.5); color: rgb(254 240 138); border-color: rgb(161 98 7); }
.dark .rk-level-high { background: rgb(124 45 18 / 0.5); color: rgb(254 215 170); border-color: rgb(194 65 12); }
.dark .rk-level-veryhigh { background: rgb(127 29 29 / 0.55); color: rgb(254 202 202); border-color: rgb(185 28 28); }
.dark .rk-level-none { background: rgb(30 41 59); color: rgb(203 213 225); }
.rk-level-opp { border-style: dashed; }

/* The right edit panel (Package 76 look; the register hosts it beside its own table). */
.rk-panel { display: flex; flex-direction: column; flex: 0 0 min(30rem, 46%); min-width: 22rem; min-height: 0; border: 1px solid rgb(226 232 240); border-radius: 0.5rem; background: rgb(255 255 255); color: rgb(15 23 42); font-size: 13px; outline: none; }
.dark .rk-panel { background: rgb(15 23 42); color: rgb(226 232 240); border-color: rgb(51 65 85); }
/* N060: the deal's risk panel fills its side drawer (a column) instead of taking a share of a row. */
.rk-panel.rk-panel-fill { flex: 1 1 auto; min-width: 0; border: 0; border-radius: 0; }
.rk-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; padding: 0.5rem 0.625rem 0.375rem 0.75rem; border-bottom: 1px solid rgb(226 232 240); }
.dark .rk-panel-head { border-color: rgb(51 65 85); }
.rk-panel-head-text { min-width: 0; }
.rk-panel-kind { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: rgb(100 116 139); }
.rk-panel-title { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-panel-close { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border: 0; border-radius: 6px; background: transparent; color: inherit; font-size: 18px; cursor: pointer; }
.rk-panel-close:hover { background: rgb(241 245 249); }
.dark .rk-panel-close:hover { background: rgb(30 41 59); }
.rk-panel-prompt { display: flex; flex-direction: column; gap: 0.375rem; padding: 0.5rem 0.75rem; border-bottom: 1px solid rgb(252 211 77); background: rgb(255 251 235); }
.dark .rk-panel-prompt { background: rgb(69 26 3 / 0.5); border-color: rgb(180 83 9); }
.rk-panel-prompt-actions { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.rk-panel-tabs { display: flex; flex-wrap: wrap; gap: 0.125rem; padding: 0.25rem 0.5rem 0; border-bottom: 1px solid rgb(226 232 240); }
.dark .rk-panel-tabs { border-color: rgb(51 65 85); }
.rk-panel-tab { border: 0; border-bottom: 2px solid transparent; background: transparent; color: rgb(71 85 105); padding: 0.25rem 0.5rem; font-size: 0.8125rem; cursor: pointer; }
.rk-panel-tab[aria-selected="true"] { color: rgb(29 78 216); border-bottom-color: rgb(59 130 246); font-weight: 600; }
.dark .rk-panel-tab { color: rgb(203 213 225); }
.dark .rk-panel-tab[aria-selected="true"] { color: rgb(147 197 253); border-bottom-color: rgb(96 165 250); }
.rk-panel-body { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 0.5rem 0.75rem; display: flex; flex-direction: column; gap: 0.5rem; }
.rk-panel-body.is-held { opacity: 0.55; }
.rk-panel-foot { display: flex; align-items: center; gap: 0.375rem; padding: 0.375rem 0.75rem; border-top: 1px solid rgb(226 232 240); }
.dark .rk-panel-foot { border-color: rgb(51 65 85); }
.rk-panel-state { font-size: 0.75rem; color: rgb(100 116 139); }
.rk-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.rk-section { display: flex; flex-direction: column; gap: 0.5rem; }
.rk-field { display: flex; flex-direction: column; gap: 0.1875rem; min-width: 0; }
.rk-inline { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 0.375rem; }
.rk-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 0.5rem 0.75rem; }
.rk-textarea { min-height: 2.75rem; resize: vertical; }
.rk-hint { font-size: 0.75rem; color: rgb(100 116 139); margin: 0; }
.dark .rk-hint { color: rgb(148 163 184); }
.rk-unit { font-size: 0.75rem; color: rgb(100 116 139); }
.rk-caption { display: block; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: rgb(100 116 139); }
.rk-errors { margin: 0; padding-inline-start: 1rem; }
.rk-review { display: flex; flex-direction: column; gap: 0.25rem; }
.rk-toggle { display: inline-flex; align-items: center; gap: 0.375rem; cursor: pointer; }

.rk-seg { display: inline-flex; }
.rk-seg-btn { padding: 0 0.75rem; line-height: 1.75rem; border: 1px solid rgb(203 213 225); background: transparent; color: inherit; cursor: pointer; font-size: 0.8125rem; }
.rk-seg-btn:first-child { border-start-start-radius: 0.375rem; border-end-start-radius: 0.375rem; }
.rk-seg-btn:last-child { border-start-end-radius: 0.375rem; border-end-end-radius: 0.375rem; border-inline-start: 0; }
.rk-seg-btn.is-on.rk-seg-risk { background: rgb(255 228 230); color: rgb(159 18 57); border-color: rgb(253 164 175); font-weight: 600; }
.rk-seg-btn.is-on.rk-seg-opp { background: rgb(220 252 231); color: rgb(22 101 52); border-color: rgb(134 239 172); font-weight: 600; }
.dark .rk-seg-btn { border-color: rgb(71 85 105); }
.dark .rk-seg-btn.is-on.rk-seg-risk { background: rgb(136 19 55 / 0.45); color: rgb(254 205 211); }
.dark .rk-seg-btn.is-on.rk-seg-opp { background: rgb(20 83 45 / 0.5); color: rgb(187 247 208); }

.rk-scale { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.25rem; }
.rk-scale-compact { grid-template-columns: repeat(5, 2rem); }
.rk-scale-btn { display: flex; flex-direction: column; align-items: center; gap: 0; padding: 0.1875rem 0.125rem; border: 1px solid rgb(203 213 225); border-radius: 0.375rem; background: transparent; color: inherit; cursor: pointer; min-width: 0; }
.rk-scale-btn.is-on { border-color: rgb(59 130 246); background: rgb(239 246 255); color: rgb(29 78 216); }
.dark .rk-scale-btn { border-color: rgb(71 85 105); }
.dark .rk-scale-btn.is-on { background: rgb(30 58 138 / 0.45); color: rgb(191 219 254); border-color: rgb(96 165 250); }
.rk-scale-num { font-weight: 700; font-variant-numeric: tabular-nums; }
.rk-scale-word { font-size: 0.75rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-result { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; padding: 0.375rem 0.5rem; border-radius: 0.375rem; background: rgb(248 250 252); }
.dark .rk-result { background: rgb(30 41 59); }
.rk-matrix { border-collapse: separate; border-spacing: 2px; font-size: 0.75rem; align-self: flex-start; }
.rk-matrix th { width: 1.5rem; color: rgb(100 116 139); font-weight: 600; text-align: center; }
.rk-matrix-cell { width: 2rem; height: 1.25rem; border-radius: 0.1875rem; text-align: center; }
.rk-matrix-cell.is-here { outline: 2px solid rgb(15 23 42); outline-offset: -1px; font-weight: 700; }
.dark .rk-matrix-cell.is-here { outline-color: rgb(248 250 252); }
.rk-areas { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.375rem; }
.rk-area-group { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem; }
.rk-area-group-title { flex-basis: 100%; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: rgb(100 116 139); }
.rk-area { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0 0.5rem; border: 1px solid rgb(203 213 225); border-radius: 9999px; font-size: 0.75rem; line-height: 1.5rem; cursor: pointer; }
.rk-area input { margin: 0; }
.rk-area.is-on { border-color: rgb(59 130 246); background: rgb(239 246 255); color: rgb(29 78 216); }
.dark .rk-area { border-color: rgb(71 85 105); }
.dark .rk-area.is-on { background: rgb(30 58 138 / 0.45); color: rgb(191 219 254); border-color: rgb(96 165 250); }
.rk-scenario { border-collapse: collapse; font-size: 0.8125rem; }
.rk-scenario th, .rk-scenario td { padding: 0.125rem 0.375rem; text-align: start; }
.rk-scenario .pm-num { text-align: end; font-variant-numeric: tabular-nums; }
.rk-action { display: flex; flex-direction: column; gap: 0.375rem; padding: 0.5rem; border: 1px solid rgb(226 232 240); border-radius: 0.375rem; }
.rk-action.is-overdue { border-color: rgb(252 211 77); }
.dark .rk-action { border-color: rgb(51 65 85); }
.rk-action-head { display: flex; align-items: center; gap: 0.25rem; }
.rk-action-no { font-weight: 700; font-variant-numeric: tabular-nums; }
.rk-before-after { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.rk-reviewed { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; font-size: 0.8125rem; }
.rk-occurred { display: flex; flex-direction: column; gap: 0.375rem; padding: 0.5rem; border-radius: 0.375rem; background: rgb(254 242 242); }
.dark .rk-occurred { background: rgb(127 29 29 / 0.3); }
.rk-links { margin: 0; padding-inline-start: 1rem; font-size: 0.8125rem; }

/* Narrow: the panel takes the place of the table rather than squeezing it to nothing. */
@media (max-width: 1100px) {
    .rk-layout { flex-direction: column; }
    .rk-panel { flex: 0 0 auto; min-width: 0; max-height: 60vh; }
}

.summary-risks { margin-top: 1rem; border: 1px solid rgb(226 232 240); border-radius: 0.5rem; padding: 0.5rem; }
.dark .summary-risks { border-color: rgb(51 65 85); }
.summary-risk-counts { display: grid; grid-template-columns: max-content auto; gap: 0.125rem 1.5rem; font-size: 0.875rem; margin-bottom: 0.375rem; }
.summary-risk-table th { font-weight: 600; }

/* "Prislistor" in the same shell (package N07): the list's scroll host fills what is left of the
   tab instead of a fixed viewport sum, and "KOD" / "BENÄMNING" stay at the start edge while they
   lead the column order. A sticky cell needs a SOLID background: the translucent row states of the
   list get their opaque equivalents here. */
.price-lists.pm-table-shell > .pl-scroll { flex: 1 1 auto; min-height: 14rem; max-height: none; }
.pl-table .pm-sticky-left { position: sticky; z-index: 2; background: rgb(255 255 255); }
.pl-table thead th.pm-sticky-left { z-index: 4; background: rgb(241 245 249); }
/* N058 §B2: the frozen edge is a discreet 1 px separator - no drop shadow that splits the table in two. */
.pl-table .pm-sticky-edge { box-shadow: inset -1px 0 0 rgb(226 232 240); }
.pl-table thead th.pm-sticky-edge { box-shadow: inset 0 -1px 0 rgb(203 213 225), inset -1px 0 0 rgb(226 232 240); }
.pl-row:hover > td.pm-sticky-left { background: rgb(245 249 255); }
.pl-selected > td.pm-sticky-left { background: rgb(219 234 254) !important; }
.pl-section > td.pm-sticky-left { background: rgb(248 250 252); }
.pl-section-top > td.pm-sticky-left { background: rgb(241 245 249); }
.pl-variant > td.pm-sticky-left { background: rgb(250 251 253); }
.pl-grand-total > td.pm-sticky-left { background: rgb(226 232 240); z-index: 3; }
.pl-selection-total > td.pm-sticky-left { background: rgb(239 246 255); }
.pl-span .pl-indent { position: sticky; inset-inline-start: var(--pl-frozen-start, 0px); }
.dark .pl-table .pm-sticky-left { background: rgb(2 6 23); }
.dark .pl-table thead th.pm-sticky-left { background: rgb(30 41 59); }
.dark .pl-row:hover > td.pm-sticky-left { background: rgb(23 37 84); }
.dark .pl-selected > td.pm-sticky-left { background: rgb(30 58 138) !important; }
.dark .pl-section > td.pm-sticky-left, .dark .pl-group-total > td.pm-sticky-left, .dark .pl-variant > td.pm-sticky-left { background: rgb(15 23 42); }
.dark .pl-section-top > td.pm-sticky-left { background: rgb(30 41 59); }
.dark .pl-grand-total > td.pm-sticky-left { background: rgb(51 65 85); }
.dark .pl-selection-total > td.pm-sticky-left { background: rgb(30 58 138); }
.dark .pl-table .pm-sticky-edge { box-shadow: inset -1px 0 0 rgb(51 65 85); }
.dark .pl-table thead th.pm-sticky-edge { box-shadow: inset 0 -1px 0 rgb(71 85 105), inset -1px 0 0 rgb(51 65 85); }

/* ── Package N08: "Analys" ─────────────────────────────────────────────────────────────────
   The analysis tab: one toolbar, the section strip, the figure cards and ONE card grid. The grid
   is a size container: "Automatisk" gives 1 column when narrow, 2 on a normal desktop, 3–4 on a
   large one; a fixed 1–4 is honoured down to the width where a card would be unreadable, and a
   card's span (S/M/L) never exceeds the columns there are. Colours of the charts come from the
   analysis palette, never from here. */
.an-shell { container-type: inline-size; display: flex; flex-direction: column; gap: 0.5rem; padding: 0.25rem 0.5rem 1rem; min-height: 0; height: 100%; overflow: auto; }
.an-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; }
.an-sections { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.an-section { padding: 0.25rem 0.625rem; border: 1px solid rgb(203 213 225); border-radius: 9999px; font-size: 0.8125rem; color: rgb(51 65 85); background: rgb(255 255 255); }
.an-section:hover { border-color: rgb(96 165 250); }
.an-section.is-on { background: rgb(239 246 255); border-color: rgb(59 130 246); color: rgb(29 78 216); font-weight: 600; }
.dark .an-section { border-color: rgb(71 85 105); color: rgb(203 213 225); background: rgb(15 23 42); }
.dark .an-section.is-on { background: rgb(30 58 138 / 0.4); border-color: rgb(96 165 250); color: rgb(191 219 254); }
.an-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.an-control { display: inline-flex; align-items: center; gap: 0.375rem; font-size: 0.75rem; color: rgb(100 116 139); }
.an-control .pm-select { width: auto; min-width: 7rem; }
.dark .an-control { color: rgb(148 163 184); }
.an-seg-group { display: inline-flex; }
.an-filter-chip { display: inline-flex; align-self: flex-start; align-items: center; gap: 0.5rem; padding: 0.25rem 0.625rem; border: 1px solid rgb(251 191 36); border-radius: 9999px; background: rgb(255 251 235); color: rgb(146 64 14); font-size: 0.8125rem; }
.dark .an-filter-chip { border-color: rgb(180 83 9); background: rgb(69 26 3 / 0.6); color: rgb(253 230 138); }
.an-chip-clear { text-decoration: underline; font-weight: 600; }
.an-notes, .an-card-notes { margin: 0; padding-inline-start: 1rem; list-style: disc; font-size: 0.75rem; color: rgb(100 116 139); }
.dark .an-notes, .dark .an-card-notes { color: rgb(148 163 184); }
.an-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); gap: 0.5rem; }
.an-kpi { display: flex; flex-direction: column; gap: 0.125rem; padding: 0.375rem 0.625rem; border: 1px solid rgb(226 232 240); border-inline-start: 4px solid var(--an-kpi, rgb(100 116 139)); border-radius: 0.5rem; background: rgb(248 250 252); }
.dark .an-kpi { border-color: rgb(51 65 85); border-inline-start-color: var(--an-kpi, rgb(148 163 184)); background: rgb(15 23 42); }
.an-kpi.is-warning { background: rgb(255 251 235); }
.dark .an-kpi.is-warning { background: rgb(69 26 3 / 0.5); }
.an-kpi-label { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; color: rgb(100 116 139); }
.dark .an-kpi-label { color: rgb(148 163 184); }
.an-kpi-value { font-size: 1.125rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.an-kpi-hint { font-size: 0.75rem; color: rgb(100 116 139); }
.dark .an-kpi-hint { color: rgb(148 163 184); }
.an-negative { color: rgb(180 83 9); }
.dark .an-negative { color: rgb(252 211 77); }
.an-grid { display: grid; grid-auto-flow: row dense; gap: 0.625rem; grid-template-columns: minmax(0, 1fr); }
.an-grid > .an-card { grid-column: auto; }
@container (min-width: 760px) {
    .an-grid[data-cols="auto"], .an-grid[data-cols="2"], .an-grid[data-cols="3"], .an-grid[data-cols="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .an-grid[data-cols="auto"] > .an-card, .an-grid[data-cols="2"] > .an-card, .an-grid[data-cols="3"] > .an-card, .an-grid[data-cols="4"] > .an-card { grid-column: span min(var(--an-span, 1), 2); }
}
@container (min-width: 1100px) {
    .an-grid[data-cols="3"], .an-grid[data-cols="4"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .an-grid[data-cols="3"] > .an-card, .an-grid[data-cols="4"] > .an-card { grid-column: span min(var(--an-span, 1), 3); }
}
@container (min-width: 1400px) {
    .an-grid[data-cols="auto"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .an-grid[data-cols="auto"] > .an-card { grid-column: span min(var(--an-span, 1), 3); }
    .an-grid[data-cols="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .an-grid[data-cols="4"] > .an-card { grid-column: span min(var(--an-span, 1), 4); }
}
@container (min-width: 1900px) {
    .an-grid[data-cols="auto"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .an-grid[data-cols="auto"] > .an-card { grid-column: span min(var(--an-span, 1), 4); }
}
.an-card { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; padding: 0.5rem 0.625rem; border: 1px solid rgb(226 232 240); border-radius: 0.5rem; background: rgb(255 255 255); box-shadow: 0 1px 2px rgb(15 23 42 / 0.05); }
.dark .an-card { border-color: rgb(51 65 85); background: rgb(15 23 42); }
.an-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; }
.an-card-titles { display: flex; flex-direction: column; min-width: 0; }
.an-card-title { margin: 0; font-size: 0.875rem; font-weight: 600; line-height: 1.25rem; }
.an-card-subtitle { font-size: 0.75rem; color: rgb(100 116 139); }
.dark .an-card-subtitle { color: rgb(148 163 184); }
.an-card-menu-wrap { position: relative; }
.an-card-menu-btn { width: 1.75rem; height: 1.75rem; border-radius: 0.375rem; font-size: 1rem; line-height: 1; color: rgb(71 85 105); }
.an-card-menu-btn:hover, .an-card-menu-btn:focus-visible { background: rgb(241 245 249); }
.dark .an-card-menu-btn { color: rgb(203 213 225); }
.dark .an-card-menu-btn:hover, .dark .an-card-menu-btn:focus-visible { background: rgb(30 41 59); }
.an-menu-backdrop { position: fixed; inset: 0; z-index: 30; }
.an-menu { position: absolute; inset-inline-end: 0; top: 100%; z-index: 31; display: flex; flex-direction: column; min-width: 13rem; padding: 0.25rem; border: 1px solid rgb(226 232 240); border-radius: 0.5rem; background: rgb(255 255 255); box-shadow: 0 10px 25px rgb(15 23 42 / 0.15); }
.dark .an-menu { border-color: rgb(51 65 85); background: rgb(15 23 42); }
.an-hidden-wrap { position: relative; }
.an-menu-heading { padding: 0.25rem 0.5rem 0.125rem; font-size: 0.75rem; font-weight: 600; color: rgb(100 116 139); text-transform: uppercase; letter-spacing: 0.03em; }
.an-menu-group { display: flex; flex-direction: column; }
.an-menu-item { padding: 0.3rem 0.5rem; border-radius: 0.25rem; text-align: start; font-size: 0.8125rem; }
.an-menu-item:hover:not(:disabled), .an-menu-item:focus-visible { background: rgb(241 245 249); }
.dark .an-menu-item:hover:not(:disabled), .dark .an-menu-item:focus-visible { background: rgb(30 41 59); }
.an-menu-item:disabled { opacity: 0.45; cursor: not-allowed; }
.an-menu-item.is-on { font-weight: 600; color: rgb(29 78 216); }
.dark .an-menu-item.is-on { color: rgb(147 197 253); }
.an-menu-item.is-on::before { content: "✓ "; }
.an-menu-sep { height: 1px; margin: 0.25rem 0; background: rgb(226 232 240); }
.dark .an-menu-sep { background: rgb(51 65 85); }
.an-menu-sizes { display: flex; gap: 0.25rem; padding: 0.125rem 0.5rem 0.25rem; }
.an-size { min-width: 2rem; padding: 0.125rem 0.375rem; border: 1px solid rgb(203 213 225); border-radius: 0.25rem; font-size: 0.75rem; }
.an-size.is-on { border-color: rgb(59 130 246); background: rgb(239 246 255); color: rgb(29 78 216); font-weight: 600; }
.dark .an-size { border-color: rgb(71 85 105); }
.dark .an-size.is-on { background: rgb(30 58 138 / 0.4); color: rgb(191 219 254); }
.an-card-body { min-height: 0; }
.an-chart { width: 100%; min-height: 150px; }
.an-card-empty, .an-section-empty { margin: 0; padding: 1.5rem 0.5rem; text-align: center; font-size: 0.8125rem; color: rgb(100 116 139); }
.dark .an-card-empty, .dark .an-section-empty { color: rgb(148 163 184); }
.an-card-error { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.75rem; border-radius: 0.375rem; background: rgb(254 242 242); color: rgb(153 27 27); font-size: 0.8125rem; }
.dark .an-card-error { background: rgb(69 10 10 / 0.6); color: rgb(254 202 202); }
.an-card-warning { margin: 0; padding: 0.25rem 0.5rem; border-radius: 0.25rem; background: rgb(255 251 235); color: rgb(146 64 14); font-size: 0.75rem; }
.dark .an-card-warning { background: rgb(69 26 3 / 0.6); color: rgb(253 230 138); }
.an-card-info { margin: 0; font-size: 0.75rem; color: rgb(100 116 139); font-style: italic; }
.an-data { max-height: 22rem; overflow: auto; }
.an-data-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.an-data-table th, .an-data-table td { padding: 0.2rem 0.375rem; border-bottom: 1px solid rgb(241 245 249); text-align: start; font-weight: 400; }
.an-data-table thead th { position: sticky; top: 0; background: rgb(248 250 252); font-weight: 600; color: rgb(71 85 105); }
.dark .an-data-table th, .dark .an-data-table td { border-color: rgb(30 41 59); }
.dark .an-data-table thead th { background: rgb(30 41 59); color: rgb(203 213 225); }
.an-data-table .an-num { text-align: end; }
.an-data-strong th, .an-data-strong td { font-weight: 600; }
.an-data-link { text-align: start; color: rgb(29 78 216); text-decoration: underline; text-underline-offset: 2px; }
.dark .an-data-link { color: rgb(147 197 253); }
.an-skeleton { min-height: 14rem; }
.an-skeleton-line { width: 40%; height: 0.875rem; border-radius: 0.25rem; background: rgb(226 232 240); }
.an-skeleton-block { flex: 1; margin-top: 0.5rem; border-radius: 0.375rem; background: rgb(241 245 249); }
.dark .an-skeleton-line { background: rgb(51 65 85); }
.dark .an-skeleton-block { background: rgb(30 41 59); }
@media (prefers-reduced-motion: no-preference) {
    .an-skeleton-line, .an-skeleton-block { animation: an-pulse 1.4s ease-in-out infinite; }
}
@keyframes an-pulse { 50% { opacity: 0.55; } }

/* ── N051: "Prislistor" - hierarchy, the table-like edit mode, the row menu, column filters ── */

/* The actions cell holds the row menu: it must not clip it, and an open menu sits above the frozen cells of the rows below. */
.pl-table td.pl-actions { overflow: visible; }
.pl-table td.pl-actions:has(.pl-menu) { z-index: 30; }
.pl-fold-space { display: inline-block; width: 1rem; }
.pl-menu { max-height: min(26rem, 60vh); overflow-y: auto; min-width: 14rem; }
/* The menu opens UNDER its row (above it near the end of the list) - never over the row's own buttons, so "⋯" closes it again. */
.pl-menu { top: 100%; inset-inline-start: 1.25rem; }
.pl-menu.pl-menu-up { top: auto; bottom: 100%; }
.pl-menu-field { display: flex; flex-direction: column; gap: 0.125rem; padding: 0.25rem 0.5rem; font-size: 0.8125rem; }
.pl-menu-field select { width: 100%; }

/* N058 §B3-B4: main group semibold on a faint tint, subgroup medium on a fainter one, a row neutral; a
   "Delsumma" is a thin top rule with an italic, unbolded label and medium figures; the list sum stays
   the strongest row. A negative sum keeps the warning colour; only the list sum is bold. */
.pl-section > td { font-weight: 600; }
.pl-section-sub > td { background: rgb(248 250 252 / 0.7); font-weight: 500; color: rgb(51 65 85); }
.dark .pl-section-sub > td { background: rgb(15 23 42 / 0.7); color: rgb(203 213 225); }
.pl-group-total > td { font-weight: 500; background: transparent; border-top: 1px solid rgb(226 232 240); }
.pl-group-total > td.pl-name-cell > span { font-style: italic; font-weight: 400; color: rgb(71 85 105); }
.dark .pl-group-total > td { background: transparent; border-color: rgb(51 65 85); }
.dark .pl-group-total > td.pl-name-cell > span { color: rgb(148 163 184); }
.pl-group-total-top > td { background: rgb(248 250 252); }
.dark .pl-group-total-top > td { background: rgb(15 23 42); }
.pl-group-total > td.pm-sticky-left { background: rgb(255 255 255); }
.pl-group-total-top > td.pm-sticky-left { background: rgb(248 250 252); }
.pl-grand-total .pl-total-negative, .pl-selection-total .pl-total-negative { font-weight: 700; }

/* The edit mode still reads as a table: a cell looks like a cell until it is hovered or focused. */
.pl-table.pl-editing .pl-in { border-color: transparent; background: transparent; box-shadow: none; }
.pl-table.pl-editing .pl-row:hover .pl-in, .pl-table.pl-editing .pl-variant:hover .pl-in { border-color: rgb(203 213 225); }
.pl-table.pl-editing .pl-in:focus { border-color: rgb(59 130 246); background: rgb(255 255 255); box-shadow: 0 0 0 1px rgb(59 130 246); }
.dark .pl-table.pl-editing .pl-row:hover .pl-in, .dark .pl-table.pl-editing .pl-variant:hover .pl-in { border-color: rgb(71 85 105); }
.dark .pl-table.pl-editing .pl-in:focus { background: rgb(15 23 42); }

/* A header: the label, then the column's own filter. */
.pl-th-inner { display: inline-flex; align-items: center; gap: 0.25rem; max-width: 100%; }
.pl-col-filter { display: inline-flex; align-items: center; border: 0; background: transparent; padding: 0.125rem; border-radius: 0.25rem; color: rgb(148 163 184); cursor: pointer; }
.pl-col-filter:hover, .pl-col-filter:focus-visible { color: rgb(51 65 85); background: rgb(226 232 240); }
.pl-col-filter-on { color: rgb(29 78 216); }
.dark .pl-col-filter:hover, .dark .pl-col-filter:focus-visible { color: rgb(226 232 240); background: rgb(51 65 85); }
.dark .pl-col-filter-on { color: rgb(147 197 253); }

/* Quality: words first, colour second. */
.pl-statuses { display: inline-flex; flex-wrap: wrap; gap: 0.125rem 0.25rem; }
.pl-badge-ok { background: rgb(220 252 231); color: rgb(22 101 52); }
.dark .pl-badge-ok { background: rgb(20 83 45 / 0.5); color: rgb(187 247 208); }
.pl-quality { display: inline-block; padding: 0 0.5rem; border-radius: 9999px; font-size: 0.75rem; line-height: 1.25rem; border: 1px solid transparent; }
.pl-quality-ok { background: rgb(220 252 231); color: rgb(22 101 52); border-color: rgb(134 239 172); }
.pl-quality-partial { background: rgb(254 243 199); color: rgb(146 64 14); border-color: rgb(252 211 77); }
.dark .pl-quality-ok { background: rgb(20 83 45 / 0.5); color: rgb(187 247 208); border-color: rgb(21 128 61); }
.dark .pl-quality-partial { background: rgb(120 53 15 / 0.5); color: rgb(253 230 138); border-color: rgb(180 83 9); }

/* The variant editor: cards in a grid that wraps inside the dialog - never a canvas wider than it. */
.pl-variant-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); gap: 0.5rem; margin-top: 0.25rem; }
.pl-variant-card { border: 1px solid rgb(226 232 240); border-radius: 0.375rem; padding: 0.5rem; min-width: 0; }
.pl-variant-card-off { opacity: 0.65; }
.dark .pl-variant-card { border-color: rgb(51 65 85); }
.pl-variant-card-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.375rem; }
.pl-variant-card-head > .pm-input { flex: 1 1 auto; min-width: 0; }
.pl-variant-card-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); gap: 0.375rem 0.5rem; }
.pl-variant-card-fields label { display: flex; flex-direction: column; min-width: 0; }
.pl-variant-card-fields .pm-input { width: 100%; min-width: 0; }

/* ── N051: the Slutsida's price list table, resource summary and evaluation ── */
.fp-section { margin-top: 1rem; border: 1px solid rgb(226 232 240); border-radius: 0.5rem; background: rgb(255 255 255 / 0.95); }
.dark .fp-section { border-color: rgb(51 65 85); background: rgb(15 23 42 / 0.8); }
.fp-section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem; padding: 0.5rem 0.625rem 0.25rem; }
.fp-section-head h3 { font-weight: 600; }
.fp-scroll { overflow-x: auto; }
.fp-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
.fp-table thead th { padding: 0.25rem 0.5rem; text-align: start; font-weight: 600; white-space: nowrap; border-bottom: 1px solid rgb(203 213 225); background: rgb(241 245 249); }
.dark .fp-table thead th { background: rgb(30 41 59); border-color: rgb(71 85 105); }
.fp-table tbody th, .fp-table tfoot th { padding: 0.1875rem 0.5rem; text-align: start; font-weight: inherit; border-bottom: 1px solid rgb(241 245 249); }
.dark .fp-table tbody th { border-color: rgb(30 41 59); }
.ev-sign { min-width: 3.5rem; }
.fp-table td { padding: 0.1875rem 0.5rem; border-bottom: 1px solid rgb(241 245 249); vertical-align: middle; }
.dark .fp-table td { border-color: rgb(30 41 59); }
.fp-table .fp-num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fp-table .fp-center { text-align: center; }
.fp-list-row > td { font-weight: 600; }
.fp-list-off > td { color: rgb(71 85 105); font-weight: 500; }
.dark .fp-list-off > td { color: rgb(148 163 184); }
.fp-bucket-row > td { font-size: 0.8125rem; color: rgb(51 65 85); }
.fp-bucket-row > td:first-child { padding-inline-start: 2rem; }
.dark .fp-bucket-row > td { color: rgb(203 213 225); }
.fp-total-row > td { font-weight: 700; border-top: 2px solid rgb(148 163 184); background: rgb(241 245 249); }
.dark .fp-total-row > td { background: rgb(30 41 59); }
.fp-expand { border: 0; background: transparent; cursor: pointer; padding: 0 0.25rem; color: inherit; }
.fp-unclassified > td { font-style: italic; }

/* N051: the resize handle sits wholly INSIDE its own header cell. Half of it used to hang over the next
   (sticky, later-painted) header, which swallowed the pointer there - the handle was "lost" mid-grab. */
.pl-table thead th .pl-resize { inset-inline-end: 0; width: 7px; touch-action: none; }
.pl-table.pl-resizing { user-select: none; cursor: col-resize; }
/* ── N058: "Prislistor" - anchored column filter, "+ Grupp ▾", the placement line, "Importera" ── */

/* A column's filter: a small popover at its funnel (fixed, over the table - nothing below moves). */
.pl-filter-popover {
    position: fixed;
    z-index: 61;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.5rem 0.6rem 0.55rem;
    border: 1px solid rgb(203 213 225);
    border-radius: 0.625rem;
    background: rgb(255 255 255);
    color: rgb(30 41 59);
    box-shadow: 0 12px 32px rgb(15 23 42 / 0.18);
    font-size: 0.8125rem;
    line-height: 1.25;
    text-align: start;
}
.dark .pl-filter-popover { border-color: rgb(71 85 105); background: rgb(15 23 42); color: rgb(226 232 240); }
.pl-filter-popover-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.pl-filter-popover-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.pl-filter-popover-close { display: inline-flex; width: 1.5rem; height: 1.5rem; align-items: center; justify-content: center; border: 0; border-radius: 0.375rem; background: transparent; color: rgb(100 116 139); font-size: 1rem; cursor: pointer; }
.pl-filter-popover-close:hover { background: rgb(241 245 249); color: rgb(30 41 59); }
.dark .pl-filter-popover-close:hover { background: rgb(30 41 59); color: rgb(226 232 240); }
.pl-filter-field { display: flex; flex-direction: column; gap: 0.125rem; }
.pl-filter-field > span { font-size: 0.75rem; color: rgb(100 116 139); }
.pl-filter-field .pm-select, .pl-filter-field .pm-input { width: 100%; }
.pl-filter-values { display: flex; flex-direction: column; gap: 0.25rem; max-height: 14rem; overflow-y: auto; border: 0; margin: 0; padding: 0; }
.pl-filter-popover-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-top: 0.15rem; padding-top: 0.45rem; border-top: 1px solid rgb(226 232 240); }
.dark .pl-filter-popover-foot { border-color: rgb(51 65 85); }
.pl-filter-clear, .pl-filter-apply { min-height: 1.6rem; border: 0; border-radius: 0.375rem; padding: 0.15rem 0.5rem; background: transparent; font: inherit; font-weight: 500; cursor: pointer; }
.pl-filter-clear { color: rgb(220 38 38); }
.pl-filter-clear:disabled { opacity: 0.35; cursor: not-allowed; }
.pl-filter-apply { margin-inline-start: auto; border: 1px solid rgb(147 197 253); background: rgb(239 246 255); color: rgb(29 78 216); font-weight: 600; }
.dark .pl-filter-apply { border-color: rgb(59 130 246); background: rgb(30 58 138 / 0.4); color: rgb(191 219 254); }

/* "+ Grupp ▾": the click keeps N051's natural choice, the caret names the explicit ones. */
.pl-split { display: inline-flex; }
.pl-split > .pl-split-main { border-start-end-radius: 0; border-end-end-radius: 0; }
.pl-split > .pl-split-caret { border-start-start-radius: 0; border-end-start-radius: 0; border-inline-start-width: 0; padding-inline: 0.375rem; }
.pl-group-menu { top: calc(100% + 0.25rem); inset-inline-start: 0; }

/* Where the next row lands - said before it is added, quiet beside the add buttons. */
.pl-placement { margin-inline-start: 0.5rem; color: rgb(100 116 139); font-size: 0.75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 32rem; }
.dark .pl-placement { color: rgb(148 163 184); }
.pl-selected > td:first-child { box-shadow: inset 2px 0 0 rgb(59 130 246); }

/* "Importera": icon and word; a narrow window keeps the icon only (title and aria-label stay). No
   container query here: a size container would become the containing block of the fixed filter popover. */
.pl-import-btn { display: inline-flex; align-items: center; gap: 0.25rem; }
@media (max-width: 900px) {
    .pl-import-btn .pl-import-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

/* N061 §10: the live tooltip while a planning bar is dragged - start, end, active time (or why it would not move). */
.sch-drag-tip {
    position: fixed;
    z-index: 2000;
    max-width: 360px;
    padding: 4px 8px;
    border-radius: 4px;
    background: var(--pm-color-text, #0f172a);
    color: var(--pm-color-surface, #ffffff);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 4px 12px rgb(15 23 42 / 0.25);
}

    .sch-drag-tip[hidden] {
        display: none;
    }

/* N067 §I / N068 §J: the twelve fixed activity colours of "Planering" as tokens on the plan shell - a row stores a KEY,
   the stylesheet resolves it, so a theme change moves every bar at once. The default (no key) is the Estimanta brand
   teal from pm-tokens.css. Lives here (not in the scoped PlanningTab.razor.css) because the dark variant hangs on the
   html.dark class, which an isolated stylesheet cannot reach. */
.sch-shell {
    --sch-c-teal: var(--pm-brand-teal, #07a8c2);
    --sch-c-orange: #ea580c;
    --sch-c-blue: #2563eb;
    --sch-c-violet: #7c3aed;
    --sch-c-green: #16a34a;
    --sch-c-red: #dc2626;
    --sch-c-amber: #d97706;
    --sch-c-indigo: #4338ca;
    --sch-c-pink: #db2777;
    --sch-c-slate: #475569;
    --sch-c-lime: #65a30d;
    --sch-c-brown: #9a3412;
}

.dark .sch-shell {
    --sch-c-teal: var(--pm-brand-teal-dark, #3dc9e0);
    --sch-c-orange: #fb923c;
    --sch-c-blue: #60a5fa;
    --sch-c-violet: #a78bfa;
    --sch-c-green: #4ade80;
    --sch-c-red: #f87171;
    --sch-c-amber: #fbbf24;
    --sch-c-indigo: #818cf8;
    --sch-c-pink: #f472b6;
    --sch-c-slate: #94a3b8;
    --sch-c-lime: #a3e635;
    --sch-c-brown: #d97757;
}

/* N068/N069: the tree perspective segments under the department selector. Below the width where "Upphandling & avtal"
   fits a third of the row (≈ 420 px - every ordinary left pane) the middle segment shows "Avtal"; the full name stays
   its title and aria-label, so nothing is ever clipped to "phandling & av…". */
.pm-tree-perspective { container-type: inline-size; }
.pm-tree-perspective .pm-seg-short { display: none; }
@container (max-width: 420px) {
  .pm-tree-perspective .pm-seg-long:has(+ .pm-seg-short) { display: none; }
  .pm-tree-perspective .pm-seg-short { display: inline; }
}

/* N070: a fold inside the risk panel ("Fler uppgifter", "Avancerat", "Visa matris", "Ekonomisk påverkan") - a quiet
   text button with its state in words and aria-expanded, never a native <details> a re-render would close. */
.rk-fold {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0.5rem 0 0.25rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--pm-text-muted, #475569);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.rk-fold:hover { color: var(--pm-text, #0f172a); }
.rk-fold:focus-visible { outline: 2px solid var(--pm-focus, #0ea5e9); outline-offset: 2px; border-radius: 4px; }
