html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.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;
}

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;
}

.tab-page {
    padding-top: 20px; 
}

#page-loading-spinner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.loading-progress {
    width: 8rem;
    height: 8rem;
}

.loading-progress circle {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: #325d88;
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    font-weight: bold;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
}

.table td {
    vertical-align: middle;
}

/* Apply yellow background directly to table cells inside the duplicate row */
.table tr.duplicate-highlight > td {
    background-color: #fffcd4 !important; /* Soft pastel yellow */
    color: #4a3c00 !important; /* Dark yellow-brown text for readability */
}

/* Possible duplicate (Enable Smart Duplication): soft orange, distinct from the exact-duplicate yellow */
.table tr.possible-duplicate-highlight > td {
    background-color: #ffe2c6 !important;
    color: #5a2d00 !important;
}

.possible-duplicate-flag {
    color: #c75b00;
    cursor: help;
}

.duplicate-legend-swatch {
    display: inline-block;
    width: 0.9em;
    height: 0.9em;
    margin-right: 0.35em;
    vertical-align: -0.1em;
    border: 1px solid rgba(0, 0, 0, 0.15);
}

.duplicate-highlight-swatch {
    background-color: #fffcd4;
}

.possible-duplicate-highlight-swatch {
    background-color: #ffe2c6;
}

.quickgrid td.date {
    white-space: nowrap;
}

.quickgrid td.modify-button {
    width: 100px;
}

.quickgrid td.delete-button {
    width: 100px;
}

/* Show not empty rows in the QuickGrid */
.quickgrid tr:has(> td:not(:empty)) > td {
    display: table-cell;
}

/* The workaround to hide empty rows in the QuickGrid */
.quickgrid td:empty {
    display: none;
}

/* Primary button base style */
.btn-primary {
    background-color: #C92A2A !important; /* red */
    border-color: #C92A2A !important;
    border-radius: 6px !important;
    padding: 10px 16px !important;
    color: #fff !important;
}

    /* Hover state - darker red */
    .btn-primary:hover {
        background-color: #A32020 !important; /* darker red */
        border-color: #A32020 !important;
        color: #fff !important;
    }

    /* Disabled state */
    .btn-primary:disabled,
    .btn-primary.disabled {
        background-color: #E0E0E0 !important; /* grey */
        border-color: #E0E0E0 !important;
        color: #888 !important; /* slightly darker text */
        cursor: not-allowed;
    }

    .checkbox-column {
        width: 40px;
        padding-right: 0 !important;
    }

/* ===== Card-based page design =====
   Tokens and shared classes. A page opts in by wrapping its content in .tm-page;
   other pages are not affected. */
:root {
    --tm-red: #B92229;
    --tm-red-dark: #961923;
    --tm-red-pale: #fff1f1;
    --tm-ink: #1a2029;
    --tm-muted: #68737d;
    --tm-subtle: #8b949d;
    --tm-line: #e5e8eb;
    --tm-canvas: #f6f7f9;
    --tm-green: #24744d;
    --tm-green-pale: #eaf8ef;
    --tm-blue: #3867ac;
    --tm-blue-pale: #e9f3ff;
    --tm-shadow: 0 2px 9px rgba(17, 28, 41, .045);
    --tm-shadow-hover: 0 9px 26px rgba(14, 24, 35, .09);
}

/* .tm-page pages sit on a light grey canvas with white cards */
.page:has(.tm-page) main {
    background-color: var(--tm-canvas);
}

.tm-page {
    max-width: 1320px;
    margin: 0 auto;
    padding: 12px 0 40px;
    color: var(--tm-ink);
}

.tm-page-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.tm-eyebrow {
    font-size: 12px;
    letter-spacing: 1.25px;
    text-transform: uppercase;
    font-weight: 800;
    color: var(--tm-red);
    margin-bottom: 6px;
}

.tm-page-title {
    font-size: 31px;
    letter-spacing: -.5px;
    font-weight: 700;
    margin: 0 0 6px;
}

.tm-subheading {
    color: var(--tm-muted);
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
}

.tm-toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.tm-searchbox {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 240px;
    max-width: 490px;
    padding: 0 13px;
    background: #fff;
    border: 1px solid var(--tm-line);
    border-radius: 9px;
    color: #89929b;
    margin: 0;
}

.tm-searchbox input {
    height: 42px;
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--tm-ink);
    font-size: 14px;
}

.tm-searchbox:focus-within {
    border-color: #efc6ca;
    box-shadow: 0 0 0 3px var(--tm-red-pale);
}

.tm-select {
    width: auto;
    min-width: 150px;
    height: 44px;
    border: 1px solid var(--tm-line);
    border-radius: 9px;
    background-color: #fff;
    color: #4b5661;
    font-size: 14px;
}

.tm-sectionbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.tm-sectionbar strong {
    font-size: 16px;
    font-weight: 700;
}

.tm-sectionbar .tm-count {
    color: var(--tm-subtle);
    font-size: 13px;
    font-weight: 400;
}

/* Merge / reorder mode banner: white card with a coloured edge */
.tm-mode-banner {
    background: #fff;
    border: 1px solid var(--tm-line);
    border-left: 4px solid var(--tm-red);
    border-radius: 12px;
    box-shadow: var(--tm-shadow);
    padding: 14px 18px;
    margin-bottom: 18px;
}

.tm-mode-banner.merge {
    border-left-color: #fd7e14;
}

.tm-mode-banner.reorder {
    border-left-color: #6610f2;
}

.tm-empty {
    background: #fff;
    border: 1px dashed #d7dde3;
    border-radius: 12px;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--tm-muted);
    text-align: center;
    padding: 20px;
}

.tm-empty strong {
    color: #2e3943;
    font-size: 17px;
}

.tm-empty .bi {
    font-size: 27px;
}

/* Responsive card grid: 3 columns on wide screens, 2 on medium, 1 on phones */
.tm-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

@media (max-width: 1299.98px) {
    .tm-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .tm-card-grid {
        grid-template-columns: 1fr;
    }
}

/* ----- Item card: title, status pills, labelled fields, footer with buttons (Projects, Overview) ----- */
.tm-item-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 230px;
    height: 100%;
    padding: 19px;
    background: #fff;
    border: 1px solid #e2e5e8;
    border-radius: 12px;
    box-shadow: var(--tm-shadow);
    color: var(--tm-ink);
    transition: box-shadow .12s, transform .12s;
}

.tm-item-card:hover {
    box-shadow: var(--tm-shadow-hover);
    transform: translateY(-1px);
}

.tm-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin: 14px 0 13px;
}

.tm-pill {
    border-radius: 5px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .15px;
    background: var(--tm-green-pale);
    color: var(--tm-green);
}

.tm-pill.final {
    background: #eef0f2;
    color: #46515d;
}

.tm-pill.merged {
    background: var(--tm-blue-pale);
    color: var(--tm-blue);
}

.tm-pill.archived {
    background: #fff4e5;
    color: #9a5b00;
}

.tm-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 13px 8px;
    margin: 0 0 16px;
}

.tm-fields dt {
    font-size: 11px;
    letter-spacing: .35px;
    color: #929ba4;
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 4px;
}

.tm-fields dd {
    margin: 0;
    min-height: 1.2em;
    color: #35404a;
    font-size: 13px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.tm-card-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid #eef0f2;
}

.tm-quick {
    border: 1px solid #e6e7ea;
    background: #fff;
    color: #65707c;
    font-size: 11px;
    font-weight: 800;
    border-radius: 6px;
    padding: 7px 9px;
}

.tm-quick:hover:not(:disabled) {
    color: var(--tm-red);
    border-color: #efc6ca;
}

.tm-quick:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.tm-open-buttons {
    display: flex;
    gap: 6px;
}

.tm-open-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 0;
    border-radius: 7px;
    padding: 8px 12px;
    background: var(--tm-red);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    text-decoration: none;
}

.tm-open-btn:hover {
    background: var(--tm-red-dark);
    color: #fff;
}

/* ----- Page header with an icon tile (pages outside the tabbed Input page) ----- */
.tm-page-head-main {
    display: flex;
    align-items: center;
    gap: 18px;
}

.tm-page-icon {
    flex: 0 0 auto;
    width: 60px;
    height: 60px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background-color: var(--tm-red-pale);
    color: var(--tm-red);
    font-size: 27px;
}

/* ----- Register card: a titled list with a toolbar, search, table and pager ----- */
.tm-register {
    background-color: #fff;
    border: 1px solid var(--tm-line);
    border-radius: 14px;
    box-shadow: var(--tm-shadow);
    overflow: hidden;
    color: var(--tm-ink);
}

.tm-register-head {
    padding: 22px 26px 16px;
    border-bottom: 1px solid #eef0f2;
}

.tm-register-head h2 {
    margin: 0 0 4px;
    font-size: 19px;
    font-weight: 700;
}

.tm-register-head p {
    margin: 0;
    color: var(--tm-muted);
    font-size: 14px;
}

.tm-register-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 16px 24px;
    border-bottom: 1px solid #eef0f2;
}

.tm-toolbar-sep {
    width: 1px;
    height: 28px;
    background-color: var(--tm-line);
    margin: 0 2px;
}

.tm-toolbar-hint {
    margin-left: auto;
    color: var(--tm-muted);
    font-size: 13px;
}

.tm-register-filter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 24px;
}

.tm-count-pill {
    border-radius: 999px;
    padding: 5px 12px;
    background-color: #eef0f2;
    color: #37414c;
    font-size: 13px;
    font-weight: 700;
}

.tm-register-table {
    overflow-x: auto;
    border-top: 1px solid #eef0f2;
}

.tm-register-table table {
    margin: 0;
}

.tm-register-table thead th {
    padding: 12px 16px;
    background-color: #f6f7f9;
    border-bottom: 1px solid var(--tm-line);
    color: #3b4652;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.tm-register-table tbody td {
    padding: 11px 16px;
    border-color: #eff0f2;
    font-size: 14px;
}

.tm-register-table tbody tr:hover > td {
    background-color: #fffafa;
}

.tm-register-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 260px;
    padding: 30px 20px;
    border-top: 1px solid #eef0f2;
    background-color: #fcfcfd;
    color: var(--tm-muted);
    text-align: center;
}

.tm-register-empty .tm-page-icon {
    margin-bottom: 8px;
}

.tm-register-empty strong {
    color: var(--tm-ink);
    font-size: 18px;
}

.tm-register-footer {
    padding: 12px 24px;
    border-top: 1px solid #eef0f2;
    color: var(--tm-muted);
    font-size: 14px;
}

/* The grid's own pager already has the item count on the left and the arrows on the right */
.tm-register .tm-register-footer .paginator {
    margin: 0;
    padding: 0;
    border-top: 0;
}

/* ----- Toolbar buttons ----- */
.tm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0;
    padding: 9px 14px;
    border: 1px solid #d9dfe4;
    border-radius: 8px;
    background-color: #fff;
    color: #37414c;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .12s, border-color .12s, color .12s;
}

.tm-btn:hover {
    background-color: #f4f5f6;
    color: #1a2029;
}

.tm-btn:disabled, .tm-btn.disabled {
    opacity: .5;
    cursor: not-allowed;
    pointer-events: none;
}

.tm-btn-primary {
    background-color: var(--tm-red);
    border-color: var(--tm-red);
    color: #fff;
    box-shadow: 0 2px 4px rgba(185, 34, 41, .13);
}

.tm-btn-primary:hover {
    background-color: var(--tm-red-dark);
    border-color: var(--tm-red-dark);
    color: #fff;
}

/* Imports change data, so they get the brand colour as an outline */
.tm-btn-outline {
    border-color: #efc6ca;
    color: var(--tm-red);
}

.tm-btn-outline:hover {
    background-color: var(--tm-red-pale);
    color: var(--tm-red-dark);
}

.tm-btn-danger {
    color: var(--tm-red);
}

.tm-btn-sm {
    padding: 5px 10px;
    font-size: 13px;
}

/* Form content inside a register card (e.g. a report text) */
.tm-register-body {
    padding: 18px 24px 24px;
}

.tm-field-label {
    display: block;
    margin-bottom: 6px;
    color: #626c77;
    font-size: 13px;
    font-weight: 700;
}

.tm-textarea {
    max-width: 960px;
    padding: 14px 16px;
    border-color: #dfe3e7;
    border-radius: 10px;
    color: var(--tm-ink);
    font-size: 14.5px;
    line-height: 1.6;
}

/* ----- Input category grids ----- */
.tm-input-grid {
    margin-top: 16px;
}

.tm-action-groups {
    align-items: flex-start;
    gap: 14px 18px;
}

.tm-action-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.tm-action-group + .tm-action-group {
    padding-left: 18px;
    border-left: 1px solid var(--tm-line);
}

.tm-group-label {
    color: var(--tm-subtle);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.1px;
    line-height: 1;
    text-transform: uppercase;
}

.tm-group-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Notices, legends and loading text that sit directly inside the card */
.tm-input-grid > .alert {
    margin: 14px 24px 0;
}

.tm-input-grid > .duplicate-legend {
    margin: 0;
    padding: 12px 24px 0;
}

.tm-input-grid > .duplicate-legend + .tm-register-table {
    margin-top: 12px;
}

.tm-input-grid > p {
    margin: 0;
    padding: 18px 24px;
}

.tm-grid-footer {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 24px;
}

.tm-grid-footer .paginator {
    flex: 1;
}

.tm-rows-per-page {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    white-space: nowrap;
}

.tm-rows-per-page .form-select {
    width: auto;
    min-width: 72px;
    border-color: #dfe3e7;
    border-radius: 7px;
}

@media (max-width: 767.98px) {
    .tm-action-group + .tm-action-group {
        padding-left: 0;
        border-left: 0;
    }
}

/* ----- Expandable sections (Bootstrap accordions), app-wide ----- */
.accordion {
    --bs-accordion-bg: #fff;
    --bs-accordion-border-color: var(--tm-line);
    --bs-accordion-border-radius: 12px;
    --bs-accordion-inner-border-radius: 11px;
    --bs-accordion-btn-padding-x: 20px;
    --bs-accordion-btn-padding-y: 14px;
    --bs-accordion-btn-color: var(--tm-ink);
    --bs-accordion-btn-bg: #fff;
    --bs-accordion-btn-focus-box-shadow: 0 0 0 3px var(--tm-red-pale);
    --bs-accordion-active-color: var(--tm-red);
    --bs-accordion-active-bg: #fff7f8;
    --bs-accordion-body-padding-x: 20px;
    --bs-accordion-body-padding-y: 18px;
    --bs-accordion-btn-active-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23B92229' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='M2 5L8 11L14 5'/%3e%3c/svg%3e");
    box-shadow: var(--tm-shadow);
    border-radius: 12px;
}

.accordion-button {
    font-size: 16px;
    font-weight: 600;
    text-transform: none;
}

.accordion-button:not(.collapsed) {
    box-shadow: inset 0 -1px 0 var(--tm-line);
}

/* A toolbar whose buttons are all hidden (e.g. on a final project) takes no space */
.tm-register-toolbar:not(:has(button, a, label)) {
    display: none;
}

/* ----- Settings forms in a card ----- */
.tm-form-card > form,
.tm-form-card > .tm-form-body {
    padding: 20px 24px 24px;
}

.tm-form-card .container {
    max-width: none;
    padding-left: 0;
    padding-right: 0;
}

.tm-form-card .form-label {
    margin-bottom: 5px;
    color: #626c77;
    font-size: 13px;
    font-weight: 700;
}

.tm-form-card .form-control,
.tm-form-card .form-select {
    border-color: #dfe3e7;
    border-radius: 8px;
    color: var(--tm-ink);
    font-size: 14.5px;
}

.tm-form-card .form-control:focus,
.tm-form-card .form-select:focus {
    border-color: #efc6ca;
    box-shadow: 0 0 0 3px var(--tm-red-pale);
}

.tm-form-card .form-check-input:checked {
    background-color: var(--tm-red);
    border-color: var(--tm-red);
}

.tm-form-card .form-check-label {
    color: var(--tm-ink);
    font-size: 14.5px;
}

.tm-form-card .form-text {
    color: var(--tm-muted);
    font-size: 13px;
}

/* A small boxed group inside a form card */
.tm-subcard {
    padding: 16px;
    border: 1px solid var(--tm-line);
    border-radius: 12px;
    background-color: #fcfcfd;
}

/* ----- Compact form: a long dialog form with smaller labels, inputs and gaps ----- */
.compact-form .mb-3 {
    margin-bottom: .45rem !important;
}

.compact-form .form-label {
    margin-bottom: 2px;
    font-size: 13px;
    font-weight: 600;
    color: #4f5a65;
}

.compact-form .form-control,
.compact-form .form-select {
    min-height: 0;
    padding: .25rem .5rem;
    font-size: 14px;
    line-height: 1.4;
}

.compact-form .form-select {
    padding-right: 2rem;
    background-position: right .5rem center;
}

.compact-form textarea.form-control {
    min-height: 0;
}

.compact-form .form-check {
    min-height: 0;
    margin-bottom: .3rem;
}

.compact-form .form-check-label {
    font-size: 14px;
}

.compact-form .form-check-input {
    margin-top: .2em;
}

.compact-form div.simple-dropdown {
    font-size: 14px;
    line-height: 1.4;
}

.compact-form .simple-dropdown .simple-dropdown-button {
    padding: .25rem .5rem;
    text-transform: none;
}

.compact-form .row {
    --bs-gutter-x: 1rem;
}

/* ----- Data set pages (Data Sets, Settings > Organization Data Sets): tree | editor | details ----- */
/* Text and the Create button above the columns (Organization Data Sets tab) */
.ds-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px 16px;
    margin: 14px 0;
}

.ds-layout {
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr) minmax(240px, 300px);
    gap: 15px;
    align-items: start;
}

.ds-tree,
.ds-details {
    padding: 18px;
}

.ds-tree {
    max-height: 80vh;
    overflow: auto;
    font-size: 14px;
    color: #35404a;
}

.ds-editor {
    min-width: 0;
}

.ds-editor-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px 16px;
    margin-bottom: 12px;
    padding: 14px 18px;
}

.ds-editor-head-text {
    min-width: 0;
}

.ds-editor-head .ds-panel-title {
    margin-bottom: 4px;
}

.ds-editor-name {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--tm-ink);
    overflow-wrap: anywhere;
}

.ds-editor-name .bi {
    color: var(--tm-red);
}

.ds-panel-title {
    margin-bottom: 12px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: var(--tm-red);
}

.ds-muted {
    font-size: 14px;
    color: var(--tm-muted);
}

/* Tree: same look as the File Manager folder tree */
.ds-tree .tree-selectable {
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 7px;
}

.ds-tree .tree-selectable:hover {
    background: #f4f5f6;
}

.ds-tree .selected {
    background: var(--tm-red-pale) !important;
    color: var(--tm-red);
    font-weight: 700;
}

.ds-tree .tree-children .tree-item {
    margin-left: 16px;
}

.ds-icon-btn {
    padding: 0 3px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #6c757d;
    line-height: 1;
}

.ds-icon-btn:hover {
    background: #fff;
    color: var(--tm-ink);
}

.ds-icon-btn.danger {
    color: #c0392b;
}

.ds-icon-btn.danger:hover {
    color: #a02d32;
}

/* Details panel */
.ds-details-client {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.ds-details-client a {
    color: var(--tm-ink);
    text-decoration: none;
}

.ds-details-client a:hover {
    color: var(--tm-red);
    text-decoration: underline;
}

.ds-details-name {
    margin: 3px 0 14px;
    font-size: 14px;
    color: var(--tm-muted);
    overflow-wrap: anywhere;
}

.ds-details-hint {
    margin: 16px 0 12px;
    padding-top: 12px;
    border-top: 1px solid #eef0f2;
    font-size: 13px;
    color: var(--tm-muted);
}

.ds-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 48px 16px;
    text-align: center;
    font-size: 13px;
    color: var(--tm-muted);
}

.ds-empty .bi {
    font-size: 31px;
    color: #b6bdc4;
}

.ds-empty strong {
    font-size: 15px;
    color: var(--tm-ink);
}

@media (max-width: 1399.98px) {
    .ds-layout {
        grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
    }

    .ds-details {
        grid-column: 1 / -1;
    }
}

@media (max-width: 767.98px) {
    .ds-layout {
        grid-template-columns: 1fr;
    }

    .ds-tree {
        max-height: 50vh;
    }
}

/* ----- Wide pages (long tables) use the full width ----- */
.tm-page.tm-page-wide {
    max-width: none;
}

/* ----- Billing sections: separate cards with an icon, title and short description ----- */
.tm-sections {
    box-shadow: none;
}

.tm-sections > .accordion-item {
    margin-bottom: 10px;
    border: 1px solid var(--tm-line);
    border-radius: 12px;
    box-shadow: var(--tm-shadow);
    overflow: hidden;
}

.tm-sections > .accordion-item > .accordion-header .accordion-button {
    gap: 14px;
    border-radius: 12px;
}

.tm-sections > .accordion-item > .accordion-header .accordion-button:not(.collapsed) {
    border-radius: 12px 12px 0 0;
}

.tm-section-icon {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background-color: var(--tm-red-pale);
    color: var(--tm-red);
    font-size: 19px;
}

.tm-section-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.tm-section-title {
    font-size: 16px;
    font-weight: 700;
}

.tm-section-desc {
    color: var(--tm-muted);
    font-size: 13px;
    font-weight: 400;
}

.tm-section-toolbar {
    margin-top: 6px;
}

.tm-export-panel {
    margin-bottom: 18px;
}

/* ----- Small information cards: a label and a list of name / value pairs ----- */
.tm-info-card {
    height: 100%;
    padding: 18px 22px;
}

.tm-info-card .tm-group-label {
    margin-bottom: 12px;
}

.tm-info-list {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 8px 18px;
    margin: 0;
    font-size: 14px;
}

.tm-info-list dt {
    color: var(--tm-muted);
    font-weight: 500;
}

.tm-info-list dd {
    margin: 0;
    color: var(--tm-ink);
    font-weight: 600;
}

/* Status badge: green while in progress, grey when final */
.tm-status {
    display: inline-block;
    border-radius: 5px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 700;
    background-color: var(--tm-green-pale);
    color: var(--tm-green);
}

.tm-status.final {
    background-color: #eef0f2;
    color: #46515d;
}

/* ----- Warning banner (e.g. over the ROM) ----- */
.tm-alert {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
    padding: 14px 18px;
    border: 1px solid #f0c9cc;
    border-left: 3px solid #cb5258;
    border-radius: 12px;
    background-color: var(--tm-red-pale);
    color: #a02d32;
}

.tm-alert > .bi {
    font-size: 21px;
}

.tm-alert-text {
    flex: 1 1 auto;
    min-width: 0;
}

.tm-alert-text strong {
    display: block;
    font-size: 15px;
}

.tm-alert-text span {
    font-size: 13px;
    color: var(--tm-muted);
}

/* ----- Stat tiles: name, amount, short note and a corner icon ----- */
.tm-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
}

.tm-stat {
    position: relative;
    min-width: 0;
    padding: 19px 20px;
    border: 1px solid var(--tm-line);
    border-radius: 12px;
    background-color: #fff;
    box-shadow: var(--tm-shadow);
    color: var(--tm-ink);
}

.tm-stat.warn {
    border-left: 3px solid #cb5258;
}

.tm-stat-name {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .25px;
    text-transform: uppercase;
    color: var(--tm-muted);
}

.tm-stat-amount {
    margin-top: 9px;
    font-size: 25px;
    font-weight: 750;
    letter-spacing: -.6px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tm-stat.warn .tm-stat-amount {
    color: #a02d32;
}

.tm-stat-badge {
    margin-top: 14px;
}

.tm-stat-sub {
    margin-top: 8px;
    font-size: 12px;
    color: var(--tm-muted);
}

.tm-stat-corner {
    position: absolute;
    top: 16px;
    right: 15px;
    font-size: 19px;
    color: #9aa4ae;
}

@media (max-width: 767.98px) {
    .tm-stat-amount {
        font-size: 21px;
    }

    .tm-alert {
        flex-wrap: wrap;
    }
}
