﻿html, body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

/* Keep dt/dd row heights consistent whether or not a value is present */
dl.row dd {
    min-height: 1.5em;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.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;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.filter-bar label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* The property filter: a label and the count that opens the picker, set out like the labelled
   selects beside it. */
.property-filter {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* The category select sizes itself to its longest option, and two categories with long names were
   stretching it to nearly 20rem, a fifth of the filter bar. Both are on their way out, so the control
   is held to what the ones that remain need: "12 - Arbejdsgivermedlem" is the longest of those and
   asks for just under 15rem. A quarter off, rather than the third that measuring the long names
   suggested - that would have clipped a category nobody is retiring. A name longer than this is
   truncated in the closed control and still reads in full when the list is dropped down. */
.category-filter {
    max-width: 15rem;
}

.data-grid tr {
    height: 1em;
}

.data-grid tbody tr:not([aria-rowindex]) {
    display: none;
}

.data-grid th {
    padding-left: 0;
}

.data-grid th button,
.data-grid th .col-header-content {
    padding-left: 0;
}

/* The count/link columns are right-aligned but not sortable. Force header and cells to share the
   same right padding, drop QuickGrid's themed col-gap on the header, and right-align the title text
   (its default row-reverse leaves a slot for a sort arrow these columns never show). These target
   the only right-aligned (col-justify-end) columns in the app. */
.data-grid th.col-justify-end,
.data-grid td.col-justify-end {
    /* !important beats QuickGrid's high-specificity themed cell padding so the header title and the
       numbers below it share exactly the same right edge. */
    padding-right: 1rem !important;
}

.data-grid th.col-justify-end .col-header-content {
    padding-right: 0;
}

/* Non-sortable only (QuickGrid renders a sortable title as a <button>, a plain one as a <div>).
   QuickGrid's own row-reverse reserves the leading slot for a sort arrow these columns never show,
   which would hold the title off the right edge — so lay them out as a plain row pushed right. */
.data-grid th.col-justify-end .col-title:not(button) {
    flex-direction: row;
    justify-content: flex-end;
    /* The theme gives col-title 0.4rem of horizontal padding; drop it on the right so the title
       text ends on the same edge as the numbers instead of ~half a character short. */
    padding-right: 0;
}

/* A sortable right-aligned column (reports grid, "Omsætning") keeps QuickGrid's row-reverse: it puts
   the sort arrow *before* the title, leaving the title text itself flush right. Forcing the plain-row
   layout above onto these would park the arrow to the right of the title and shove the text ~1.4rem
   (arrow + gap) clear of the numbers. Only the theme's right padding has to go. */
.data-grid th.col-justify-end button.col-title {
    padding-right: 0;
}

/* Centre the header title over a centred column. QuickGrid's col-title is a row-reverse flex that
   reserves a slot for the sort arrow, which would push the title off centre on the columns that
   never show one. */
.data-grid th.col-justify-center .col-title {
    flex-direction: row;
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

/* Reserve room for the action-icon column so column widths stay stable when there are no rows. */
.data-grid th:last-child,
.data-grid td:last-child {
    min-width: 4.2rem;
    white-space: nowrap;
}

/* Highlight the row the user last acted on (an action icon or the property count), so it stands out
   when they return from the details/edit/... page. The current row renders a hidden .row-current
   marker in one cell; :has() lifts that to the whole row. */
.data-grid tbody tr:has(.row-current) > td {
    background-color: rgba(13, 110, 253, 0.14);
}

@media (prefers-color-scheme: dark) {
    .data-grid tbody tr:has(.row-current) > td {
        background-color: rgba(13, 110, 253, 0.30);
    }
}

/* Fixed layout keeps the Users grid's column widths identical whether or not rows are shown. */
.users-table {
    table-layout: fixed;
    width: 100%;
}

    .users-table th:nth-child(1),
    .users-table td:nth-child(1) {
        width: 25.5%; /* Email */
    }

    .users-table th:nth-child(2),
    .users-table td:nth-child(2) {
        width: 22%; /* Username */
    }

    .users-table th:nth-child(3),
    .users-table td:nth-child(3) {
        width: 26%; /* Member */
    }

    .users-table th:nth-child(4),
    .users-table td:nth-child(4) {
        width: 7.5rem; /* Confirmed */
    }

    .users-table th:nth-child(5),
    .users-table td:nth-child(5) {
        width: 9rem; /* Disabled */
    }

    .users-table th:nth-child(6),
    .users-table td:nth-child(6) {
        width: 6rem; /* Actions: details, edit, disable/enable, delete */
    }

    /* "Bekræftet" and "Deaktiveret" are long words over two narrow yes/no columns, and the theme
       spends 2.8rem of each header on everything but the text: a 1rem gap to the next column, the
       title's own 0.4rem of right padding, a 0.4rem gap to the sort arrow, and the arrow's 1rem
       slot. That is what puts them into an ellipsis. Reclaim the first two — the arrow and its gap
       have to stay — rather than widening the columns at Email's and Member's expense. A quarter of
       a rem is left so the two headers cannot end up touching. The cells below keep the theme's full
       gap, so the values still stand clear of the action icons. */
    .users-table th:nth-child(4) .col-header-content,
    .users-table th:nth-child(5) .col-header-content {
        padding-right: 0.25rem;
    }

    .users-table th:nth-child(4) .col-title,
    .users-table th:nth-child(5) .col-title {
        padding-right: 0;
    }

/* Fixed layout keeps the Associations grid's column widths identical whether or not rows are shown. */
.associations-table {
    table-layout: fixed;
    width: 100%;
}

    .associations-table th:nth-child(1),
    .associations-table td:nth-child(1) {
        width: 35%; /* Name */
    }

    .associations-table th:nth-child(2),
    .associations-table td:nth-child(2) {
        width: 6rem; /* Cvr */
    }

    .associations-table th:nth-child(3),
    .associations-table td:nth-child(3) {
        width: 25%; /* Postal code/City */
    }

    .associations-table th:nth-child(4),
    .associations-table td:nth-child(4) {
        width: 7.5rem; /* Defunct */
    }

    .associations-table th:nth-child(5),
    .associations-table td:nth-child(5) {
        width: 7.5rem; /* Actions: properties, details, edit, disable/enable, delete */
    }

.properties-table {
    table-layout: fixed;
    width: 100%;
}

    .properties-table th:nth-child(1),
    .properties-table td:nth-child(1) {
        width: 15ch; /* Number: max four characters, plus header and sort arrow */
    }

    .properties-table th:nth-child(2),
    .properties-table td:nth-child(2) {
        width: auto; /* Name flexes to fill remaining space */
    }

    .properties-table th:nth-child(3),
    .properties-table td:nth-child(3) {
        width: 14rem; /* Group: the property group's number and name, or a dash */
    }

    .properties-table th:nth-child(4),
    .properties-table td:nth-child(4) {
        width: 8.8rem; /* Members: count */
    }

    .properties-table th:nth-child(5),
    .properties-table td:nth-child(5) {
        width: 10rem; /* Defunct */
    }

    .properties-table th:nth-child(6),
    .properties-table td:nth-child(6) {
        width: 5rem; /* Actions: edit, disable/enable, delete */
    }

/* The invoicing preview: a hand-written table of one row per member, with the member's own lines
   opening underneath it. Only the three narrow columns are pinned; the name and the attention column
   share what is left, the latter holding whole sentences. */
.invoice-preview-table th:nth-child(1),
.invoice-preview-table td:nth-child(1) {
    width: 7rem; /* Account */
}

.invoice-preview-table th:nth-child(4),
.invoice-preview-table td:nth-child(4) {
    width: 5rem; /* Line count */
}

.invoice-preview-table th:nth-child(5),
.invoice-preview-table td:nth-child(5) {
    width: 8rem; /* Total */
}

/* A member's lines, opened under its row. Fixed layout and fixed widths, so that every member's
   lines sit in the same columns whatever their names and amounts: left to size itself, each nested
   table came out differently and the figures jumped from one member to the next. The selectors
   carry the outer table's class too, to outrank the rules above, which - written without a child
   combinator - reach into these nested cells as well. */
.invoice-preview-table .invoice-lines-table {
    table-layout: fixed;
    width: 100%;
}

.invoice-preview-table .invoice-lines-table th:nth-child(1),
.invoice-preview-table .invoice-lines-table td:nth-child(1) {
    width: 7rem; /* Product number */
}

.invoice-preview-table .invoice-lines-table th:nth-child(2),
.invoice-preview-table .invoice-lines-table td:nth-child(2) {
    width: 30%; /* Product name */
}

.invoice-preview-table .invoice-lines-table th:nth-child(3),
.invoice-preview-table .invoice-lines-table td:nth-child(3) {
    width: auto; /* Details: takes what is left */
}

.invoice-preview-table .invoice-lines-table th:nth-child(4),
.invoice-preview-table .invoice-lines-table td:nth-child(4) {
    width: 6rem; /* Quantity */
}

.invoice-preview-table .invoice-lines-table th:nth-child(5),
.invoice-preview-table .invoice-lines-table td:nth-child(5),
.invoice-preview-table .invoice-lines-table th:nth-child(6),
.invoice-preview-table .invoice-lines-table td:nth-child(6) {
    width: 9rem; /* Unit price, amount */
}

/* Membership fee rules and the two charge-rule lists: QuickGrids with no sortable column, the row
   order being the rule order. One class each, as every grid has, though they differ only in the
   fifth column. The order column holds two arrow buttons under "Rækkefølge", the longest header in
   the row; the old hand-written table measured it at 105px, plus the 1rem right padding every
   right-aligned column gets. The name flexes to fill what is left. */
.fee-rules-table,
.charge-rules-table {
    table-layout: fixed;
    width: 100%;
}

    .fee-rules-table th:nth-child(1),
    .fee-rules-table td:nth-child(1),
    .charge-rules-table th:nth-child(1),
    .charge-rules-table td:nth-child(1) {
        width: 7.5rem; /* Order: the arrows, right-aligned */
    }

    .fee-rules-table th:nth-child(2),
    .fee-rules-table td:nth-child(2),
    .charge-rules-table th:nth-child(2),
    .charge-rules-table td:nth-child(2) {
        width: auto; /* Name flexes to fill remaining space */
    }

    .fee-rules-table th:nth-child(3),
    .fee-rules-table td:nth-child(3),
    .charge-rules-table th:nth-child(3),
    .charge-rules-table td:nth-child(3) {
        width: 17rem; /* Category: number and description, "12 — Arbejdsgivermedlem" the longest */
    }

    .fee-rules-table th:nth-child(4),
    .fee-rules-table td:nth-child(4),
    .charge-rules-table th:nth-child(4),
    .charge-rules-table td:nth-child(4) {
        width: 12rem; /* Conditions: "+ 101, − 205", wraps beyond a few */
    }

    .fee-rules-table th:nth-child(5),
    .fee-rules-table td:nth-child(5) {
        width: 7rem; /* Half year: "1 + 2" at most */
    }

    .charge-rules-table th:nth-child(5),
    .charge-rules-table td:nth-child(5) {
        width: 12rem; /* Lines: product numbers, wraps beyond a few */
    }

    .fee-rules-table th:nth-child(6),
    .fee-rules-table td:nth-child(6),
    .charge-rules-table th:nth-child(6),
    .charge-rules-table td:nth-child(6) {
        width: 5rem; /* Actions: edit, disable/enable, delete */
    }

/* A defunct rule, shown greyed when "show ended" is ticked. On the cells, not the row: Bootstrap 5.3
   gives every .table cell its own color, so a color set on the <tr> never reaches the text. */
.data-grid tbody tr.row-defunct > td {
    color: var(--bs-secondary-color);
}

/* Products: one department's products at a time, so the department is the filter, not a column. */
.products-table {
    table-layout: fixed;
    width: 100%;
}

    .products-table th:nth-child(1),
    .products-table td:nth-child(1) {
        width: 16rem; /* Product group: number and name */
    }

    .products-table th:nth-child(2),
    .products-table td:nth-child(2) {
        width: 18ch; /* Number: up to 25 characters, though the scheme keeps them short, plus header and sort arrow */
    }

    .products-table th:nth-child(3),
    .products-table td:nth-child(3) {
        width: auto; /* Name flexes to fill remaining space */
    }

    .products-table th:nth-child(4),
    .products-table td:nth-child(4) {
        width: 10rem; /* Sales price, right-aligned */
    }

    .products-table th:nth-child(5),
    .products-table td:nth-child(5) {
        width: 6rem; /* Actions: details, edit, disable/enable, delete */
    }

/* The property-group grid repeats the Properties layout, but its third column is the exclusivity
   flag and its count column is headed "Egenskaber" rather than "Medlemmer". */
.property-groups-table {
    table-layout: fixed;
    width: 100%;
}

    .property-groups-table th:nth-child(1),
    .property-groups-table td:nth-child(1) {
        width: 15ch; /* Number: matches the Properties grid's Number column */
    }

    .property-groups-table th:nth-child(2),
    .property-groups-table td:nth-child(2) {
        width: auto; /* Name flexes to fill remaining space */
    }

    .property-groups-table th:nth-child(3),
    .property-groups-table td:nth-child(3) {
        width: 9rem; /* Exclusive: yes/no, plus header and sort arrow */
    }

    .property-groups-table th:nth-child(4),
    .property-groups-table td:nth-child(4) {
        width: 10rem; /* Properties: count, headed by the longer word "Egenskaber" */
    }

    .property-groups-table th:nth-child(5),
    .property-groups-table td:nth-child(5) {
        width: 10rem; /* Defunct */
    }

    .property-groups-table th:nth-child(6),
    .property-groups-table td:nth-child(6) {
        width: 5rem; /* Actions: edit, disable/enable, delete */
    }

/* The reporting-period editor holds exactly three rows, one per report, so it is a plain input grid
   like the range editor rather than a QuickGrid. */
.report-periods-table {
    table-layout: fixed;
    width: 100%;
}

    .report-periods-table th:nth-child(1),
    .report-periods-table td:nth-child(1) {
        width: auto; /* Name flexes to fill remaining space */
    }

    .report-periods-table th:nth-child(2),
    .report-periods-table td:nth-child(2),
    .report-periods-table th:nth-child(3),
    .report-periods-table td:nth-child(3) {
        width: 12rem; /* Opens/Closes: a month name in the select, plus the header */
    }

    .report-periods-table th:nth-child(4),
    .report-periods-table td:nth-child(4) {
        width: 9rem; /* Disabled: checkbox under the longer word "Deaktiveret" */
    }

    .report-periods-table th:nth-child(5),
    .report-periods-table td:nth-child(5) {
        width: 8rem; /* Open now: yes/no */
    }

/* The postal-code range editor is a plain input grid rather than a QuickGrid, but it shares the
   fixed layout so the inputs keep their width as rows are added and removed. */
.ranges-table {
    table-layout: fixed;
    width: 100%;
}

    .ranges-table th:nth-child(1),
    .ranges-table td:nth-child(1) {
        width: auto; /* Property flexes to fill remaining space */
    }

    .ranges-table th:nth-child(2),
    .ranges-table td:nth-child(2),
    .ranges-table th:nth-child(3),
    .ranges-table td:nth-child(3) {
        width: 10rem; /* From/To: a four-digit code plus the header */
    }

    .ranges-table th:nth-child(4),
    .ranges-table td:nth-child(4) {
        width: 5rem; /* Actions: delete row */
    }

.categories-table {
    table-layout: fixed;
    width: 100%;
}

    .categories-table th:nth-child(1),
    .categories-table td:nth-child(1) {
        width: 15ch; /* Number: matches the Properties grid's Number column */
    }

    .categories-table th:nth-child(2),
    .categories-table td:nth-child(2) {
        width: auto; /* Name flexes to fill remaining space */
    }

    .categories-table th:nth-child(3),
    .categories-table td:nth-child(3) {
        width: 8.8rem; /* Members: count */
    }

    .categories-table th:nth-child(4),
    .categories-table td:nth-child(4) {
        width: 12rem; /* Reporting: the reports the category takes part in */
    }

    .categories-table th:nth-child(5),
    .categories-table td:nth-child(5) {
        width: 10rem; /* Defunct */
    }

    .categories-table th:nth-child(6),
    .categories-table td:nth-child(6) {
        width: 5rem; /* Actions: edit, disable/enable, delete */
    }

/* The contact grids repeat the Properties/Categories layouts, but their count column is headed
   "Kontaktpersoner" rather than "Medlemmer" and needs the extra width to spell it out. */
.contact-properties-table,
.contact-roles-table {
    table-layout: fixed;
    width: 100%;
}

    .contact-properties-table th:nth-child(1),
    .contact-properties-table td:nth-child(1),
    .contact-roles-table th:nth-child(1),
    .contact-roles-table td:nth-child(1) {
        width: 15ch; /* Number: matches the Properties grid's Number column */
    }

    .contact-properties-table th:nth-child(2),
    .contact-properties-table td:nth-child(2),
    .contact-roles-table th:nth-child(2),
    .contact-roles-table td:nth-child(2) {
        width: auto; /* Name flexes to fill remaining space */
    }

    .contact-properties-table th:nth-child(3),
    .contact-properties-table td:nth-child(3),
    .contact-roles-table th:nth-child(3),
    .contact-roles-table td:nth-child(3) {
        width: 14rem; /* Contacts: count, headed by the full word "Kontaktpersoner" */
    }

    .contact-properties-table th:nth-child(4),
    .contact-properties-table td:nth-child(4),
    .contact-roles-table th:nth-child(4),
    .contact-roles-table td:nth-child(4) {
        width: 10rem; /* Defunct */
    }

    .contact-properties-table th:nth-child(5),
    .contact-properties-table td:nth-child(5),
    .contact-roles-table th:nth-child(5),
    .contact-roles-table td:nth-child(5) {
        width: 5rem; /* Actions: edit, disable/enable, delete */
    }

/* The monthly staff groups: a name that flexes, then the two salary bounds and three short
   yes/no columns, all of which are sized to their headers rather than their contents. */
.staff-monthly-types-table {
    table-layout: fixed;
    width: 100%;
}

    .staff-monthly-types-table th:nth-child(1),
    .staff-monthly-types-table td:nth-child(1) {
        width: auto; /* Name flexes to fill remaining space */
    }

    .staff-monthly-types-table th:nth-child(2),
    .staff-monthly-types-table td:nth-child(2) {
        width: 8rem; /* Manager */
    }

    .staff-monthly-types-table th:nth-child(3),
    .staff-monthly-types-table td:nth-child(3),
    .staff-monthly-types-table th:nth-child(4),
    .staff-monthly-types-table td:nth-child(4) {
        width: 11rem; /* Minimum/maximum salary: a five-digit amount, its header and the sort arrow */
    }

    .staff-monthly-types-table th:nth-child(5),
    .staff-monthly-types-table td:nth-child(5) {
        width: 12rem; /* Education fund: headed by the full word */
    }

    .staff-monthly-types-table th:nth-child(6),
    .staff-monthly-types-table td:nth-child(6) {
        width: 10rem; /* Defunct */
    }

    .staff-monthly-types-table th:nth-child(7),
    .staff-monthly-types-table td:nth-child(7) {
        width: 5rem; /* Actions: edit, disable/enable, delete */
    }

/* The hourly staff types: the rate count and the two short columns beside it are sized to their
   headers, and the name takes the rest. */
.staff-hourly-types-table {
    table-layout: fixed;
    width: 100%;
}

    .staff-hourly-types-table th:nth-child(1),
    .staff-hourly-types-table td:nth-child(1) {
        width: auto; /* Name flexes to fill remaining space */
    }

    .staff-hourly-types-table th:nth-child(2),
    .staff-hourly-types-table td:nth-child(2) {
        width: 8rem; /* Rates: count, linking to the rate editor */
    }

    .staff-hourly-types-table th:nth-child(3),
    .staff-hourly-types-table td:nth-child(3) {
        width: 12rem; /* Education fund: headed by the full word */
    }

    .staff-hourly-types-table th:nth-child(4),
    .staff-hourly-types-table td:nth-child(4) {
        width: 10rem; /* Defunct */
    }

    .staff-hourly-types-table th:nth-child(5),
    .staff-hourly-types-table td:nth-child(5) {
        width: 5rem; /* Actions: edit, disable/enable, delete */
    }

/* The management staff types: a name and whether it is still offered, so the name has nearly the
   whole table to itself. */
.staff-management-types-table {
    table-layout: fixed;
    width: 100%;
}

    .staff-management-types-table th:nth-child(1),
    .staff-management-types-table td:nth-child(1) {
        width: auto; /* Name flexes to fill remaining space */
    }

    .staff-management-types-table th:nth-child(2),
    .staff-management-types-table td:nth-child(2) {
        width: 10rem; /* Defunct */
    }

    .staff-management-types-table th:nth-child(3),
    .staff-management-types-table td:nth-child(3) {
        width: 5rem; /* Actions: edit, disable/enable, delete */
    }

/* The rate editor is a plain input grid rather than a QuickGrid, as the postal-code one is, but it
   shares the fixed layout so the inputs keep their width as rows are added and removed. */
.rates-table {
    table-layout: fixed;
    width: 100%;
}

    .rates-table th:nth-child(1),
    .rates-table td:nth-child(1) {
        width: auto; /* Name flexes to fill remaining space */
    }

    .rates-table th:nth-child(2),
    .rates-table td:nth-child(2),
    .rates-table th:nth-child(3),
    .rates-table td:nth-child(3) {
        width: 11rem; /* Minimum/maximum rate: an amount with two decimals, plus the header */
    }

    .rates-table th:nth-child(4),
    .rates-table td:nth-child(4) {
        /* Subsistence allowance: an amount like the two beside it, under a one-word header, so a
           little narrower than they are. */
        width: 9rem;
    }

    .rates-table th:nth-child(5),
    .rates-table td:nth-child(5) {
        width: 8rem; /* Defunct: a checkbox under the header */
    }

    .rates-table th:nth-child(6),
    .rates-table td:nth-child(6) {
        width: 5rem; /* Actions: delete row */
    }

/* Fixed layout keeps the Members grid's column widths identical whether or not rows are shown. */
.members-table {
    table-layout: fixed;
    width: 100%;
}

    .members-table th:nth-child(1),
    .members-table td:nth-child(1) {
        width: 13ch; /* Account: max six characters, plus room for the spelled-out header and sort arrow */
    }

    .members-table th:nth-child(2),
    .members-table td:nth-child(2) {
        width: 12rem; /* Member category */
    }

    .members-table th:nth-child(3),
    .members-table td:nth-child(3) {
        width: auto; /* Name flexes to fill remaining space */
    }

    .members-table th:nth-child(4),
    .members-table td:nth-child(4) {
        width: 7rem; /* Contacts: count, matches the Properties column */
    }

    .members-table th:nth-child(5),
    .members-table td:nth-child(5) {
        width: 7rem; /* Properties: count */
    }

    .members-table th:nth-child(6),
    .members-table td:nth-child(6) {
        width: 6rem; /* Actions: details, edit, disable/enable, delete */
    }

/* The company-wide report grids — turnover and wages — repeat the Members grid's leading columns,
   then the period's one figure. Both have the same six columns, so they share this. */
.reports-table {
    table-layout: fixed;
    width: 100%;
}

    .reports-table th:nth-child(1),
    .reports-table td:nth-child(1) {
        width: 13ch; /* Account: matches the Members grid */
    }

    .reports-table th:nth-child(2),
    .reports-table td:nth-child(2) {
        width: 12rem; /* Member category */
    }

    .reports-table th:nth-child(3),
    .reports-table td:nth-child(3) {
        width: auto; /* Name flexes to fill remaining space */
    }

    .reports-table th:nth-child(4),
    .reports-table td:nth-child(4) {
        width: 12rem; /* The figure — turnover or payroll: right-aligned, grouped to millions */
    }

    .reports-table th:nth-child(5),
    .reports-table td:nth-child(5) {
        width: 9rem; /* Confirmed: a check mark, under a header shorter than the date one it replaced */
    }

    .reports-table th:nth-child(6),
    .reports-table td:nth-child(6) {
        width: 3rem; /* Actions: edit only */
    }

/* The member's own report lists: one row per year, so they need none of the width the company-wide
   grids spend on account and name. Capped rather than stretched across the page. */
.member-report-table {
    table-layout: fixed;
    width: 100%;
    max-width: 34rem;
}

    .member-report-table th:nth-child(1),
    .member-report-table td:nth-child(1) {
        width: 7rem; /* Year */
    }

    .member-report-table th:nth-child(2),
    .member-report-table td:nth-child(2) {
        width: 12rem; /* The figure — turnover or payroll: right-aligned amount */
    }

    .member-report-table th:nth-child(3),
    .member-report-table td:nth-child(3) {
        width: 7rem; /* Confirmed: sized to its header, since the cell holds only a check mark */
    }

    .member-report-table th:nth-child(4),
    .member-report-table td:nth-child(4) {
        /* 4.2rem, not less: .data-grid td:last-child sets that as a min-width, so a smaller width
           here would simply be ignored. */
        width: 4.2rem; /* Actions: edit, and only on the open year */
    }

/* The wide grids push their action icons to the right edge; with only four narrow columns here that
   would strand the pencil far from the figures it belongs to. Left-align it in its column so it sits
   just past the "Bekræftet" header instead. */
.member-report-table .grid-action-bar {
    justify-content: flex-start;
    margin-right: 0;
}

/* The wages report: a label column and three columns of figures - what the member types, what it
   adds to the payroll, and what it adds to the payroll the subscription is calculated from. The whole
   form is held to the width those four columns need, so the error messages and the buttons under the
   table line up with it instead of running the width of the page. */
/* Wider than the figures need, because the member's name and the error messages share it. The table
   holds its own columns to what they need; the fourth one soaks up whatever is left over here. */
.wages-report {
    max-width: 46rem;
}

/* A plain input grid rather than a QuickGrid, as the range and rate editors are, and rather than the
   dl this replaced: three figures per row need three columns, and they only read as columns - and the
   two totals only read as their sums - if every row hangs off the same label column.

   Deliberately not wrapped in .data-grid: that wrapper hides any row without an aria-rowindex, which
   QuickGrid stamps on its own rows and a hand-written table has no reason to. */
.wages-table {
    table-layout: fixed;
    width: 100%;
    /* What the three real columns need, so the table never shrinks below it: a fixed layout would
       otherwise squeeze the label column and the labels, which must not break, would spill out of it.
       Held to its width, the table scrolls inside .table-responsive instead. */
    min-width: 31rem;
}

    /* The two figure columns, both one width so the figures line up down the page and under the total
       at the foot: a box plus the cell's own padding, and no wider. */
    .wages-table .wages-col-amount {
        width: 5.9rem;
    }

    /* The labels, stated rather than left to take the slack: the slack belongs to the fourth column,
       which is what lets a long member name run on instead of wrapping. Sized to the longest label,
       "- heraf løn til medarbejdere m/ejerandel", with a little in hand. */
    .wages-table .wages-col-label {
        width: 19rem;
    }

    /* The labels keep the bold a th carries: with a dozen rows it is what the eye counts down. Set
       nowrap because the longest of them - "- heraf løn til elever/lærlinge u/25 år" - broke onto a
       second line in the narrower column this replaced, and the left padding goes so they line up
       with the page. */
    .wages-table th {
        white-space: nowrap;
        padding-left: 0;
    }

    /* Except the detail lines: the shares taken out of an amount, and the two amounts that are
       collected but counted nowhere. Bold on those would compete with the figures they sit under. */
    .wages-table th.wages-label-detail {
        font-weight: normal;
    }

    /* Rows the reader takes as one block are pulled together - see RowSpacing. Not closed up to
       nothing: the boxes would then share an edge and read as one control. */
    .wages-table tr.wages-tight-above > * {
        padding-top: 0.125rem;
    }

    .wages-table tr.wages-tight-below > * {
        padding-bottom: 0.125rem;
    }

    /* The plain values - the member, the period, the confirmation day - sit beside boxed amounts, so
       every cell is centred on its row rather than hanging from the top of it. */
    .wages-table th,
    .wages-table td {
        vertical-align: middle;
    }

/* The amounts are whole thousands of DKK, and the association's range for them runs from "-99.999"
   to "999.999" - seven characters either way. Left at the form's full width, each box invited a much
   longer number than it can hold and the column of figures read as a column of empty space; this
   holds them to the figure itself. The padding is tightened well past the Bootstrap default, which at
   this width would leave the seventh character with nowhere to go. */
.wages-amount {
    max-width: 4.9rem; /* "999.999" and "-99.999", right-aligned */
    padding-left: 0.3rem;
    padding-right: 0.3rem;
}

/* Keeps the period selector's label on the control's baseline, as the rows-per-page selector does. */
.period-picker {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

/* Role (3rd) holds a short label; pin it so it neither stretches on a long role name nor collapses
   when the page happens to show none. */
.contacts-table th:nth-child(3),
.contacts-table td:nth-child(3) {
    width: 9rem;
    min-width: 9rem;
    max-width: 9rem;
}

/* The contacts grid's E-mail (4th), Direct phone (5th) and Mobile (6th) columns carry only a check
   mark, so pin them narrow and give the space back to Member and Name. E-mail keeps 6rem for its
   sort arrow; the other two need only their one-word headers ("Direkte", "Mobil"). */
.contacts-table th:nth-child(4),
.contacts-table td:nth-child(4) {
    width: 6rem;
    min-width: 6rem;
    max-width: 6rem;
}

.contacts-table th:nth-child(5),
.contacts-table td:nth-child(5),
.contacts-table th:nth-child(6),
.contacts-table td:nth-child(6) {
    width: 4.75rem;
    min-width: 4.75rem;
    max-width: 4.75rem;
}

/* Pin the contacts grid's Properties (7th) and User (8th) columns to a steady width so they don't
   resize as their content varies between "", counts, "Yes" and "Disabled" across filters and pages.
   In an auto-layout table a plain width is only a suggestion, so min = max = width removes the
   flexibility for just these two; the remaining columns keep their content-based sizing.
   Properties holds only a count, so it sits narrower than User's "Deaktiveret". */
.contacts-table th:nth-child(7),
.contacts-table td:nth-child(7) {
    width: 6.4rem;
    min-width: 6.4rem;
    max-width: 6.4rem;
    white-space: nowrap;
}

.contacts-table th:nth-child(8),
.contacts-table td:nth-child(8) {
    width: 8rem;
    min-width: 8rem;
    max-width: 8rem;
    white-space: nowrap;
}

/* These four columns are sized to their (bold) headers, and three layers of padding sit between the
   column edge and the title text: Bootstrap's 0.5rem-a-side cell padding, the default theme's
   --col-gap on .col-header-content, and another 0.4rem a side on .col-title. Together that is well
   over a rem of a ~5rem column — enough that QuickGrid's .col-title-text ellipsizes "Direkte" and
   "Egenskaber" while the row still has room to spare. Strip all three back to the gap the columns
   actually need. !important beats .table > :not(caption) > * > *; the .data-grid prefix outranks
   both the theme and the col-justify-end padding set further up. */
.data-grid .contacts-table th:nth-child(4),
.data-grid .contacts-table td:nth-child(4),
.data-grid .contacts-table th:nth-child(5),
.data-grid .contacts-table td:nth-child(5),
.data-grid .contacts-table th:nth-child(6),
.data-grid .contacts-table td:nth-child(6) {
    padding-left: 0.2rem !important;
    padding-right: 0.2rem !important;
}

/* Properties is right-aligned, so it keeps a wider right gap to hold the count off the next column. */
.data-grid .contacts-table th:nth-child(7),
.data-grid .contacts-table td:nth-child(7) {
    padding-left: 0.2rem !important;
    padding-right: 0.5rem !important;
}

.data-grid .contacts-table th:nth-child(4) .col-header-content,
.data-grid .contacts-table th:nth-child(5) .col-header-content,
.data-grid .contacts-table th:nth-child(6) .col-header-content,
.data-grid .contacts-table th:nth-child(7) .col-header-content {
    padding-right: 0;
}

.data-grid .contacts-table th:nth-child(4) .col-title,
.data-grid .contacts-table th:nth-child(5) .col-title,
.data-grid .contacts-table th:nth-child(6) .col-title,
.data-grid .contacts-table th:nth-child(7) .col-title {
    padding-left: 0;
    padding-right: 0;
}

/* The action-icon column (9th, last) is otherwise only min-width-bounded, so auto-layout lets it
   absorb slack and drift — pin it too (three icons ≈ 4.2rem, so 5rem holds them). */
.contacts-table th:nth-child(9),
.contacts-table td:nth-child(9) {
    width: 5rem;
    min-width: 5rem;
    max-width: 5rem;
}

/* Check mark for the columns that only report whether a value is stored (see StoredMark.razor).
   Same green as the enable action, so "present" reads the same way across the grid. */
.grid-check {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    background-size: contain;
    background-repeat: no-repeat;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23198754' viewBox='0 0 16 16'%3E%3Cpath d='M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425z'/%3E%3C/svg%3E");
}

/* Render the property count as a plain link-styled number, without button chrome or underline. */
.property-count {
    text-decoration: none;
    vertical-align: baseline;
    border: 0;
}

.grid-action-bar {
    display: flex;
    justify-content: flex-end;
    margin-right: -1.7rem; /* fine-tuned shift to align icon block with row separators */
}

.grid-action {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    margin-right: 0.4rem;
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.6;
}

.grid-action:hover {
    opacity: 1;
}

.grid-action-details {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23212529' viewBox='0 0 16 16'%3E%3Cpath d='M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z'/%3E%3Cpath d='M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0z'/%3E%3C/svg%3E");
}

.grid-action-edit {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23212529' viewBox='0 0 16 16'%3E%3Cpath d='M12.146.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1 0 .708l-10 10a.5.5 0 0 1-.168.11l-5 2a.5.5 0 0 1-.65-.65l2-5a.5.5 0 0 1 .11-.168l10-10zM11.207 2.5 13.5 4.793 14.793 3.5 12.5 1.207 11.207 2.5zm1.586 3L10.5 3.207 4 9.707V10h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.293l6.5-6.5zm-9.761 5.175-.106.106-1.528 3.821 3.821-1.528.106-.106A.5.5 0 0 1 5 12.5V12h-.5a.5.5 0 0 1-.5-.5V11h-.5a.5.5 0 0 1-.468-.325z'/%3E%3C/svg%3E");
}

.grid-action-delete {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23dc3545' viewBox='0 0 16 16'%3E%3Cpath d='M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V6z'/%3E%3Cpath fill-rule='evenodd' d='M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H5.5l1-1h3l1 1H14a1 1 0 0 1 1 1v1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4H4.118zM2.5 3V2h11v1h-11z'/%3E%3C/svg%3E");
}

.grid-action-disable {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23dc3545' viewBox='0 0 16 16'%3E%3Cpath d='M8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14zm0 1A8 8 0 1 1 8 0a8 8 0 0 1 0 16z'/%3E%3Cpath d='M11.354 4.646a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708l6-6a.5.5 0 0 1 .708 0z'/%3E%3C/svg%3E");
}

.grid-action-enable {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23198754' viewBox='0 0 16 16'%3E%3Cpath d='M8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14zm0 1A8 8 0 1 1 8 0a8 8 0 0 1 0 16z'/%3E%3Cpath d='M10.97 4.97a.235.235 0 0 1 .02-.022.75.75 0 0 1 1.079 1.04l-.007.007-4.5 5.5a.75.75 0 0 1-1.06.05L4.324 9.384a.75.75 0 1 1 1.06-1.06l1.598 1.598 4-4.89a.798.798 0 0 1-.01-.062z'/%3E%3C/svg%3E");
}

.grid-action-reinvite {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%231a56a0' viewBox='0 0 16 16'%3E%3Cpath d='M0 4a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V4zm2-1a1 1 0 0 0-1 1v.217l7 4.2 7-4.2V4a1 1 0 0 0-1-1H2zm13 2.383-4.708 2.825L15 11.105V5.383zm-.034 6.876-5.64-3.471L8 9.583l-1.326-.795-5.64 3.47A1 1 0 0 0 2 13h12a1 1 0 0 0 .966-.741zM1 11.105l4.708-2.897L1 5.383v5.722z'/%3E%3C/svg%3E");
}

/* The same envelope on the staff report, coloured by where the member stands: red when nobody there
   has accepted an invitation, green when somebody was reminded within the week. */
.grid-action-reinvite.grid-action-remind-unaccepted {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23dc3545' viewBox='0 0 16 16'%3E%3Cpath d='M0 4a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V4zm2-1a1 1 0 0 0-1 1v.217l7 4.2 7-4.2V4a1 1 0 0 0-1-1H2zm13 2.383-4.708 2.825L15 11.105V5.383zm-.034 6.876-5.64-3.471L8 9.583l-1.326-.795-5.64 3.47A1 1 0 0 0 2 13h12a1 1 0 0 0 .966-.741zM1 11.105l4.708-2.897L1 5.383v5.722z'/%3E%3C/svg%3E");
}

.grid-action-reinvite.grid-action-remind-recent {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23198754' viewBox='0 0 16 16'%3E%3Cpath d='M0 4a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V4zm2-1a1 1 0 0 0-1 1v.217l7 4.2 7-4.2V4a1 1 0 0 0-1-1H2zm13 2.383-4.708 2.825L15 11.105V5.383zm-.034 6.876-5.64-3.471L8 9.583l-1.326-.795-5.64 3.47A1 1 0 0 0 2 13h12a1 1 0 0 0 .966-.741zM1 11.105l4.708-2.897L1 5.383v5.722z'/%3E%3C/svg%3E");
}

/* Shared key display for authenticator setup */
.shared-key {
    font-family: "Cascadia Code", Consolas, "Courier New", monospace;
    font-size: 1.125rem; /* slightly larger than surrounding text */
    margin: 0.25rem 0;
    padding: 0.125rem 0;
    display: block;
}

    .shared-key kbd {
        /* Make the key visible against any page background while remaining copyable */
        background: #f8f9fa; /* light neutral background */
        color: #212529; /* readable foreground */
        border: 1px solid #ced4da;
        padding: 0.125rem 0.5rem;
        /*border-radius: 0.25rem;*/
        border-radius: 0.00rem;
        font-size: inherit;
    }

/* QR scaling */
img[src*="/Account/Manage/AuthenticatorQr"] {
    width: 50%;
    height: auto;
}

/* Recovery codes styling */
.recovery-box {
    background: #fff3cd;
    border: 1px solid #ffeeba;
    padding: 1rem;
    border-radius: 0.25rem;
}
.recovery-code {
    color: #c7254e;
    font-family: "Cascadia Code", Consolas, "Courier New", monospace;
    font-size: 1.05rem;
    display: block;
    margin: 0.25rem 0;
}

/* Home page */
.home-logo {
    width: 180px;
    height: auto;
    margin-bottom: 1rem;
}

.home-header h1 {
    font-family: 'Comfortaa', sans-serif;
    font-weight: 400;
    font-size: 1.75rem;
    margin-bottom: 0.2rem;
}

.home-header h2 {
    font-family: 'Comfortaa', sans-serif;
    font-weight: 400;
    font-size: 1.2rem;
    color: #555;
    margin-bottom: 1.5rem;
}

.home-body {
    max-width: 700px;
}

/* ------------------------------------------------------------------------------------------------
   Staff reporting

   The two entry lists are hand-written tables rather than QuickGrids, because a row turns into
   inputs where it stands and QuickGrid has no notion of that. They therefore sit outside .data-grid
   — that wrapper hides any row without an aria-rowindex, which only QuickGrid stamps — and carry
   their own fixed layout so the inputs do not resize the columns as rows open and close.
   ------------------------------------------------------------------------------------------------ */
.staff-table {
    table-layout: fixed;
    width: 100%;
    /* The fixed columns below come to some 55rem, and everything left over goes to the function -
       which holds a select, so it cannot be squeezed to nothing. Below this the table scrolls inside
       its .table-responsive wrapper instead of crushing that one flexible column. */
    min-width: 65rem;
}

    /* Monthly: number, function, gender, age, seniority, hours, salary, car, done, actions.
       Adding the hours column cost 6.5rem, which came from the three columns after the salary
       rather than from the function: car holds the word "Bil" and was nearly all slack, and both
       "Færdig" and the two action icons had more room than their contents need. Gender is
       deliberately untouched — see the note on it below. */
    .staff-table th:nth-child(1),
    .staff-table td:nth-child(1) {
        width: 8rem; /* Number: ten characters, and often initials rather than digits */
    }

    .staff-table th:nth-child(2),
    .staff-table td:nth-child(2) {
        width: auto; /* Function flexes to fill remaining space */
    }

    .staff-table th:nth-child(3),
    .staff-table td:nth-child(3) {
        /* Gender: "Uoplyst" plus the select's own arrow and padding, which together take more room
           than the word suggests — below this the longest option is clipped. */
        width: 9rem;
    }

    .staff-table th:nth-child(4),
    .staff-table td:nth-child(4) {
        width: 4.5rem; /* Age: two digits under "Alder" */
    }

    .staff-table th:nth-child(5),
    .staff-table td:nth-child(5) {
        /* Seniority: two digits, but the header "Anciennitet" is the widest thing in the column and
           has to fit whole. */
        width: 7rem;
    }

    .staff-table th:nth-child(6),
    .staff-table td:nth-child(6) {
        /* Hours: "160,33" under "Timer/måned", which is the wider of the two and what sets this. */
        width: 6.5rem;
    }

    .staff-table th:nth-child(7),
    .staff-table td:nth-child(7) {
        width: 6.5rem; /* Salary: five digits and a separator, under "Månedsløn" */
    }

    .staff-table th:nth-child(8),
    .staff-table td:nth-child(8) {
        width: 3.25rem; /* Car: a checkbox under "Bil" */
    }

    .staff-table th:nth-child(9),
    .staff-table td:nth-child(9) {
        /* Done: a check mark or "Fratrådt", right-aligned so it sits against the icons beside it
           rather than adrift at the far side of its own column. */
        width: 5.5rem;
    }

    .staff-table th:nth-child(10),
    .staff-table td:nth-child(10) {
        width: 5rem; /* Actions: two icons, and Save/Cancel on the row being edited */
    }

/* Hourly reports neither seniority nor gender - gender is asked of monthly staff only - and no
   part-time hours either, so it runs three columns shorter and everything from the third on shifts
   left: number, function, age, rate, subsistence, done, actions. Nothing from the third column on
   lines up with the monthly widths above any more, so all of them are restated rather than
   inherited by accident. */
/* Eighteen and a half rem lighter than the monthly table, having neither gender, seniority nor
   hours, so it starts scrolling that much later. */
.staff-table-hourly {
    min-width: 46.5rem;
}

.staff-table-hourly th:nth-child(3),
.staff-table-hourly td:nth-child(3) {
    width: 4.5rem; /* Age: two digits under "Alder" */
}

.staff-table-hourly th:nth-child(4),
.staff-table-hourly td:nth-child(4) {
    width: 6.5rem; /* Rate: to two decimals, under "Timeløn" */
}

.staff-table-hourly th:nth-child(5),
.staff-table-hourly td:nth-child(5) {
    width: 7rem; /* Allowance: a checkbox under "Udetillæg", which is what sets the width */
}

.staff-table-hourly th:nth-child(6),
.staff-table-hourly td:nth-child(6) {
    width: 5.5rem; /* Done */
}

.staff-table-hourly th:nth-child(7),
.staff-table-hourly td:nth-child(7) {
    width: 5rem; /* Actions */
}

/* Management adds the person to its head count: number, name, function, gender, birth date, age,
   hired, mobile, done, actions. Only the number still lines up with the monthly widths above, so
   everything from the third column on is restated. Name is the second column that flexes, sharing
   what is left with the function. */
/* Its fixed columns come to some 55rem, leaving name and function ten each before it starts
   scrolling - the widest of the three lists, and on a laptop the one that scrolls. Gender, age and
   mobile are pared closer than on the monthly list to keep that as low as it will go. */
.staff-table-management {
    min-width: 75rem;
}

.staff-table-management th:nth-child(3),
.staff-table-management td:nth-child(3) {
    width: auto; /* Function */
}

.staff-table-management th:nth-child(4),
.staff-table-management td:nth-child(4) {
    /* Gender: narrower than the monthly 9rem, which only holds because the select there keeps
       Bootstrap's generous padding. Here the padding is trimmed below, so "Uoplyst" and the arrow
       fit in less. */
    width: 7rem;
}

.staff-table-management th:nth-child(5),
.staff-table-management td:nth-child(5),
.staff-table-management th:nth-child(7),
.staff-table-management td:nth-child(7) {
    /* Birth date and hired: a date picker shows "dd-mm-åååå" and its calendar icon, which is what
       sets this rather than either header. */
    width: 9rem;
}

.staff-table-management th:nth-child(6),
.staff-table-management td:nth-child(6) {
    width: 4rem; /* Age: two digits under "Alder", which is what sets it */
}

.staff-table-management th:nth-child(8),
.staff-table-management td:nth-child(8) {
    width: 7rem; /* Mobile: "12 34 56 78"; a +45 in front scrolls inside the box rather than widening it */
}

.staff-table-management th:nth-child(9),
.staff-table-management td:nth-child(9) {
    width: 5.5rem; /* Done */
}

.staff-table-management th:nth-child(10),
.staff-table-management td:nth-child(10) {
    width: 5rem; /* Actions */
}

/* Last year's figures, standing in for figures nobody has entered yet. Greyed and italic because
   they are a suggestion and not a report: nothing here is stored until the row is saved, and the
   list must not read as complete when it is not. */
.staff-proposal {
    color: #6c757d;
    font-style: italic;
}

.staff-dismissed td {
    color: #6c757d;
}

/* The row being worked on, lifted off the list so the eye keeps its place in a hundred rows. */
.staff-editing > td {
    background-color: #f2f7fd;
    vertical-align: middle;
}

/* The number boxes need only as much room as the figure, so they are capped rather than stretched
   across their column. Pushed to the right edge, under their right-aligned headers: a column has to
   be as wide as its header — "Anciennitet" by some way the widest — and letting the boxes fill that
   width left the three figures adrift with gaps between them. Text inputs only, so the car-scheme
   and subsistence checkboxes keep their place. */
.staff-table .staff-editing td:nth-child(4) input[type="text"],
.staff-table .staff-editing td:nth-child(5) input[type="text"],
.staff-table .staff-editing td:nth-child(6) input[type="text"],
.staff-table .staff-editing td:nth-child(7) input[type="text"] {
    display: block;
    margin-left: auto;
    max-width: 4rem;
}

/* Wider than the two year counts beside them, and stated after the rule above so they win on equal
   specificity. */
.staff-table .staff-editing td:nth-child(6) input[type="text"] {
    max-width: 5rem; /* Hours: "160,33" */
}

.staff-table .staff-editing td:nth-child(7) input[type="text"] {
    max-width: 6rem; /* Salary */
}

/* Age has shifted out from under the monthly rule above, and the rate does not fit the width the
   two year counts share. */
.staff-table-hourly .staff-editing td:nth-child(3) input[type="text"] {
    display: block;
    margin-left: auto;
    max-width: 4rem; /* Age */
}

.staff-table-hourly .staff-editing td:nth-child(4) input[type="text"] {
    display: block;
    margin-left: auto;
    max-width: 6rem; /* Rate */
}

/* Management's age sits in the sixth column, where the monthly rule above would give it the hours'
   width. The dates and the mobile are not text inputs, so the monthly rules pass them by. */
.staff-table-management .staff-editing td:nth-child(6) input[type="text"] {
    max-width: 3.25rem; /* Age, typed or calculated */
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

/* The gender select and the mobile box, trimmed of Bootstrap's side padding so the narrower columns
   above still show their longest value: "Uoplyst" with its arrow, and eight digits with spaces. */
.staff-table-management .staff-editing td:nth-child(4) .form-select {
    padding-left: 0.5rem;
    padding-right: 1.75rem;
    background-position: right 0.4rem center;
}

.staff-table-management .staff-editing td:nth-child(8) input {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.staff-row-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* The read-only row's actions. No gap of its own — .grid-action already carries a right margin, and
   the icons are what keep these rows shorter than the text links they replaced. */
.staff-row-icons {
    display: flex;
    align-items: center;
}

/* An action icon that runs a handler instead of navigating. The grids use links, which need no
   reset; a button brings its own chrome, so it is stripped back to the icon inside it. */
.grid-action-button {
    padding: 0;
    border: 0;
    background: none;
    line-height: 1;
}

/* Validation for the row being edited, in a row of its own directly beneath it. It keeps the
   background so the two read as one block, and drops the border between them. */
.staff-messages > td {
    border-top: 0;
    padding-top: 0;
}

/* Both sit under the row they belong to rather than in the page's alert box at the top: they are
   about one row, and in a list of a hundred the top of the page is nowhere near it. */
.staff-error {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.staff-warning {
    color: #997404;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* The reminder dialog: a checkbox, a name, a telephone number and a date. Fixed layout so the
   column of dates lines up however long the names are. */
.remind-table {
    table-layout: fixed;
    width: 100%;
}

    .remind-table th:nth-child(1),
    .remind-table td:nth-child(1) {
        width: 2.5rem; /* The checkbox, or nothing for somebody who cannot be written to */
    }

    .remind-table th:nth-child(2),
    .remind-table td:nth-child(2) {
        width: auto; /* Name flexes, and carries the reason underneath when there is one */
    }

    .remind-table th:nth-child(3),
    .remind-table td:nth-child(3) {
        width: 9rem; /* Telephone */
    }

    .remind-table th:nth-child(4),
    .remind-table td:nth-child(4) {
        width: 10rem; /* Last reminded */
    }

.staff-progress {
    white-space: nowrap;
    font-weight: 600;
}

/* The administrator's status list is an ordinary QuickGrid: account, category, name, reported,
   outstanding, confirmed, actions. */
.staff-status-table {
    table-layout: fixed;
    width: 100%;
}

    .staff-status-table th:nth-child(1),
    .staff-status-table td:nth-child(1) {
        width: 13ch; /* Account: matches the Members grid */
    }

    .staff-status-table th:nth-child(2),
    .staff-status-table td:nth-child(2) {
        width: 12rem; /* Member category */
    }

    .staff-status-table th:nth-child(3),
    .staff-status-table td:nth-child(3) {
        width: auto; /* Name flexes to fill remaining space */
    }

    /* The four columns on the right, sized from what their headers actually need rather than by eye.
       A sortable right-aligned header spends about 46px before a letter of the title is drawn: the
       sort indicator reserves 1rem whether or not the column is sorted (QuickGrid keeps it there so
       the width does not jump when it appears), 0.4rem of gap follows it, this file adds 1rem of
       right padding to every col-justify-end cell, and Bootstrap keeps 0.5rem on the left. Measured
       title texts: "Indberettet" 85px, "Mangler" 63px, "FU" 20px, "Bekraeftet" 75px.

       So they need roughly 131, 109, 66 and 128 pixels, and the widths below are those plus a few
       pixels of margin. "Indberettet" therefore cannot be narrower than it already was - the figure
       that looked like slack was the sort indicator. Only "Mangler" and "Bekraeftet" had any to give,
       which is where the education fund column's width comes from. */
    .staff-status-table th:nth-child(4),
    .staff-status-table td:nth-child(4) {
        width: 9rem; /* Reported */
    }

    .staff-status-table th:nth-child(5),
    .staff-status-table td:nth-child(5) {
        width: 5rem; /* Education fund: a two-letter header, and mostly overhead */
    }

    .staff-status-table th:nth-child(6),
    .staff-status-table td:nth-child(6) {
        width: 7.5rem; /* Outstanding */
    }

    .staff-status-table th:nth-child(7),
    .staff-status-table td:nth-child(7) {
        width: 8.5rem; /* Confirmed: a date */
    }

    .staff-status-table th:nth-child(8),
    .staff-status-table td:nth-child(8) {
        width: 3rem; /* Actions: open only */
    }

/* The member's own landing page: three rows, one per pay form, so it needs none of the width the
   company-wide grid spends on account and name.
   The five fixed columns below come to 40rem, so the cap is what sets the first one - 7.5rem of it,
   a quarter more than the 6 it started with. The row has width to spare either way; the cap is
   there to stop a table of three short rows sprawling across a wide screen. */
.staff-summary-table {
    table-layout: fixed;
    width: 100%;
    max-width: 47.5rem;
}

    .staff-summary-table th:nth-child(1),
    .staff-summary-table td:nth-child(1) {
        width: auto; /* Pay form flexes to fill remaining space */
    }

    .staff-summary-table th:nth-child(2),
    .staff-summary-table td:nth-child(2) {
        width: 7rem; /* Year */
    }

    .staff-summary-table th:nth-child(3),
    .staff-summary-table td:nth-child(3),
    .staff-summary-table th:nth-child(4),
    .staff-summary-table td:nth-child(4) {
        width: 8rem; /* Reported and outstanding */
    }

    .staff-summary-table th:nth-child(5),
    .staff-summary-table td:nth-child(5) {
        width: 8rem; /* Confirmed */
    }

    .staff-summary-table th:nth-child(6),
    .staff-summary-table td:nth-child(6) {
        width: 9rem; /* The button through to the list */
    }