/* ==========================================================================
   Ver-Tex site styles: shared by every page. Page specific styles go in
   wwwroot/css/<page>.css and are added through the page's Styles section.
   ========================================================================== */

:root {
    /* Vertex green: the logo's green (#7cc242) for bars, buttons and borders; deeper shades of it for text,
       which must stay readable on white. */
    --vts-logo-green: #7cc242;
    --vts-logo-green-hover: #6aad33;
    --vts-green-text: #4a8a1f;
    --vts-green-deep: #3a6d18;
    /* Negative buttons (Cancel, Remove, ...): a soft red, as light as the Vertex green of the positive buttons. */
    --vts-negative-bg: #e8695f;
    --vts-negative-bg-hover: #d9564c;
    /* Grids (data tables) keep their original teal; the Vertex green theme does not change them. */
    --vts-grid-accent: #005f6b;
    --vts-grid-accent-dark: #00454e;
    --vts-grid-tint: #eef7f8;
    --vts-grid-tint-border: #c9e2e6;
    /* The login pages keep their original teal background. */
    --vts-login-background: #005f6b;
    --vts-blue: #03a9f4;
    --vts-blue-dark: #0288d1;
    --vts-heading: #287091;
    --vts-green: #2e7d32;
    --vts-red: #c62828;
    --vts-amber: #b26a00;
    --vts-text: #000000;
    --vts-muted: #000000;
    --vts-border: #d6d6d6;
    --vts-surface: #ffffff;
    --vts-background: #f5f5f5;
    --vts-radius: 6px;
    --vts-shadow: 0 2px 6px rgba(0, 0, 0, 0.1), 0 3px 6px rgba(0, 0, 0, 0.08);
}

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

html {
    font-size: 14px;
}

body {
    margin: 0;
    font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--vts-text);
    background: var(--vts-background);
    -webkit-font-smoothing: antialiased;
}

/* While site.js fetches a page in the background (page swap): a moving bar at the top and a busy cursor. */
body.is-loading {
    cursor: progress;
}

body.is-loading::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    width: 40%;
    height: 3px;
    background: var(--vts-logo-green);
    animation: vts-loading 1s ease-in-out infinite;
}

@keyframes vts-loading {
    from { transform: translateX(-100%); }
    to { transform: translateX(250%); }
}

@media (prefers-reduced-motion: reduce) {
    body.is-loading::before {
        width: 100%;
        animation: none;
    }
}

h1, h2, h3 {
    color: var(--vts-heading);
    font-weight: 400;
    margin: 0 0 12px;
}

h1 { font-size: 1.6rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; }

a {
    color: var(--vts-green-text);
}

code {
    font-family: Consolas, "Courier New", monospace;
    background: #eeeeee;
    padding: 1px 4px;
    border-radius: 3px;
    word-break: break-all;
}

[hidden] {
    display: none !important;
}

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

/* ---------------------------------------------------------------- Top bar */

.topbar {
    display: flex;
    align-items: center;
    gap: 24px;
    height: 56px;
    padding: 0 20px;
    background: var(--vts-surface);
    border-bottom: 1.5px solid var(--vts-logo-green);
    box-shadow: var(--vts-shadow);
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar-brand img {
    display: block;
    height: 30px;
    width: auto;
}

.topbar .link-button {
    color: var(--vts-green-text);
}

.topbar-nav a {
    color: var(--vts-green-text);
    font-weight: 600;
    text-decoration: none;
}

.topbar-nav a:hover {
    text-decoration: underline;
}

.topbar-user {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-name {
    font-weight: 600;
}

.topbar-logout {
    margin: 0;
}

/* ------------------------------------------------------------ Account menu */

.account-menu {
    position: relative;
}

.account-menu summary {
    cursor: pointer;
    color: var(--vts-green-text);
    list-style: none;
}

.account-menu summary::-webkit-details-marker {
    display: none;
}

.account-menu summary::after {
    content: " \25BE";
}

.account-menu-panel {
    position: absolute;
    right: 0;
    top: 28px;
    min-width: 260px;
    padding: 8px 0;
    background: var(--vts-surface);
    border: 1px solid var(--vts-border);
    border-radius: var(--vts-radius);
    box-shadow: var(--vts-shadow);
}

.account-menu-item {
    display: block;
    width: 100%;
    padding: 8px 16px;
    border: 0;
    background: none;
    text-align: left;
    font: inherit;
    color: var(--vts-text);
    cursor: pointer;
}

.account-menu-item:hover {
    background: #f1f8ea;
}

.account-details {
    margin: 8px 0 0;
    padding: 8px 16px 0;
    border-top: 1px solid var(--vts-border);
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 12px;
}

.account-details dt {
    color: var(--vts-muted);
}

.account-details dd {
    margin: 0;
    word-break: break-all;
}

/* -------------------------------------------------------- Navigation trail */

.trail {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 24px 0;
}

.trail-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--vts-border);
    border-radius: 16px;
    background: var(--vts-surface);
    color: var(--vts-green-text);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.trail-back:hover,
.trail-back:focus-visible {
    border-color: var(--vts-green-text);
    background: #f1f8ea;
}

.trail-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    min-width: 0;
    color: var(--vts-muted);
}

.trail-list li {
    display: flex;
    align-items: center;
    max-width: 280px;
}

.trail-list li + li::before {
    content: "\203A";
    margin: 0 8px;
    color: var(--vts-muted);
}

.trail-list a,
.trail-list [aria-current] {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.trail-list a {
    color: var(--vts-green-text);
    text-decoration: none;
}

.trail-list a:hover {
    text-decoration: underline;
}

.trail-list [aria-current] {
    color: var(--vts-text);
    font-weight: 600;
}

/* ----------------------------------------------------------------- Content */

.content {
    padding: 16px 24px 24px;
}

/* No page titles on screen: the trail (Home › ...) and the tab already name the page. The h1 stays for screen
   readers, hidden the same way as .visually-hidden. (The sign-in pages use _LoginLayout and keep theirs.) */
.content h1 {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.panel {
    background: var(--vts-surface);
    border: 1px solid var(--vts-border);
    border-radius: var(--vts-radius);
    padding: 20px;
}

/* A group of fields inside a form panel (e.g. "Assign To" with its user search). */
.panel fieldset {
    border: 1px solid var(--vts-border);
    border-radius: var(--vts-radius);
    margin: 0 0 16px;
    padding: 12px 16px;
}

.panel legend {
    font-weight: 600;
    padding: 0 4px;
}

/* Text typed on several lines (a reminder, a task description). */
.pre-wrap {
    white-space: pre-wrap;
}

.empty {
    color: var(--vts-muted);
}

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

.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.form-field label {
    font-weight: 600;
}

.form-field input {
    padding: 9px 10px;
    font: inherit;
    border: 1px solid var(--vts-border);
    border-radius: 4px;
    background: var(--vts-surface);
}

.form-field input:focus {
    outline: 2px solid var(--vts-logo-green);
    outline-offset: 0;
    border-color: var(--vts-logo-green);
}

.field-error {
    color: var(--vts-red);
    font-size: 0.9rem;
}

.form-actions,
.dialog-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.dialog-actions form {
    margin: 0;
}

.button {
    display: inline-block;
    padding: 10px 18px;
    border: 0;
    border-radius: 3px;
    background: var(--vts-logo-green);
    color: #ffffff;
    font: inherit;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    cursor: pointer;
    box-shadow: var(--vts-shadow);
    transition: background-color 0.2s;
}

.button:hover {
    background: var(--vts-logo-green-hover);
}

.button:disabled {
    opacity: 0.6;
    cursor: wait;
}

/* A button whose function is not built yet (greyed, like ToolbarLink.NotBuilt). */
.button.button-unavailable:disabled {
    background: #e0e0e0;
    color: #8a8a8a;
    box-shadow: none;
    opacity: 1;
    cursor: not-allowed;
}

.button-secondary {
    background: #eeeeee;
    color: var(--vts-text);
    box-shadow: none;
}

.button-secondary:hover {
    background: #e0e0e0;
}

/* Negative buttons: Cancel, No, Close, Remove, Clear. The same solid look as the positive buttons, in red. */
.button-negative {
    background: var(--vts-negative-bg);
    color: #ffffff;
}

.button-negative:hover {
    background: var(--vts-negative-bg-hover);
}

.link-button {
    border: 0;
    background: none;
    padding: 0;
    font: inherit;
    color: var(--vts-green-text);
    cursor: pointer;
    text-decoration: underline;
}

/* ---------------------------------------------- Search pages (_FilterText) */

.search-fields {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 0 24px;
}

.filter-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.filter-field label {
    font-weight: 600;
}

.filter-inputs {
    display: flex;
    gap: 6px;
}

.filter-inputs select,
.filter-inputs input {
    padding: 9px 10px;
    font: inherit;
    border: 1px solid var(--vts-border);
    border-radius: 4px;
    background: var(--vts-surface);
}

.filter-inputs input {
    flex: 1;
    min-width: 0;
}

.filter-inputs select:focus,
.filter-inputs input:focus {
    outline: 2px solid var(--vts-logo-green);
    outline-offset: 0;
    border-color: var(--vts-logo-green);
}

.search-results {
    margin-top: 20px;
}

/* Inside .page-main the gap already spaces the cards. */
.page-main > .search-results {
    margin-top: 0;
}

.search-summary {
    margin: 12px 0 0;
    color: var(--vts-muted);
}

/* ------------------------------------------------------------- Data tables */

.table-scroll {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid var(--vts-border);
    white-space: nowrap;
}

.data-table th {
    background: var(--vts-grid-tint);
    color: var(--vts-grid-accent-dark);
    font-weight: 600;
}

.data-table tbody tr:nth-child(even) {
    background: #fafafa;
}

.data-table tbody tr:hover {
    background: #e8f4fd;
}

.data-table .numeric {
    text-align: right;
}

/* EasyPay Barcode Generator: the logo, then the barcode with its number. */
.easypay-barcode .easypay-logo {
    display: block;
    max-width: 240px;
    height: auto;
    margin-bottom: 16px;
}

.easypay-barcode figure {
    margin: 0;
    display: inline-block;
}

.easypay-barcode svg {
    display: block;
    max-width: 100%;
}

.easypay-barcode figcaption {
    font-family: Arial, sans-serif;
    font-size: 0.9rem;
    margin-top: 4px;
}

/* A warning that stays on the page (not a notification), e.g. Case Status Change. */
.text-negative {
    color: var(--vts-red);
}

/* View Ledger: legal debits red, legal credits green, as the old ledger showed them. */
.data-table tr.row-negative td {
    color: var(--vts-red);
}

.data-table tr.row-positive td {
    color: var(--vts-green);
}

/* Links in a grid (open debtor, open case, ...) look like small buttons. A button that picks the row (the
   branch lookup's code: button.grid-pick) looks the same. */
.data-table td > a,
.data-table td button.grid-pick {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border: 1px solid var(--vts-grid-tint-border);
    border-radius: 4px;
    background: var(--vts-grid-tint);
    color: var(--vts-grid-accent-dark);
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.data-table td button.grid-pick {
    font: inherit;
    font-weight: 600;
    text-transform: none;
    letter-spacing: normal;
    box-shadow: none;
    cursor: pointer;
}

.data-table td > a::after,
.data-table td button.grid-pick::after {
    content: "\203A";
    font-size: 1.15em;
    line-height: 1;
}

.data-table td > a:hover,
.data-table td > a:focus-visible,
.data-table td button.grid-pick:hover,
.data-table td button.grid-pick:focus-visible {
    background: var(--vts-grid-accent);
    border-color: var(--vts-grid-accent);
    color: #ffffff;
}

/* A row action whose page is not built yet: greyed, like ToolbarLink.NotBuilt. */
.data-table td button.grid-pick:disabled,
.data-table td button.grid-pick:disabled:hover {
    border-color: var(--vts-border);
    background: #f4f4f4;
    color: #9e9e9e;
    cursor: not-allowed;
}

.data-table td button.grid-pick:disabled::after {
    content: none;
}

/* A row action that takes something away (Remove): the same chip in red. */
.data-table td button.grid-pick.grid-pick-negative {
    border-color: #f1c4c4;
    background: #fdf0f0;
    color: var(--vts-red);
}

.data-table td button.grid-pick.grid-pick-negative::after {
    content: none;
}

.data-table td button.grid-pick.grid-pick-negative:hover,
.data-table td button.grid-pick.grid-pick-negative:focus-visible {
    border-color: var(--vts-red);
    background: var(--vts-red);
    color: #ffffff;
}

.data-table td > a:focus-visible,
.data-table td button.grid-pick:focus-visible {
    outline: 2px solid var(--vts-blue);
    outline-offset: 2px;
}

/* For tables with long text (remarks, notes): let the cells wrap. */
.data-table-wrap td {
    white-space: normal;
    vertical-align: top;
}

.data-table-wrap td.nowrap {
    white-space: nowrap;
}

/* Long text in a grid cell: at most three lines (the whole text in the cell's title / tooltip), so a long
   description does not make the row very tall. */
.data-table .cell-clamp {
    max-width: 48ch;
    white-space: normal;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
    overflow-wrap: anywhere;
}

/* ---------------------------------------- Detail pages (debtor, case, ...) */

/* The record bar at the top of a detail page (e.g. _DebtorInfoBar). */
.info-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 32px;
    margin: 0 0 20px;
    padding: 12px 20px;
    background: var(--vts-surface);
    border: 1px solid var(--vts-border);
    border-left: 4px solid var(--vts-green-text);
    border-radius: var(--vts-radius);
}

.info-bar dt {
    color: var(--vts-muted);
    font-size: 0.85rem;
}

.info-bar dd {
    margin: 2px 0 0;
    font-weight: 600;
}

.page-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Case page: collecting only cost (the old page's #FFFDDC background). */
.case-collecting-cost {
    background: #fffddc;
    margin: -24px;
    padding: 24px;
}

/* A small form inside a detail list (e.g. Update Email). */
.inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
}

.inline-form input {
    flex: 1;
    min-width: 0;
    padding: 7px 9px;
    font: inherit;
    line-height: 1.4;
    border: 1px solid var(--vts-border);
    border-radius: 4px;
}

.button-small {
    padding: 6px 10px;
    font-size: 0.85rem;
}

/* Grid buttons (in tables) keep their own blue. Only real buttons: links in a grid (View PDF, ...) keep the
   grid link look (.data-table td > a). */
button.button-small:not(.button-secondary):not(.button-negative) {
    background: var(--vts-blue);
}

button.button-small:not(.button-secondary):not(.button-negative):hover {
    background: var(--vts-blue-dark);
}

/* Options / Documents toolbars (_Toolbar). */
/* As the old PageLinks / LinkDocs boxes: the first link at the far right, the rest to its left, wrapping onto a
   new line that also starts at the right. */
.toolbar {
    display: flex;
    flex-direction: row-reverse;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 4px;
    margin-bottom: 12px;
    padding: 8px 12px;
    background: #f4f4f4;
    border: 1px solid var(--vts-border);
    border-radius: var(--vts-radius);
}

.toolbar-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 122px;
    padding: 6px 4px;
    border-radius: 4px;
    color: var(--vts-text);
    font-size: 0.9rem;
    text-align: center;
    text-decoration: none;
}

.toolbar-button:hover,
.toolbar-button:focus-visible {
    background: #e8f4dc;
    color: var(--vts-green-deep);
}

/* An old link whose page is not in V2 yet. */
.toolbar-button-unavailable,
.toolbar-button-unavailable:hover {
    color: var(--vts-muted);
    background: none;
    cursor: not-allowed;
}

.toolbar-button-unavailable img {
    filter: grayscale(1);
    opacity: 0.5;
}

.toolbar-button-unavailable small {
    font-size: 0.75rem;
}

.detail-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.detail-cards h2 {
    font-size: 1.1rem;
}

/* A card with many fields: twice as wide, its fields in two columns (each <dt>/<dd> pair wrapped in a
   <div>), so it is half as tall and the cards next to it are not stretched with empty space. */
.detail-card-wide {
    grid-column: span 2;
}

.detail-list.detail-list-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 20px;
}

.detail-list.detail-list-columns > div {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Case Overview: every card across the full width, one under the other, its fields four across. */
.case-detail-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.case-detail-layout h2 {
    font-size: 1.1rem;
}

/* A full-width card: its fields four across. */
.detail-list.detail-list-columns-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* A long field (a remark, a query) across the whole row of a four-across list. */
.detail-list.detail-list-columns > .detail-field-full {
    grid-column: 1 / -1;
}

@media (max-width: 1100px) {
    .detail-list.detail-list-columns-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .detail-card-wide {
        grid-column: auto;
    }

    .detail-list.detail-list-columns {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Label above its value, one field under the other, so long labels and long values never run out of
   the card. The value shows in a read-only box that looks like a textbox and wraps long text. */
.detail-list {
    display: flex;
    flex-direction: column;
    margin: 0;
}

.detail-list dt {
    margin: 12px 0 4px;
    color: var(--vts-muted);
    font-size: 0.85rem;
    font-weight: 600;
}

.detail-list dt:first-child {
    margin-top: 0;
}

.detail-list dd {
    margin: 0;
    min-height: calc(1.4em + 16px);
    padding: 7px 9px;
    border: 1px solid var(--vts-border);
    border-radius: 4px;
    background: #fafafa;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

/* A value that holds its own input (edit pages, Update Email): the input is the box. */
.detail-list dd.detail-edit,
.edit-list dd {
    min-height: 0;
    padding: 0;
    border: 0;
    background: none;
}

/* The same layout with inputs (edit pages). */
.edit-list dt {
    color: var(--vts-text);
}

.edit-list input,
.edit-list textarea,
.edit-list select {
    width: 100%;
    padding: 7px 9px;
    font: inherit;
    line-height: 1.4;
    border: 1px solid var(--vts-border);
    border-radius: 4px;
    background: var(--vts-surface);
}

.edit-list input[readonly] {
    background: #fafafa;
    color: var(--vts-muted);
}

/* File uploads (PDF, Excel): a dashed drop zone (files can be dragged onto it) with our own Choose File button. */
input[type="file"],
.edit-list input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 2px dashed var(--vts-border);
    border-radius: var(--vts-radius);
    background: #fafafa;
    color: var(--vts-muted);
    font: inherit;
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s;
}

input[type="file"]:hover,
input[type="file"]:focus-visible {
    border-color: var(--vts-logo-green);
    background: #f4faee;
    outline: none;
}

input[type="file"]::file-selector-button {
    margin-right: 14px;
    padding: 9px 18px;
    border: 0;
    border-radius: 3px;
    background: var(--vts-green-text);
    color: #ffffff;
    font: inherit;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: var(--vts-shadow);
    transition: background-color 0.2s;
}

input[type="file"]::file-selector-button:hover {
    background: var(--vts-green-deep);
}

.edit-list input:focus,
.edit-list textarea:focus,
.edit-list select:focus {
    outline: 2px solid var(--vts-logo-green);
    outline-offset: 0;
    border-color: var(--vts-logo-green);
}

.edit-list .input-validation-error {
    border-color: var(--vts-red);
}

.edit-list .field-error {
    display: block;
    margin-top: 4px;
}

.field-hint {
    display: block;
    margin-top: 4px;
    color: var(--vts-muted);
    font-size: 0.85rem;
}

.edit-list input[type="checkbox"] {
    width: auto;
}

/* Client: branch code with its Lookup button on one line, and the lookup dialog. */
.branch-pick {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.branch-pick input {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
}

.branch-pick .button {
    flex: none;
    white-space: nowrap;
}

.dialog.branch-lookup {
    width: min(760px, calc(100vw - 32px));
}

.branch-lookup h2 {
    margin-top: 0;
}

.branch-lookup .table-scroll,
.dialog .table-scroll.dialog-scroll {
    max-height: 50vh;
    overflow-y: auto;
}

/* A list of check boxes in columns (Copy PDF to DVD's PDF types). */
.check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 6px 16px;
    margin: 16px 0 0;
    padding: 12px;
    border: 1px solid var(--vts-border);
    border-radius: 4px;
}

.check-grid legend {
    padding: 0 4px;
    font-weight: 600;
}

/* Client sub-pages: the client the page is about. */
/* ------------------------------------------------------------------ Alerts */

.alert {
    padding: 12px 14px;
    margin-bottom: 16px;
    border-radius: 4px;
    border-left: 4px solid;
}

.alert-error {
    background: #fdecea;
    border-color: var(--vts-red);
    color: #7f1d1d;
}

.alert-warning {
    background: #fff4e5;
    border-color: var(--vts-amber);
    color: #663c00;
}

.alert-info {
    background: #e8f4fd;
    border-color: var(--vts-blue-dark);
    color: #0d3c61;
}

.alert-success {
    background: #edf7ed;
    border-color: var(--vts-green);
    color: #1e4620;
}

/* Notifications (site.js, vtsNotify): one at a time, top right, under the top bar. */
.notify-area {
    position: fixed;
    top: 72px;
    right: 20px;
    z-index: 900;
    width: min(440px, calc(100vw - 32px));
}

.framed .notify-area,
.login-body .notify-area {
    top: 16px;
}

.notify {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 0;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
    animation: vts-notify-in 0.2s ease-out;
}

.notify-text {
    flex: 1;
    min-width: 0;
    max-height: 50vh;
    overflow-y: auto;
    overflow-wrap: anywhere;
}

.notify-text p,
.notify-text ul {
    margin: 0 0 6px;
}

.notify-text ul {
    padding-left: 18px;
}

.notify-close {
    flex: none;
    border: 0;
    background: none;
    padding: 0 2px;
    font: inherit;
    font-size: 1.3rem;
    line-height: 1;
    color: inherit;
    cursor: pointer;
    opacity: 0.7;
}

.notify-close:hover,
.notify-close:focus-visible {
    opacity: 1;
}

@keyframes vts-notify-in {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .notify {
        animation: none;
    }
}

.password-rules {
    background: #fafafa;
    border: 1px solid var(--vts-border);
    border-radius: 4px;
    padding: 10px 14px;
    margin-bottom: 16px;
}

.password-rules ul {
    margin: 6px 0 0;
    padding-left: 20px;
}

/* ----------------------------------------------------------------- Dialogs */

.dialog {
    width: min(480px, calc(100vw - 32px));
    border: 0;
    border-radius: var(--vts-radius);
    padding: 24px;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
}

.dialog-wide {
    width: min(640px, calc(100vw - 32px));
}

.dialog::backdrop {
    background: rgba(43, 43, 43, 0.56);
}

@media (max-width: 640px) {
    .topbar {
        gap: 12px;
        padding: 0 12px;
    }

    .topbar-name {
        display: none;
    }

    .content {
        padding: 12px;
    }

    .trail {
        padding: 10px 12px 0;
        gap: 10px;
    }

    .trail-list li {
        max-width: 160px;
    }
}

/* ------------------------------------------------------------------ View tabs */

/* A row of links that pick the list shown below (Case Overview "View ..." links). */
.view-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--vts-border);
}

.view-tabs a {
    padding: 6px 12px;
    border: 1px solid var(--vts-border);
    border-radius: 16px;
    background: var(--vts-surface);
    color: var(--vts-green-text);
    font-weight: 600;
    text-decoration: none;
}

.view-tabs a:hover,
.view-tabs a:focus-visible {
    border-color: var(--vts-green-text);
    background: #f1f8ea;
}

/* An old "View ..." link whose list is not in V2 yet. */
.view-tabs .view-tab-unavailable {
    padding: 6px 12px;
    border: 1px dashed var(--vts-border);
    border-radius: 16px;
    color: var(--vts-muted);
    cursor: not-allowed;
}

.view-tabs a[aria-current="page"] {
    border-color: var(--vts-green-text);
    background: var(--vts-green-text);
    color: #ffffff;
}

/* Queries overview: "Days Old" coloured by age (the old green / yellow / salmon cells). */
.data-table td.age-new {
    background: #dff3d6;
}

.data-table td.age-mid {
    background: #fff6c8;
}

.data-table td.age-old {
    background: #f9d2c9;
}

/* A group of check boxes in columns (the old CheckBoxList RepeatColumns). */
.checkbox-columns {
    border: 1px solid var(--vts-border);
    border-radius: var(--vts-radius);
    padding: 8px 12px 12px;
    margin: 0 0 16px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 6px 16px;
}

.checkbox-columns legend {
    font-weight: 600;
    padding: 0 4px;
}

/* Previous / Next paging under a grid. */
.pager {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-top: 12px;
}

/* Buttons side by side in a grid cell (a form counts as one of them). */
.data-table td.table-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.data-table td.table-actions form {
    margin: 0;
}

/* A row action in its own column (a link chip, or a chip button in a small form): only as wide as the chip, so
   the chips of a row sit together at the end. */
.data-table th.grid-action,
.data-table td.grid-action {
    width: 1%;
}

.data-table td.grid-action > form {
    margin: 0;
}

/* Task histories: the old share-of-the-month bars. */
meter.stat-bar {
    width: 100px;
    height: 11px;
    vertical-align: middle;
}

/* Document Templates (Pages/Documents/Templates). */
.field-help {
    margin: 6px 0;
    font-size: 0.9rem;
}

.detail-list.detail-list-columns-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.template-problems {
    border-left: 4px solid var(--vts-amber);
}

.template-problems ul {
    margin: 0;
    padding-left: 20px;
}

.template-actions {
    white-space: nowrap;
}

.template-actions a {
    margin-right: 6px;
}

.template-code {
    width: 100%;
    box-sizing: border-box;
    padding: 7px 9px;
    font: inherit;
    border: 1px solid var(--vts-border);
    border-radius: 4px;
}

.template-code {
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.85rem;
}

.template-thumb {
    max-width: 240px;
    max-height: 80px;
    background: #ffffff;
    border: 1px solid var(--vts-border);
}
