/* ==========================================================================
   Contractor, the Daveng Contractor App
   Brand theme, copied from RADAR and trimmed to what this app uses. Palette
   sampled from the Daveng logo artwork and daveng.co.za.

   Linked by _Layout.cshtml and _LoginLayout.cshtml before site.css.
   Never hard-code a colour, font or spacing value in a view. Use these
   variables and the dv- utility classes.

   Look and feel follows the Daveng public site: white and light, bright blue
   for action, navy reserved for the sidebar and for type, green only for
   positive outcomes. Soft diffuse shadows rather than hard borders.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Self-hosted Montserrat. No CDN.
   -------------------------------------------------------------------------- */
@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../lib/fonts/montserrat-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../lib/fonts/montserrat-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    /* --- Primary brand, sampled from the logo --- */
    --dv-navy:          #2D2A2A;
    --dv-navy-deep:     #1F1D1D;
    --dv-navy-soft:     #3B3737;
    --dv-blue:          #066B57;
    --dv-blue-bright:   #077A63;
    --dv-blue-light:    #2FAE8E;
    --dv-blue-deep:     #055C4A;
    --dv-green:         #7EC245;
    --dv-green-deep:    #5E9B2C;
    --dv-grey:          #8A8B8C;

    /* --- Chrome gradient ------------------------------------------------
       Drawn from the statistics band on daveng.co.za, which runs indigo to
       blue. Deepened from the band itself: a full height sidebar carries far
       more area than a small stat tile, so the same values read washed out.
       Used for the sidebar and the other large coloured surfaces so they
       read as one family. Both ends clear AA against white text by a wide
       margin, 12.1:1 at the top, 8.2:1 at the bottom. Leon, 25 October 2026:
       the side menu stays this blue; the page behind the content is whiter. */
    --dv-chrome-from:   #322E2E;
    --dv-chrome-mid:    #2D2A2A;
    --dv-chrome-to:     #252222;

    /* --- Neutrals --- */
    --dv-text:          #2D2A2A;
    --dv-text-muted:    #6B7280;
    --dv-line:          #D9DDE3;
    --dv-line-soft:     #EEF0F3;
    --dv-surface:       #FFFFFF;
    --dv-canvas:        #FAFAFB;

    /* --- Tints, used for icon chips and soft fills --- */
    --dv-tint-blue:     #E3F4EF;
    --dv-tint-navy:     #F1F3F5;
    --dv-tint-green:    #EDF7E2;
    --dv-tint-amber:    #FEF4E2;
    --dv-tint-red:      #FDECEC;

    /* --- States --- */
    --dv-success:       #7EC245;
    --dv-warning:       #E8930C;
    --dv-danger:        #DC2626;
    --dv-info:          #3ABB9C;

    /* --- Structure ---

       Leon, 17 September 2026: "The look and feel is very subtle. I can hardly
       see the lines of the textboxes." The portal runs on a tablet, so every
       box now has a definite edge, every card is a framed panel with a light
       shadow, and the controls are big enough to hit with a thumb. */
    --dv-radius:        12px;
    --dv-radius-sm:     10px;
    --dv-radius-pill:   999px;
    --dv-shadow:        0 1px 2px rgba(17, 24, 39, 0.04);
    --dv-shadow-hover:  0 2px 4px rgba(17, 24, 39, 0.05), 0 8px 20px rgba(17, 24, 39, 0.08);
    --dv-shadow-lg:     0 16px 48px rgba(17, 24, 39, 0.16);
    --dv-shadow-bar:    0 1px 0 rgba(17, 24, 39, 0.06);

    --dv-sidebar-w:     236px;
    --dv-rail-w:        66px;
    --dv-appbar-h:      60px;

    /* --- Spacing scale --- */
    --dv-space-1:       4px;
    --dv-space-2:       8px;
    --dv-space-3:       12px;
    --dv-space-4:       16px;
    --dv-space-5:       24px;
    --dv-space-6:       32px;

    /* --- Field use --- */
    --dv-tap:           48px;

    /* The edge of anything a person types into or picks from, and the edge of
       a card. Darker than the old --dv-line, which was almost invisible on a
       tablet in daylight. */
    --dv-field-line:    #D1D5DB;
    --dv-field-hover:   #9CA3AF;
    --dv-card-line:     #E5E7EB;

    /* --- Type --- */
    --dv-font-head:     'Montserrat', 'Segoe UI', Helvetica, Arial, sans-serif;
    --dv-font-body:     'Segoe UI', Helvetica, Arial, sans-serif;
    --dv-font-pdf:      Calibri, sans-serif;
}

/* --------------------------------------------------------------------------
   Bootstrap 5 variable overrides
   -------------------------------------------------------------------------- */
:root {
    --bs-primary:       #088A70;
    --bs-primary-rgb:   8, 138, 112;
    --bs-secondary:     #8A8B8C;
    --bs-success:       #7EC245;
    --bs-danger:        #DC2626;
    --bs-warning:       #E8930C;
    --bs-info:          #3ABB9C;
    --bs-body-color:    #2D2A2A;
    --bs-body-bg:       #FAFAFB;
    --bs-border-color:  #E5E7EB;
    --bs-link-color:    #088A70;
    --bs-link-hover-color: #066B57;
    --bs-border-radius: 10px;
    --bs-font-sans-serif: 'Segoe UI', Helvetica, Arial, sans-serif;
}

/* Sprint 4, Leon's change of 25 October 2026, as RADAR's Sprint 9 Task 9.13:
   the standard text size is smaller (13px, 14px from 768 pixels wide), so the
   lists fit the tablet. A text box keeps its own 16px on a phone, so the phone
   never zooms in on typing. */
html {
    font-size: 13px;
}

@media (min-width: 768px) {
    html {
        font-size: 14px;
    }
}

body {
    font-family: var(--dv-font-body);
    color: var(--dv-text);
    background: var(--dv-canvas);
    margin-bottom: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6,
.dv-kpi-value,
.navbar-brand {
    font-family: var(--dv-font-head);
    color: var(--dv-navy);
    font-weight: 700;
}

h4 {
    font-size: 1.3rem;
    letter-spacing: -0.3px;
    margin-bottom: 0;
}

a {
    color: var(--dv-blue);
    text-decoration: none;
}

a:hover {
    color: var(--dv-blue-deep);
    text-decoration: underline;
}

hr {
    border-color: var(--dv-line);
    opacity: 1;
}

/* ==========================================================================
   APPLICATION SHELL
   ========================================================================== */

.dv-shell {
    display: flex;
    min-height: 100vh;
    align-items: stretch;
}

/* --------------------------------------------------------------------------
   Sidebar
   -------------------------------------------------------------------------- */
.dv-sidebar {
    width: var(--dv-sidebar-w);
    flex: 0 0 var(--dv-sidebar-w);
    background: linear-gradient(165deg, var(--dv-chrome-from) 0%, var(--dv-chrome-mid) 52%, var(--dv-chrome-to) 100%);
    color: rgba(255, 255, 255, 0.82);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1040;
    /* Visible, not hidden: the Configure and user menus open upward out of the
       sidebar foot and must not be clipped by it. Scrolling is handled by
       .dv-nav alone. */
    overflow: visible;
    transition: width 0.2s ease, flex-basis 0.2s ease;
}

/* A soft edge, echoing the logo gradient. */
.dv-sidebar::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    width: 1px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(233, 201, 63, 0.4) 60%, transparent);
}

/* --- Brand row --- */
.dv-brand-row {
    display: flex;
    align-items: center;
    gap: var(--dv-space-1);
    padding: var(--dv-space-3) var(--dv-space-3) var(--dv-space-3) 14px;
    flex-shrink: 0;
    position: relative;
}

.dv-brand-row::after {
    content: '';
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, var(--dv-blue-bright), rgba(233, 201, 63, 0.6) 60%, transparent);
    opacity: 0.7;
}

.dv-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    min-width: 0;
    flex: 1;
}

.dv-brand:hover {
    text-decoration: none;
}

.dv-brand-mark {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: var(--dv-radius-sm);
    background: var(--dv-surface);
    padding: 3px;
    object-fit: contain;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.dv-brand-text {
    line-height: 1.15;
    min-width: 0;
    overflow: hidden;
}

.dv-brand-name {
    display: block;
    font-family: var(--dv-font-head);
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 3px;
    color: #FFFFFF;
    white-space: nowrap;
}

/* The signed in user's contractor, under the word Contractor. A long name is
   cut short with an ellipsis and read in full on hover. */
.dv-brand-sub {
    display: block;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

/* --- Collapse to rail --- */
.dv-rail-toggle {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: var(--dv-radius-sm);
    background: rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.8);
    transition: background 0.15s, color 0.15s, transform 0.2s;
}

.dv-rail-toggle svg {
    width: 15px;
    height: 15px;
}

.dv-rail-toggle:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #FFFFFF;
}

/* --- Navigation --- */
.dv-nav {
    flex: 1 1 auto;
    padding: var(--dv-space-3) 10px var(--dv-space-4);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

.dv-nav::-webkit-scrollbar {
    width: 5px;
}

.dv-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.16);
    border-radius: var(--dv-radius-pill);
}

.dv-nav-group-label {
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 1.1px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.58);
    padding: var(--dv-space-4) 10px var(--dv-space-1);
    white-space: nowrap;
    overflow: hidden;
}

.dv-nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    padding: 9px 10px;
    margin-bottom: 2px;
    border: none;
    border-radius: var(--dv-radius-sm);
    background: transparent;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.82rem;
    font-weight: 600;
    text-align: left;
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    transition: background 0.15s ease, color 0.15s ease;
}

.dv-nav-item:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #FFFFFF;
    text-decoration: none;
}

/* The sidebar is now blue, so the selected item inverts to white rather than
   trying to be a brighter blue against blue. */
.dv-nav-item.active {
    background: var(--dv-surface);
    color: var(--dv-navy);
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(31, 29, 29, 0.24);
}

.dv-nav-item.active:hover {
    background: var(--dv-surface);
    color: var(--dv-navy);
}

.dv-nav-item.active .dv-nav-icon {
    opacity: 1;
    color: var(--dv-blue);
}

.dv-nav-item-sub {
    font-size: 0.78rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.76);
    padding-left: 18px;
}

.dv-nav-item-sub.active {
    font-weight: 700;
    color: var(--dv-navy);
}

.dv-nav-item-sub .dv-nav-icon {
    width: 15px;
    height: 15px;
}

/* A module that sits underneath another, Documents under Reviews, used to be
   drawn one step in with a short rule beside it. Leon, 5 September 2026: it
   should look like every other item, so the class is no longer applied and the
   rules that drew it are gone rather than left here unused.

   The relationship is carried by the ORDER of the menu, which is where the rest
   of the grouping lives too. */

.dv-nav-icon {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    opacity: 0.82;
}

.dv-nav-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* A menu item that is not built yet. It is shown so people can see what is
   coming, greyed and not a link, and says "Not available yet" on hover. */
.dv-nav-item.dv-nav-disabled {
    opacity: 0.45;
    cursor: default;
}

.dv-nav-item.dv-nav-disabled:hover {
    background: transparent;
    color: rgba(255, 255, 255, 0.88);
}

.dv-nav-caret {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    margin-left: auto;
    opacity: 0.55;
    transition: transform 0.18s ease;
}

[aria-expanded="true"] > .dv-nav-caret {
    transform: rotate(180deg);
}

/* --- Sidebar foot: Configure and the signed in user --- */
.dv-sidebar-foot {
    flex-shrink: 0;
    padding: var(--dv-space-2) 10px var(--dv-space-3);
}

.dv-nav-configure {
    margin-bottom: var(--dv-space-2);
}

.dv-sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 8px;
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0;
    background: transparent;
    text-align: left;
    white-space: nowrap;
    transition: background 0.15s ease;
}

.dv-sidebar-user:hover {
    background: rgba(255, 255, 255, 0.12);
}

.dv-avatar {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--dv-blue-bright), var(--dv-blue));
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--dv-font-head);
    font-size: 0.7rem;
    font-weight: 800;
}

.dv-sidebar-user-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.dv-sidebar-user-name {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    color: #FFFFFF;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dv-sidebar-user-role {
    display: block;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.72);
}

/* Menus that open upward out of the sidebar foot. */
.dv-foot-menu {
    min-width: 220px;
    border: none;
    border-radius: var(--dv-radius);
    box-shadow: var(--dv-shadow-lg);
    padding: var(--dv-space-2);
    margin-bottom: var(--dv-space-2) !important;
}

.dv-foot-menu-head {
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--dv-text-muted);
    padding: var(--dv-space-1) var(--dv-space-2) var(--dv-space-2);
}

.dv-foot-menu .dropdown-item {
    border-radius: var(--dv-radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 8px 10px;
}

.dv-foot-menu .dropdown-item:hover {
    background: var(--dv-tint-blue);
    color: var(--dv-blue-deep);
}

/* Switch user, for testing. The list can be long, so the menu scrolls rather
   than running off the top of the window. */
.dv-foot-menu {
    max-height: calc(100vh - 96px);
    overflow-y: auto;
}

/* Leon, 28 November 2026: each contractor's heading is a band in its own
   colour, with a line above it from the second group on. */
.dv-switch-group {
    --dv-switch-mark: var(--dv-blue);
    display: block;
    margin: var(--dv-space-2) 0 var(--dv-space-1);
    padding: 7px 10px;
    border-left: 4px solid var(--dv-switch-mark);
    border-radius: var(--dv-radius-sm);
    background: var(--dv-tint-blue);
    color: var(--dv-navy);
}

.dv-foot-menu-head + .dv-switch-group {
    margin-top: 0;
}

li:not(.dv-foot-menu-head) + .dv-switch-group {
    margin-top: var(--dv-space-3);
}

.dv-switch-group-2 { --dv-switch-mark: var(--dv-green-deep); background: var(--dv-tint-green); }
.dv-switch-group-3 { --dv-switch-mark: var(--dv-navy); background: var(--dv-tint-navy); }
.dv-switch-group-4 { --dv-switch-mark: var(--dv-cat-amber); background: var(--dv-tint-amber); }

.dv-switch-group-name {
    display: block;
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1.25;
}

.dv-switch-group-count {
    display: block;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--dv-text-muted);
}

.dv-foot-menu .dv-switch-item {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    padding-top: 6px;
    padding-bottom: 6px;
}

.dv-switch-note {
    font-size: 0.72rem;
    font-weight: 400;
    color: var(--dv-text-muted);
}

.dv-foot-menu .dv-switch-item.active,
.dv-foot-menu .dv-switch-item:disabled {
    background: var(--dv-tint-blue);
    color: var(--dv-blue-deep);
    opacity: 1;
}

/* --------------------------------------------------------------------------
   Collapsed rail
   -------------------------------------------------------------------------- */
.dv-shell.dv-rail .dv-sidebar {
    width: var(--dv-rail-w);
    flex-basis: var(--dv-rail-w);
}

.dv-shell.dv-rail .dv-main {
    margin-left: var(--dv-rail-w);
}

.dv-shell.dv-rail .dv-brand-text,
.dv-shell.dv-rail .dv-nav-label,
.dv-shell.dv-rail .dv-nav-caret,
.dv-shell.dv-rail .dv-sidebar-user-text {
    display: none;
}

.dv-shell.dv-rail .dv-brand-row {
    flex-direction: column;
    gap: var(--dv-space-2);
    padding-left: var(--dv-space-2);
    padding-right: var(--dv-space-2);
}

.dv-shell.dv-rail .dv-brand {
    justify-content: center;
}

.dv-shell.dv-rail .dv-rail-toggle svg {
    transform: rotate(180deg);
}

.dv-shell.dv-rail .dv-nav,
.dv-shell.dv-rail .dv-sidebar-foot {
    padding-left: var(--dv-space-2);
    padding-right: var(--dv-space-2);
}

.dv-shell.dv-rail .dv-nav-item,
.dv-shell.dv-rail .dv-sidebar-user {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
    gap: 0;
}

.dv-shell.dv-rail .dv-nav-group-label {
    height: 1px;
    padding: 0;
    margin: var(--dv-space-3) auto var(--dv-space-2);
    width: 22px;
    background: rgba(255, 255, 255, 0.14);
    color: transparent;
    overflow: hidden;
}

/* Name the icon on hover when the labels are gone. The nav scrolls, so a
   tooltip drawn inside it would be clipped - site.js positions this one
   against the viewport instead. */
.dv-rail-tip {
    position: fixed;
    background: var(--dv-navy);
    color: #FFFFFF;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 6px 11px;
    border-radius: var(--dv-radius-sm);
    box-shadow: var(--dv-shadow-lg);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.12s ease;
    z-index: 1200;
}

.dv-rail-tip.show {
    opacity: 1;
}

/* Applied by the inline script before first paint so the rail never flashes. */
.dv-pre-collapsed .dv-sidebar {
    width: var(--dv-rail-w);
    flex-basis: var(--dv-rail-w);
}

.dv-pre-collapsed .dv-main {
    margin-left: var(--dv-rail-w);
}

/* --------------------------------------------------------------------------
   Main column and app bar
   -------------------------------------------------------------------------- */
.dv-main {
    flex: 1 1 auto;
    min-width: 0;
    margin-left: var(--dv-sidebar-w);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.2s ease;
}

/* Light app bar, echoing the white header band on the Daveng website. */
.dv-appbar {
    height: var(--dv-appbar-h);
    background: var(--dv-surface);
    border-bottom: 1px solid var(--dv-line);
    box-shadow: var(--dv-shadow-bar);
    display: flex;
    align-items: center;
    gap: var(--dv-space-3);
    padding: 0 var(--dv-space-5);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.dv-appbar-title {
    font-family: var(--dv-font-head);
    font-size: 1rem;
    font-weight: 700;
    color: var(--dv-navy);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.2px;
}

/* The scope note that used to sit under the page heading. */
.dv-appbar-subtitle {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--dv-blue-deep);
    background: var(--dv-tint-blue);
    border-radius: var(--dv-radius-pill);
    padding: 4px 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 340px;
    flex-shrink: 1;
}

.dv-appbar-centre {
    flex: 1 1 auto;
    display: flex;
    justify-content: flex-end;
    min-width: 0;
}

/* With the heading in the app bar the content can start straight in. */
.dv-content > .dv-toolbar:first-child,
.dv-content > .row:first-child,
.dv-content > .dv-card:first-child,
.dv-content > form:first-child {
    margin-top: 0;
}

@media (max-width: 991.98px) {
    .dv-appbar-subtitle {
        display: none;
    }
}

.dv-hamburger {
    display: none;
    background: transparent;
    border: 1px solid var(--dv-line);
    border-radius: var(--dv-radius-sm);
    color: var(--dv-navy);
    width: 38px;
    height: 34px;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dv-hamburger svg {
    width: 18px;
    height: 18px;
}

.dv-content {
    flex: 1 1 auto;
    padding: var(--dv-space-5) var(--dv-space-5) var(--dv-space-6);
    min-width: 0;
}

.dv-footer {
    padding: var(--dv-space-3) var(--dv-space-5);
    border-top: 1px solid var(--dv-line);
    background: var(--dv-surface);
    color: var(--dv-text-muted);
    font-size: 0.73rem;
}

/* --- Slide-over drawer below 992px --- */
.dv-scrim {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(31, 29, 29, 0.5);
    z-index: 1035;
}

@media (max-width: 991.98px) {
    .dv-sidebar,
    .dv-shell.dv-rail .dv-sidebar,
    .dv-pre-collapsed .dv-sidebar {
        width: var(--dv-sidebar-w);
        flex-basis: var(--dv-sidebar-w);
        transform: translateX(-100%);
        transition: transform 0.22s ease-in-out;
        box-shadow: var(--dv-shadow-lg);
    }

    .dv-shell.dv-drawer-open .dv-sidebar {
        transform: translateX(0);
    }

    .dv-shell.dv-drawer-open .dv-scrim {
        display: block;
    }

    /* The rail is a desktop idea. On a tablet the drawer is always full width. */
    .dv-shell.dv-rail .dv-brand-text,
    .dv-shell.dv-rail .dv-nav-label,
        .dv-shell.dv-rail .dv-nav-caret,
    .dv-shell.dv-rail .dv-sidebar-user-text {
        display: block;
    }

    .dv-shell.dv-rail .dv-nav-item,
    .dv-shell.dv-rail .dv-sidebar-user {
        justify-content: flex-start;
        gap: 11px;
        padding-left: 10px;
    }

    .dv-shell.dv-rail .dv-brand-row {
        flex-direction: row;
    }

    .dv-shell.dv-rail .dv-nav-group-label {
        height: auto;
        width: auto;
        background: none;
        color: rgba(255, 255, 255, 0.32);
        padding: var(--dv-space-4) 10px var(--dv-space-1);
        margin: 0;
    }

    .dv-rail-toggle {
        display: none;
    }

    .dv-main,
    .dv-shell.dv-rail .dv-main,
    .dv-pre-collapsed .dv-main {
        margin-left: 0;
    }

    .dv-hamburger {
        display: inline-flex;
    }

    .dv-appbar,
    .dv-content {
        padding-left: var(--dv-space-3);
        padding-right: var(--dv-space-3);
    }
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.btn {
    border-radius: var(--dv-radius-sm);
    font-weight: 600;
    transition: all 0.18s ease;
    /* A thumb on a tablet, not a mouse pointer. */
    min-height: 42px;
}

.btn-sm {
    font-size: 0.8rem;
    padding: 7px 15px;
    min-height: 38px;
}

/* A link dressed as a button, in a table row or beside a heading, keeps its
   own size. */
.btn-link.table-action-link,
.btn-link.p-0 {
    min-height: 0;
}

/* Blue is action, per the brand guide. */
.btn-primary {
    background: linear-gradient(135deg, var(--dv-blue-bright), var(--dv-blue));
    border: none;
    color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(8, 138, 112, 0.28);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background: linear-gradient(135deg, var(--dv-blue), var(--dv-blue-deep));
    color: #FFFFFF;
    box-shadow: 0 4px 14px rgba(8, 138, 112, 0.36);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--dv-surface);
    border: 1px solid var(--dv-line);
    color: var(--dv-text);
}

.btn-secondary:hover,
.btn-secondary:focus,
.btn-secondary:active {
    background: var(--dv-tint-blue);
    border-color: rgba(8, 138, 112, 0.35);
    color: var(--dv-blue-deep);
}

.btn-danger {
    background: var(--dv-danger);
    border-color: var(--dv-danger);
}

.btn-danger:hover,
.btn-danger:focus {
    background: #B91C1C;
    border-color: #B91C1C;
}

.btn:focus-visible {
    box-shadow: 0 0 0 0.2rem rgba(8, 138, 112, 0.3);
    outline: none;
}

/* ==========================================================================
   FORMS
   ========================================================================== */

.form-control,
.form-select {
    border: 1px solid var(--dv-field-line);
    border-radius: var(--dv-radius-sm);
    font-size: 0.92rem;
    color: var(--dv-text);
    background-color: var(--dv-surface);
    min-height: var(--dv-tap);
    padding: 0.55rem 0.8rem;
}

/* A box inside a table row or a toolbar stays compact, and keeps the same
   edge so it still reads as a box. */
.form-control-sm,
.form-select-sm {
    border: 1px solid var(--dv-field-line);
    border-radius: var(--dv-radius-sm);
    min-height: 40px;
}

.form-control:hover,
.form-select:hover,
.form-control-sm:hover,
.form-select-sm:hover {
    border-color: var(--dv-field-hover);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--dv-blue);
    box-shadow: 0 0 0 0.2rem rgba(8, 138, 112, 0.2);
}

.form-control::placeholder {
    color: #98A2B3;
}

/* The unit beside a box, such as the m on an instructed quantity, carries the
   same edge and height as the box itself. */
.input-group-text {
    border: 1px solid var(--dv-field-line);
    background: var(--dv-canvas);
    color: var(--dv-text);
    font-weight: 600;
}

.input-group > .form-control,
.input-group > .form-select {
    min-height: var(--dv-tap);
}

textarea.form-control {
    min-height: 140px;
}

.col-form-label,
.form-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--dv-navy);
}

/* Leon, 17 September 2026: no up and down arrows on a quantity. They are a
   mouse control, they sit under a thumb on a tablet, and a quantity is typed
   rather than nudged one at a time. */
input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

/* A tick box carries the same soft corner as the boxes around it. A radio
   stays round. */
.form-check-input {
    width: 1.3rem;
    height: 1.3rem;
    border: 1px solid #C4C9D1;
}

.form-check-input[type="checkbox"] {
    border-radius: 5px;
}

.form-check-label {
    font-size: 0.9rem;
}

.form-check-input:checked {
    background-color: var(--dv-blue);
    border-color: var(--dv-blue);
}

.form-text {
    color: var(--dv-text-muted);
    font-size: 0.78rem;
}

.text-danger {
    color: var(--dv-danger) !important;
    font-size: 0.8rem;
}

/* ==========================================================================
   TABLES
   ========================================================================== */

/* Sprint 4, Leon's change of 25 October 2026, as RADAR's Sprint 9 Task 9.12:
   no table ever scrolls sideways. The box no longer scrolls: its table fits,
   its cells wrap, and below desktop width a list drops its least needed
   columns (dv-col-tablet-hide and dv-col-hide, below). */
.table-wrapper {
    background: var(--dv-surface);
    border-radius: var(--dv-radius);
    box-shadow: var(--dv-shadow);
    overflow: hidden;
}

.table {
    margin-bottom: 0;
    border-collapse: collapse;
}

/* Table headers use the same chrome family as the sidebar, so the whole
   portal reads as one colour scheme. */
.table > thead th,
.table thead th {
    background: linear-gradient(90deg, var(--dv-chrome-from), var(--dv-chrome-mid));
    color: #FFFFFF;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.68rem;
    letter-spacing: 0.4px;
    padding: 9px 8px;
    border-bottom: none;
    border-top: none;
    vertical-align: middle;
    /* As RADAR's Task 9.12: a heading may wrap, so it never widens its table. */
    white-space: normal;
}

.table > tbody td,
.table tbody td {
    font-size: 0.85rem;
    padding: 8px 8px;
    border-top: 1px solid var(--dv-line);
    border-bottom: none;
    border-color: var(--dv-line);
    vertical-align: middle;
    color: var(--dv-text);
}

.table > tbody > tr:first-child > td {
    border-top: none;
}

.table-hover > tbody > tr:hover > * {
    background-color: var(--dv-tint-blue);
    color: var(--dv-navy);
}

.table-striped > tbody > tr:nth-of-type(odd) > *,
.table-striped > tbody > tr:nth-of-type(even) > * {
    background-color: var(--dv-surface);
}

.table-action-link {
    color: var(--dv-blue);
    font-weight: 600;
    font-size: 0.8rem;
    text-decoration: none;
    white-space: nowrap;
}

.table-action-link:hover {
    color: var(--dv-blue-deep);
    text-decoration: underline;
}

/* SNAG S4. A delete is a POST now, so the control beside Edit and View is a
   submit button rather than a link. It has to read as the same thing, so the
   browser's own button chrome comes off and .table-action-link does the rest.
   The tap target rule still applies: nothing here changes its size. */
.dv-link-button {
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    font: inherit;
    line-height: inherit;
    cursor: pointer;
    vertical-align: baseline;
}

.dv-link-button:focus-visible {
    outline: 2px solid var(--dv-blue);
    outline-offset: 2px;
}

/* SNAG S11. A message can be a paragraph of SQL Server's own words, so it
   wraps rather than pushing the table sideways, and the stack trace keeps its
   line breaks and scrolls inside its own box. */
.dv-error-message {
    max-width: 40rem;
    word-break: break-word;
}

.dv-error-detail {
    font-size: 0.72rem;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 22rem;
    overflow: auto;
}

.table-action-sep {
    color: var(--dv-line);
    margin: 0 3px;
}

/* --- Sortable --- */
.sortable th {
    cursor: pointer;
    position: relative;
    user-select: none;
    padding-right: 24px;
}

.sortable th:hover {
    background: linear-gradient(90deg, var(--dv-chrome-mid), var(--dv-chrome-to));
}

.sortable th::after {
    content: '\2195';
    position: absolute;
    right: 9px;
    opacity: 0.4;
    font-size: 0.7rem;
}

.sortable th.sort-asc::after {
    content: '\2191';
    opacity: 1;
}

.sortable th.sort-desc::after {
    content: '\2193';
    opacity: 1;
}

.sortable th.no-sort {
    cursor: default;
    padding-right: 12px;
}

.sortable th.no-sort::after {
    content: '';
}

.sortable th.no-sort:hover {
    background: linear-gradient(90deg, var(--dv-chrome-from), var(--dv-chrome-mid));
}

/* ==========================================================================
   CARDS, PAGE HEADER, KPI TILES
   ========================================================================== */

.dv-page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--dv-space-3);
    margin-bottom: var(--dv-space-2);
}

.dv-page-head h4 {
    margin: 0;
}

.dv-page-sub {
    font-size: 0.8rem;
    color: var(--dv-text-muted);
}

.dv-card,
.card {
    background: var(--dv-surface);
    border: 1px solid var(--dv-card-line);
    border-radius: var(--dv-radius);
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.06);
}

.dv-card {
    padding: var(--dv-space-5);
    margin-bottom: var(--dv-space-4);
}

/* The card's own heading sits on a tinted strip across the top of the panel,
   whether it stands alone or shares its row with a button. Leon, 18 September
   2026: the round's Route Position panel is an ordinary card now, so it takes
   the strip with the rest of them. */
.dv-card > .dv-card-heading,
.dv-card > div:first-child:has(> .dv-card-heading) {
    background: #FAFAFB;
    border-bottom: 1px solid #E5E7EB;
    margin: calc(var(--dv-space-5) * -1) calc(var(--dv-space-5) * -1) var(--dv-space-5);
    padding: var(--dv-space-4) var(--dv-space-5);
    border-radius: calc(var(--dv-radius) - 1px) calc(var(--dv-radius) - 1px) 0 0;
}

.dv-card > div:first-child:has(> .dv-card-heading) > .dv-card-heading {
    margin: 0;
    padding: 0;
    background: none;
    border-bottom: none;
}

.dv-card-heading {
    font-family: var(--dv-font-head);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.9px;
    color: var(--dv-navy);
    margin-bottom: var(--dv-space-4);
    padding-bottom: var(--dv-space-3);
    border-bottom: 1px solid var(--dv-line);
    display: flex;
    align-items: center;
    gap: var(--dv-space-2);
}

.dv-card-heading::before {
    content: '';
    width: 3px;
    height: 14px;
    background: linear-gradient(180deg, var(--dv-blue-bright), var(--dv-green));
    border-radius: var(--dv-radius-pill);
    flex-shrink: 0;
}

/* --- KPI tiles --- */
.dv-kpi {
    display: block;
    background: var(--dv-surface);
    border: none;
    border-radius: var(--dv-radius);
    box-shadow: var(--dv-shadow);
    /* Tightened: these sit above the content on every register and were
       costing about a third of the fold before anything useful appeared. */
    padding: var(--dv-space-3) var(--dv-space-4);
    height: 100%;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

/* A colour bar down the leading edge rather than a heavy underline. */
.dv-kpi::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--dv-blue);
}

a.dv-kpi:hover {
    box-shadow: var(--dv-shadow-hover);
    transform: translateY(-3px);
    text-decoration: none;
}

.dv-kpi-navy::before  { background: linear-gradient(180deg, var(--dv-navy), var(--dv-navy-soft)); }
.dv-kpi-blue::before  { background: linear-gradient(180deg, var(--dv-blue-bright), var(--dv-blue)); }
.dv-kpi-green::before { background: linear-gradient(180deg, var(--dv-green), var(--dv-green-deep)); }
.dv-kpi-grey::before  { background: linear-gradient(180deg, #A2A5AC, var(--dv-grey)); }

.dv-kpi-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--dv-space-3);
}

/* Circular icon chip, echoing the round icons on the Daveng website. */
.dv-kpi-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--dv-tint-blue);
    color: var(--dv-blue);
}

.dv-kpi-icon svg {
    width: 16px;
    height: 16px;
}

.dv-kpi-navy  .dv-kpi-icon { background: var(--dv-tint-navy);  color: var(--dv-navy); }
.dv-kpi-blue  .dv-kpi-icon { background: var(--dv-tint-blue);  color: var(--dv-blue); }
.dv-kpi-green .dv-kpi-icon { background: var(--dv-tint-green); color: var(--dv-green-deep); }
.dv-kpi-grey  .dv-kpi-icon { background: var(--dv-line-soft);  color: var(--dv-grey); }

.dv-kpi-value {
    font-family: var(--dv-font-head);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--dv-navy);
    line-height: 1.1;
    letter-spacing: -0.5px;
}

.dv-kpi-label {
    font-size: 0.62rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--dv-text-muted);
    margin-top: 2px;
}

.dv-kpi-hint {
    font-size: 0.72rem;
    color: var(--dv-text-muted);
    margin-top: var(--dv-space-2);
    padding-top: var(--dv-space-2);
    border-top: 1px solid var(--dv-line);
}

.dv-kpi-placeholder {
    background: transparent;
    border: 1px dashed var(--dv-line);
    box-shadow: none;
    opacity: 0.8;
}

.dv-kpi-placeholder::before {
    display: none;
}

.dv-kpi-placeholder .dv-kpi-value,
.dv-kpi-placeholder .dv-kpi-label {
    color: var(--dv-grey);
}

.dv-kpi-placeholder .dv-kpi-icon {
    background: var(--dv-line-soft);
    color: var(--dv-line);
}

/* ==========================================================================
   STATUS BADGES
   ========================================================================== */

/* Sprint 4, Leon's change of 25 October 2026, as RADAR's Sprint 9 Task 9.12:
   the badge is smaller and reads in sentence case, as it is written. */
.dv-badge {
    display: inline-block;
    font-family: var(--dv-font-head);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1px;
    padding: 2px 8px;
    border-radius: var(--dv-radius-pill);
    white-space: nowrap;
    line-height: 1.45;
}

.dv-badge-good    { background: var(--dv-tint-green); color: var(--dv-green-deep); }
.dv-badge-fair    { background: var(--dv-tint-amber); color: #B4700A; }
.dv-badge-poor    { background: var(--dv-tint-red);   color: #B91C1C; }
.dv-badge-info    { background: var(--dv-tint-blue);  color: var(--dv-blue-deep); }
.dv-badge-neutral { background: var(--dv-line-soft);  color: var(--dv-text-muted); }

/* ==========================================================================
   LIST TOOLBAR
   ========================================================================== */

.dv-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: var(--dv-space-2);
    margin-bottom: var(--dv-space-4);
}

.dv-toolbar-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--dv-space-2);
}

.dv-search {
    width: 260px;
}

.dv-filter-select {
    width: 180px;
}

.dv-actions-col {
    width: 220px;
}

.dv-tick-col {
    width: 80px;
}

.dv-icon-btn {
    padding: 6px 8px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

.dv-icon-btn img {
    width: 20px;
    height: 20px;
    display: block;
}

.dv-viewswitch {
    display: inline-flex;
    border: 1px solid var(--dv-line);
    border-radius: var(--dv-radius-sm);
    overflow: hidden;
    background: var(--dv-surface);
}

.dv-viewswitch a {
    padding: 7px 14px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--dv-text-muted);
    text-decoration: none;
    border-right: 1px solid var(--dv-line);
}

.dv-viewswitch a:last-child {
    border-right: none;
}

.dv-viewswitch a.active {
    background: var(--dv-blue);
    color: #FFFFFF;
}

.dv-viewswitch a:hover:not(.active) {
    background: var(--dv-tint-blue);
    color: var(--dv-blue-deep);
    text-decoration: none;
}

/* ==========================================================================
   EMPTY STATE
   ========================================================================== */

.dv-empty {
    background: var(--dv-surface);
    border: 1px dashed var(--dv-line);
    border-radius: var(--dv-radius);
    padding: var(--dv-space-6) var(--dv-space-5);
    text-align: center;
}

.dv-empty-title {
    font-family: var(--dv-font-head);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--dv-navy);
    margin-bottom: var(--dv-space-2);
}

.dv-empty-text {
    font-size: 0.87rem;
    color: var(--dv-text-muted);
    margin-bottom: var(--dv-space-4);
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

/* ==========================================================================
   DETAIL PATTERN
   ========================================================================== */

.dv-detail-head {
    background: linear-gradient(125deg, var(--dv-chrome-from) 0%, var(--dv-chrome-mid) 55%, var(--dv-chrome-to) 100%);
    border-radius: var(--dv-radius);
    box-shadow: var(--dv-shadow);
    padding: var(--dv-space-5);
    margin-bottom: var(--dv-space-4);
    color: rgba(255, 255, 255, 0.85);
    position: relative;
    overflow: hidden;
}

.dv-detail-head::after {
    content: '';
    position: absolute;
    right: -60px;
    top: -80px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(11, 157, 128, 0.28), transparent 70%);
    pointer-events: none;
}

.dv-detail-head-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: var(--dv-space-3);
    margin-bottom: var(--dv-space-4);
    position: relative;
}

.dv-detail-number {
    font-family: var(--dv-font-head);
    font-size: 1.5rem;
    font-weight: 800;
    color: #FFFFFF;
    letter-spacing: -0.4px;
    line-height: 1.1;
}

.dv-detail-name {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.72);
    margin-top: 3px;
}

.dv-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--dv-space-5);
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.6);
    position: relative;
}

.dv-detail-meta strong {
    color: #FFFFFF;
    font-weight: 600;
}

.dv-detail-actions {
    margin-left: auto;
    display: flex;
    flex-wrap: wrap;
    gap: var(--dv-space-2);
    align-items: center;
}

.dv-tabs {
    display: flex;
    gap: 4px;
    background: var(--dv-surface);
    border-radius: var(--dv-radius);
    box-shadow: var(--dv-shadow);
    padding: 5px;
    margin-bottom: var(--dv-space-4);
    overflow-x: auto;
}

.dv-tab {
    padding: 9px 18px;
    font-family: var(--dv-font-head);
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--dv-text-muted);
    text-decoration: none;
    border-radius: var(--dv-radius-sm);
    white-space: nowrap;
    transition: all 0.15s ease;
}

.dv-tab:hover {
    color: var(--dv-navy);
    background: var(--dv-line-soft);
    text-decoration: none;
}

.dv-tab.active {
    color: #FFFFFF;
    background: linear-gradient(135deg, var(--dv-blue-bright), var(--dv-blue));
    box-shadow: 0 2px 8px rgba(8, 138, 112, 0.3);
}

.dv-tab.disabled {
    color: #C3C8D4;
    pointer-events: none;
}

/* A count carried on a tab, for example the number of assets on a project. */
.dv-tab-count {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: var(--dv-radius-pill);
    background: var(--dv-line-soft);
    color: var(--dv-text-muted);
    font-size: 0.68rem;
    font-weight: 800;
}

.dv-tab.active .dv-tab-count {
    background: rgba(255, 255, 255, 0.24);
    color: #FFFFFF;
}

/* ==========================================================================
   LABEL / VALUE ROWS
   ========================================================================== */

.dv-rows {
    display: block;
}

.dv-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--dv-space-3);
    padding: 9px 0;
    border-bottom: 1px solid var(--dv-line-soft);
    font-size: 0.85rem;
}

.dv-row:last-child {
    border-bottom: none;
}

.dv-row-label {
    color: var(--dv-text-muted);
    font-size: 0.8rem;
    /* Short labels hold their width; a long one - the recent activity list
       carries whole sentences - wraps rather than pushing the page sideways.
       Snag 26: it wraps between words only and is never narrower than its
       longest word, so "Description" is never split. */
    flex: 0 1 auto;
    min-width: min-content;
    overflow-wrap: break-word;
}

.dv-row-value {
    font-weight: 600;
    color: var(--dv-text);
    text-align: right;
}

.dv-row-time {
    font-size: 0.73rem;
    color: var(--dv-text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

/* ==========================================================================
   TEAM COLUMNS AND CHECKLIST
   ========================================================================== */

.dv-team-col {
    background: var(--dv-surface);
    border: none;
    border-top: 3px solid var(--dv-line);
    border-radius: var(--dv-radius);
    box-shadow: var(--dv-shadow);
    padding: var(--dv-space-4);
    height: 100%;
}

.dv-team-col.client      { border-top-color: var(--dv-blue-bright); }
.dv-team-col.consultant  { border-top-color: var(--dv-navy); }
.dv-team-col.contractor  { border-top-color: var(--dv-green); }

.dv-team-col-head {
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--dv-text-muted);
    margin-bottom: var(--dv-space-3);
}

.dv-team-member {
    padding: var(--dv-space-3) 0;
    border-bottom: 1px solid var(--dv-line-soft);
}

.dv-team-member:last-child {
    border-bottom: none;
}

.dv-team-name {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--dv-navy);
}

.dv-team-role {
    font-size: 0.76rem;
    color: var(--dv-blue);
    font-weight: 600;
}

.dv-team-contact {
    font-size: 0.75rem;
    color: var(--dv-text-muted);
}

.dv-check {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 10px 0;
    border-bottom: 1px solid var(--dv-line-soft);
    font-size: 0.85rem;
}

.dv-check:last-of-type {
    border-bottom: none;
}

.dv-check-mark {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
    color: #FFFFFF;
    background: var(--dv-line);
    margin-top: 1px;
}

.dv-check.done .dv-check-mark {
    background: linear-gradient(135deg, var(--dv-green), var(--dv-green-deep));
}

.dv-check.done .dv-check-text {
    color: var(--dv-text-muted);
}

.dv-check-text {
    color: var(--dv-text);
}

/* ==========================================================================
   GROUPED CARD CAPTURE
   The second capture pattern: long forms broken into cards with the label
   stacked above its control, rather than the horizontal row layout used for
   short forms. See Build/ScreenPatterns.md.
   ========================================================================== */

.dv-field {
    margin-bottom: var(--dv-space-4);
}

.dv-field > .form-label {
    margin-bottom: 5px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--dv-navy);
}

.dv-field .form-text {
    margin-top: 5px;
}

/* A value the portal owns and the user cannot type over. */
.dv-readonly {
    background: var(--dv-line-soft);
    font-family: var(--dv-font-head);
    font-weight: 700;
    color: var(--dv-navy);
}

.dv-readonly:focus {
    background: var(--dv-line-soft);
    box-shadow: none;
}

/* Action bar under a grouped card form. */
.dv-form-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: var(--dv-space-3);
    margin-top: var(--dv-space-4);
    padding: var(--dv-space-4);
    background: var(--dv-surface);
    border-radius: var(--dv-radius);
    box-shadow: var(--dv-shadow);
}

/* Condition segmented control. Built from radio inputs so it posts without
   script, and coloured from the same status palette used everywhere else. */
.dv-cond-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--dv-space-2);
}

.dv-cond-btn {
    flex: 1 1 0;
    min-width: 90px;
    text-align: center;
    padding: 10px var(--dv-space-3);
    border-radius: var(--dv-radius-sm);
    border: 1px solid transparent;
    font-family: var(--dv-font-head);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.dv-cond-btn:hover {
    filter: brightness(0.96);
}

/* Unselected: the soft status tint. Selected: the full status colour. */
.dv-cond-btn.dv-badge-good    { background: var(--dv-tint-green); color: var(--dv-green-deep); }
.dv-cond-btn.dv-badge-fair    { background: var(--dv-tint-amber); color: #B4700A; }
.dv-cond-btn.dv-badge-poor    { background: var(--dv-tint-red);   color: #B91C1C; }
.dv-cond-btn.dv-badge-info    { background: var(--dv-tint-blue);  color: var(--dv-blue-deep); }
.dv-cond-btn.dv-badge-neutral { background: var(--dv-line-soft);  color: var(--dv-text-muted); }

.btn-check:checked + .dv-cond-btn.dv-badge-good {
    background: var(--dv-green-deep);
    color: #FFFFFF;
    box-shadow: 0 2px 10px rgba(94, 155, 44, 0.35);
}

.btn-check:checked + .dv-cond-btn.dv-badge-fair {
    background: var(--dv-warning);
    color: #FFFFFF;
    box-shadow: 0 2px 10px rgba(232, 147, 12, 0.35);
}

.btn-check:checked + .dv-cond-btn.dv-badge-poor {
    background: var(--dv-danger);
    color: #FFFFFF;
    box-shadow: 0 2px 10px rgba(220, 38, 38, 0.35);
}

.btn-check:checked + .dv-cond-btn.dv-badge-info {
    background: var(--dv-blue);
    color: #FFFFFF;
}

.btn-check:checked + .dv-cond-btn.dv-badge-neutral {
    background: var(--dv-grey);
    color: #FFFFFF;
}

.btn-check:focus-visible + .dv-cond-btn {
    border-color: var(--dv-blue);
    box-shadow: 0 0 0 0.2rem rgba(8, 138, 112, 0.25);
}

/* Extent, Task 7. A 1 to 5 scale with no words behind it, so it must not
   borrow the condition palette: green on a "1" would read as good news when
   it only means a small area. Neutral until chosen, blue when chosen, the
   same treatment the app already gives a plain selection. */
.dv-cond-btn.dv-extent-btn {
    background: var(--dv-line-soft);
    color: var(--dv-text-muted);
    min-width: 3rem;
    font-variant-numeric: tabular-nums;
}

.btn-check:checked + .dv-cond-btn.dv-extent-btn {
    background: var(--dv-blue);
    color: #FFFFFF;
    box-shadow: 0 2px 10px rgba(8, 138, 112, 0.3);
}

/* Degree and Extent on a defect read as a pair, "D4 / E3", so the two badges
   sit tight together with the separator between them. */
.dv-scale-pair {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
}

.dv-scale-pair .dv-scale-sep {
    color: var(--dv-text-muted);
    font-size: 0.75rem;
}

/* A capability that arrives in a later release, shown so the shape of the
   screen is clear without pretending it works. */
.dv-photo-placeholder {
    border: 1px dashed var(--dv-line);
    border-radius: var(--dv-radius-sm);
    padding: var(--dv-space-4);
    text-align: center;
    font-size: 0.8rem;
    color: var(--dv-text-muted);
    background: var(--dv-canvas);
}

/* ==========================================================================
   LOGIN
   ========================================================================== */

.dv-login-canvas {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--dv-space-5) var(--dv-space-3);
    background:
        radial-gradient(1200px 520px at 12% -12%, rgba(11, 157, 128, 0.14), transparent 62%),
        radial-gradient(900px 440px at 108% 112%, rgba(233, 201, 63, 0.14), transparent 62%),
        var(--dv-canvas);
}

.dv-login-card {
    width: 100%;
    max-width: 410px;
    background: var(--dv-surface);
    border: none;
    border-radius: var(--dv-radius);
    box-shadow: var(--dv-shadow-lg);
    padding: var(--dv-space-6) var(--dv-space-5) var(--dv-space-5);
    position: relative;
    overflow: hidden;
}

.dv-login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--dv-navy), var(--dv-blue-bright) 55%, var(--dv-green));
}

.dv-login-logo {
    display: block;
    max-width: 220px;
    width: 100%;
    height: auto;
    margin: 0 auto var(--dv-space-5);
}

.dv-login-product {
    text-align: center;
    margin-bottom: var(--dv-space-5);
    padding-top: var(--dv-space-4);
    position: relative;
}

.dv-login-product::before {
    content: '';
    position: absolute;
    top: 0;
    left: 15%;
    right: 15%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--dv-blue-bright), var(--dv-green), transparent);
}

.dv-login-product-name {
    display: block;
    font-family: var(--dv-font-head);
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 6px;
    color: var(--dv-navy);
    text-indent: 6px;
    line-height: 1.1;
}

.dv-login-product-expansion {
    display: block;
    font-size: 0.64rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--dv-text-muted);
    margin-top: var(--dv-space-1);
}

.dv-login-title {
    font-family: var(--dv-font-head);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: var(--dv-text-muted);
    text-align: center;
    margin-bottom: var(--dv-space-5);
}

.dv-login-footnote {
    text-align: center;
    font-size: 0.7rem;
    color: var(--dv-text-muted);
    margin-top: var(--dv-space-4);
}

/* ==========================================================================
   ALERTS, TOASTS, MODALS
   ========================================================================== */

.alert {
    font-size: 0.875rem;
    border-radius: var(--dv-radius);
    border-width: 1px;
}

.alert-danger {
    background: var(--dv-tint-red);
    border-color: #F6BDBD;
    color: #991B1B;
}

.dv-toast-host {
    position: fixed;
    top: calc(var(--dv-appbar-h) + var(--dv-space-4));
    left: 50%;
    transform: translateX(-50%);
    z-index: 1100;
}

.toast.bg-success {
    background: var(--dv-navy) !important;
    border-left: 4px solid var(--dv-green);
    border-radius: var(--dv-radius);
    box-shadow: var(--dv-shadow-lg);
}

.modal-content {
    border: none;
    border-radius: var(--dv-radius);
    box-shadow: var(--dv-shadow-lg);
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(120deg, var(--dv-chrome-from), var(--dv-chrome-to));
    color: #FFFFFF;
    border-bottom: none;
    padding: var(--dv-space-4) var(--dv-space-5);
}

.modal-title {
    font-family: var(--dv-font-head);
    font-size: 0.88rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: #FFFFFF;
}

.modal-header .btn-close {
    filter: invert(1) grayscale(1) brightness(2);
}

.modal-body {
    padding: var(--dv-space-5);
}

.modal-footer {
    border-top: 1px solid var(--dv-line);
    padding: var(--dv-space-3) var(--dv-space-5);
}

/* PDF preview. The viewer needs real height, so the body is sized against the
   viewport rather than growing with its content. */
.dv-pdf-modal {
    height: 88vh;
}

.dv-pdf-body {
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.dv-pdf-frame {
    flex: 1 1 auto;
    width: 100%;
    border: none;
    background: var(--dv-line-soft);
}

.dv-pdf-status {
    padding: var(--dv-space-6);
    text-align: center;
    margin: auto;
}

.dropdown-menu {
    border: none;
    border-radius: var(--dv-radius);
    box-shadow: var(--dv-shadow-lg);
    padding: var(--dv-space-2);
}

.dropdown-item {
    border-radius: var(--dv-radius-sm);
    font-size: 0.85rem;
    padding: 8px 10px;
}

.dropdown-item:hover {
    background: var(--dv-tint-blue);
    color: var(--dv-blue-deep);
}

/* ==========================================================================
   UTILITY
   ========================================================================== */

.dv-muted {
    color: var(--dv-text-muted);
    font-size: 0.82rem;
}

.dv-scope-note {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--dv-blue-deep);
    background: var(--dv-tint-blue);
    border-radius: var(--dv-radius-pill);
    padding: 4px 12px;
    display: inline-block;
}

.dv-warn-text {
    color: var(--dv-warning);
    font-weight: 600;
}

/* ==========================================================================
   FIELD USE - tablet friendly tap targets, high contrast
   ========================================================================== */

@media (max-width: 992px) {
    .btn,
    .form-control,
    .form-select {
        min-height: var(--dv-tap);
    }

    .dv-icon-btn {
        min-width: var(--dv-tap);
        justify-content: center;
    }

    .table > tbody td,
    .table tbody td {
        padding: 12px;
        font-size: 0.9rem;
    }

    .table-action-link {
        font-size: 0.85rem;
        display: inline-block;
        padding: 4px 0;
    }

    .dv-search,
    .dv-filter-select {
        width: 100%;
    }

    .dv-toolbar-group {
        width: 100%;
    }

    .dv-nav-item,
    .dv-sidebar-user {
        min-height: var(--dv-tap);
    }
}

@media print {
    .dv-sidebar,
    .dv-appbar,
    .dv-footer,
    .dv-toolbar {
        display: none !important;
    }

    .dv-main {
        margin-left: 0;
    }
}


/* ==========================================================================
   RELEASE 2

   Everything below belongs to the Release 2 modules: attachments, the
   notification bell, roads, the Master List, inspections, defects and
   instructions. It follows the same rules as the rest of this file - no
   literal colours, no literal spacing, tap targets at least --dv-tap on
   touch, and every wide table scrolls inside its own box rather than
   pushing the page sideways.
   ========================================================================== */


/* --------------------------------------------------------------------------
   SHARED UTILITIES
   -------------------------------------------------------------------------- */

/* Present to a screen reader, invisible on screen. */
.dv-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Money and quantities line up on the decimal, so they are read down a column
   rather than across a row. */
.dv-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Leon, 18 September 2026: a figure in a table never breaks across two lines.
   R 2 205.00 was reading as "R 2" over "205.00" in a squeezed total. */
.table td.dv-num,
.table th.dv-num {
    white-space: nowrap;
}

.dv-num-input {
    text-align: right;
    font-variant-numeric: tabular-nums;
    max-width: 7rem;
}

/* A rate or a total must never be shortened with an ellipsis - a truncated
   amount is worse than no amount. */
/* Leon, 18 September 2026: dv-no-truncate also says "never wrap", which is
   right for a figure or a reference and wrong for a sentence: a description
   then held its column open and pushed the columns after it off the edge.
   Add dv-wrap beside it for text that should keep every word but may run onto
   a second line. */
.dv-no-truncate.dv-wrap {
    white-space: normal;
}

.dv-no-truncate {
    max-width: none;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
}

/* The capture form wrapper. Gives every long form the same bottom room so the
   sticky action bar never covers the last field. */
.dv-capture {
    padding-bottom: var(--dv-space-6);
}

.dv-appbar-end {
    display: flex;
    align-items: center;
    gap: var(--dv-space-2);
    margin-left: auto;
}

/* A single line of reason text sitting next to the button that needs it. */
.dv-reason {
    min-width: 16rem;
    flex: 1 1 16rem;
}

/* Why something was reopened, cancelled or closed. Stated, not hidden. */
.dv-reopen-note {
    padding: var(--dv-space-2) var(--dv-space-3);
    border-left: 3px solid var(--dv-warning);
    border-radius: var(--dv-radius-sm);
    background: var(--dv-tint-amber);
    font-size: 0.82rem;
    color: var(--dv-text);
}

.dv-section-heading {
    font-family: var(--dv-font-head);
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--dv-text-muted);
    margin: var(--dv-space-5) 0 var(--dv-space-3) 0;
}

/* Controls that belong on one line above a table. */
.dv-rows-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: var(--dv-space-2);
}

.dv-checkgroup {
    display: flex;
    flex-wrap: wrap;
    gap: var(--dv-space-2) var(--dv-space-5);
}

/* Good / Fair / Poor as three large targets, not a dropdown. An inspector is
   using this one-handed on a tablet at the roadside. The buttons themselves
   are .dv-cond-btn, styled further up; this only lays them out and guarantees
   the tap height, which .dv-cond-btn's padding alone does not. */
.dv-cond-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--dv-space-2);
}

.dv-cond-row .dv-cond-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: var(--dv-tap);
    margin: 0;
}

.dv-cond-row .btn-check:focus-visible + .dv-cond-btn {
    outline: 2px solid var(--dv-blue);
    outline-offset: 2px;
}

.dv-total-row {
    background: var(--dv-canvas);
    font-weight: 700;
}

.dv-avatar-sm {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--dv-tint-navy);
    color: var(--dv-navy);
    font-size: 0.66rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.dv-edit-item {
    white-space: nowrap;
}

/* The CPA formula, shown as the client writes it. */
.dv-formula {
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: 0.78rem;
    background: var(--dv-canvas);
    border-radius: var(--dv-radius-sm);
    padding: var(--dv-space-2) var(--dv-space-3);
    color: var(--dv-text);
    overflow-x: auto;
}

/* A second row of tabs inside a tab. */
.dv-tabs-inner {
    display: flex;
    flex-wrap: wrap;
    gap: var(--dv-space-1);
    margin-bottom: var(--dv-space-4);
    border-bottom: 1px solid var(--dv-line);
}

.dv-tabs-inner .dv-tab {
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.8rem;
    padding: 7px 14px;
}


/* --------------------------------------------------------------------------
   KPI VARIANTS AND FACT STRIPS
   -------------------------------------------------------------------------- */

.dv-kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: var(--dv-space-3);
    margin-bottom: var(--dv-space-3);
}

.dv-kpi-note {
    font-size: 0.7rem;
    color: var(--dv-text-muted);
    margin-top: var(--dv-space-1);
}

.dv-kpi-red::before   { background: linear-gradient(180deg, var(--dv-danger), #B91C1C); }
.dv-kpi-amber::before { background: linear-gradient(180deg, var(--dv-warning), #B4700A); }

.dv-kpi-red .dv-kpi-icon   { background: var(--dv-tint-red);   color: #B91C1C; }
.dv-kpi-amber .dv-kpi-icon { background: var(--dv-tint-amber); color: #B4700A; }

/* One figure on a line, for use inside a card rather than across the top. */
.dv-kpi-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--dv-space-2);
    padding: var(--dv-space-2) 0;
    border-bottom: 1px solid var(--dv-line-soft);
}

.dv-kpi-inline:last-child { border-bottom: none; }

.dv-kpi-inline-label {
    font-size: 0.78rem;
    color: var(--dv-text-muted);
}

.dv-kpi-inline-value {
    font-family: var(--dv-font-head);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--dv-navy);
    font-variant-numeric: tabular-nums;
}

/* The facts that sit under a heading: label above, value below. */
/* The fact strip always sits INSIDE a card, so it carries no surface of its
   own. It used to be a white panel with its own shadow on a white card, which
   read as a box inside a box and put every value in 1rem heading bold. It now
   follows the asset register: a quiet grid of tinted cells, the label small and
   the value readable rather than shouted. Keep these two in step. */
.dv-fact-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--dv-space-2);
    margin-bottom: var(--dv-space-3);
}

.dv-fact {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    background: var(--dv-canvas);
    border-radius: var(--dv-radius-sm);
    padding: 8px 10px;
}

.dv-fact-label {
    font-size: 0.58rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--dv-text-muted);
    margin-bottom: 2px;
}

/* Unlike the asset card this wraps rather than truncating. A priority reading
   "Immediate - 0 to 2 days" or a contractor's full name is the reason the fact
   is on the card at all, so it is not worth clipping to keep the rows even. */
.dv-fact-value {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--dv-navy);
    min-width: 0;
    overflow-wrap: anywhere;
}


/* --------------------------------------------------------------------------
   ITEM CARDS
   The card half of the cards-versus-list pattern, used by the inspection,
   defect and instruction registers.
   -------------------------------------------------------------------------- */

/* ==========================================================================
   CARD GRID
   Every register that shows records as cards rather than as a table.

   C54. This was defined twice, here and 1300 lines earlier as two fixed
   columns with a media query of its own. Same specificity, so this one won at
   every width and the other was dead, along with its comment promising two
   cards across. One definition now, and it says what happens.

   A card is 310px at its narrowest and as many fit as the row allows, so a
   card is the same width on every register. auto-fill rather than auto-fit on
   purpose: with auto-fit a single record would stretch its card across the
   whole page. The last row carries the remainder, which is what a grid of
   cards is meant to look like.
   ========================================================================== */

.dv-card-grid {
    display: grid;
    /* Leon, 18 September 2026: 310 was too tight once a status badge ran to
       three words. */
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: var(--dv-space-4);
    align-items: stretch;   /* footers line up across a row */
}

/* See .dv-conduct: a grid item's automatic minimum lets wide content push the
   page sideways rather than being contained. */
.dv-card-grid > *,
.dv-kpi-row > *,
.dv-fact-strip > *,
.dv-sub-grid > *,
.dv-gallery-strip > *,
.dv-assign-strip > * {
    min-width: 0;
}

.dv-item-card {
    display: flex;
    flex-direction: column;
    background: var(--dv-surface);
    border-radius: var(--dv-radius);
    box-shadow: var(--dv-shadow);
    overflow: hidden;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.dv-item-card:hover {
    box-shadow: var(--dv-shadow-hover);
    transform: translateY(-1px);
}

/* A card or a row that opens when you click it. Leon, 5 September 2026.

   The class is added by initClickableRows to whatever actually has somewhere to
   go, so a card with nothing to open still looks inert. The name inside it is
   coloured like a link because that is the part a person aims at, and the whole
   surface responds so they do not have to. */
.dv-item-card.dv-clickable,
table.sortable tbody tr.dv-clickable {
    cursor: pointer;
}

.dv-item-card.dv-clickable .dv-item-card-number,
table.sortable tbody tr.dv-clickable td:first-child {
    color: var(--dv-blue);
}

.dv-item-card.dv-clickable:hover .dv-item-card-number,
table.sortable tbody tr.dv-clickable:hover td:first-child {
    text-decoration: underline;
}

table.sortable tbody tr.dv-clickable:hover {
    background: var(--dv-tint-blue);
}

/* The Open link stays. It is what a keyboard reaches, and on a touch screen it
   is a target that does not depend on hitting the card between its own
   controls. */

/* Leon, 18 September 2026: a long status, such as Completed - Awaiting
   Inspection, would not shrink, so it squeezed the record number until
   RP-0006 broke over two lines. The head wraps instead: the number and its
   sub line keep their room and a badge that does not fit drops under them. */
.dv-item-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: var(--dv-space-2);
    padding: var(--dv-space-4) var(--dv-space-4) var(--dv-space-2) var(--dv-space-4);
}

.dv-item-card-head > div:first-child {
    flex: 1 1 11rem;
    min-width: 0;
}

.dv-item-card-head > .dv-badge {
    flex: 0 0 auto;
}

/* The record number and any badge that qualifies it - Urgent, VO, a defect
   count - sit on one line together.

   Without this the badge is an inline-block, so its bottom edge lands on the
   number's text baseline and it hangs low, while the status badge beside it is
   a flex child of the head and aligns to the top. Two alignment models on one
   line, which is why Urgent and Draft never lined up. */
.dv-item-card-number {
    font-family: var(--dv-font-head);
    font-size: 1rem;
    font-weight: 800;
    color: var(--dv-navy);
    letter-spacing: -0.2px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--dv-space-2);
    /* The number itself never breaks mid reference. */
    white-space: nowrap;
    /* The row is pinned to the badge's own height: 0.65rem text at line-height
       1.5, plus its 4px padding top and bottom. That keeps the line the same
       height whatever the heading font's metrics are, so the status badge
       sitting at the head's flex-start lands on exactly the same line as the
       badges inside this one. Without it the taller of the two drives the row
       and the other drifts by a few pixels. */
    line-height: calc((0.65rem * 1.5) + 8px);
}

.dv-item-card-sub {
    font-size: 0.74rem;
    color: var(--dv-text-muted);
    margin-top: 2px;
}

.dv-item-card-body {
    flex: 1 1 auto;
    padding: 0 var(--dv-space-4) var(--dv-space-3) var(--dv-space-4);
    font-size: 0.8rem;
}

.dv-item-card-body dl,
.dv-item-card-body .dv-item-card-line {
    display: flex;
    justify-content: space-between;
    gap: var(--dv-space-2);
    margin: 0 0 var(--dv-space-1) 0;
}

.dv-item-card-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--dv-space-3);
    padding: var(--dv-space-3) var(--dv-space-4);
    border-top: 1px solid var(--dv-line-soft);
    background: var(--dv-canvas);
    font-size: 0.75rem;
    color: var(--dv-text-muted);
}

.dv-item-card-open {
    margin-left: auto;
    font-weight: 700;
    font-size: 0.75rem;
    text-decoration: none;
    white-space: nowrap;
}

.dv-item-card-open::after {
    content: " \2192";
}


/* --------------------------------------------------------------------------
   WIDE TABLES

   Sprint 4, Leon's change of 25 October 2026, as RADAR's Sprint 9 Task 9.12:
   no table scrolls sideways at any width, the phone included. A table never
   widens its page or its box.
   -------------------------------------------------------------------------- */

.table-wrapper {
    max-width: 100%;
}

/* Every table fills its box and never more: its cells wrap, a long word
   breaks rather than widen the table, and a money amount, a number or a date
   in its own column stays on one line. */
.table-wrapper > .table,
.table-wrapper > form > .table {
    width: 100%;
}

.table-wrapper .table th,
.table-wrapper .table td,
.table-wrapper .table td.dv-no-truncate {
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
}

.table-wrapper .table td.dv-num,
.table-wrapper .table th.dv-num,
.table-wrapper .table td.dv-nowrap {
    white-space: nowrap;
}

/* Snag 329. A badge stays whole on one line in a table at every width, its tick
   beside its word. Where a column is narrow, two badges stack, each whole. */
.table-wrapper .table .dv-badge {
    white-space: nowrap;
}

/* Below desktop width, each list drops its least needed columns. Never the
   record's number or name, its status or its main amount: a hidden column is
   still on the record's page and in the exports. */
@media (max-width: 1279.98px) {
    .dv-col-tablet-hide {
        display: none;
    }
}

@media (max-width: 1023.98px) {
    .dv-col-hide {
        display: none;
    }
}

/* A list of many columns keeps its last ones for a wide desktop screen. */
@media (max-width: 1599.98px) {
    .dv-col-wide-hide {
        display: none;
    }
}

/* Snag 99. The widest lists keep their least read columns for a full HD
   screen, so every other column reads in full on a laptop. The values are
   still on the record and in the exports. */
@media (min-width: 576px) and (max-width: 1919.98px) {
    .table .dv-col-fullhd-hide {
        display: none;
    }
}


/* --------------------------------------------------------------------------
   TABLET
   -------------------------------------------------------------------------- */

@media (max-width: 991.98px) {
    .dv-detail-split {
        grid-template-columns: 1fr;
    }

    /* The timeline moves above the detail on a narrow screen, because what
       happened to a defect is the first question asked about it. */
    .dv-detail-side {
        order: -1;
    }

    .dv-conduct {
        grid-template-columns: 1fr;
    }

    .dv-picker-list {
        max-height: 20rem;
    }

    .dv-classswitch {
        width: 100%;
    }

    .dv-classswitch a {
        flex: 1 1 auto;
        text-align: center;
    }
}


/* --------------------------------------------------------------------------
   PHONE
   -------------------------------------------------------------------------- */

@media (max-width: 767.98px) {
    /* One asset at a time. The picker shows until an asset is chosen, then the
       panel takes the screen and a back link returns to the list. Driven by
       .has-open on the wrapper, which the view sets server side from whether an
       asset is selected, so it works with JavaScript off. */
    .dv-conduct:not(.has-open) .dv-conduct-panel { display: none; }
    .dv-conduct.has-open .dv-conduct-picker { display: none; }
    .dv-conduct.has-open .dv-conduct-back { display: flex; }

    .dv-conduct-panel {
        padding: var(--dv-space-4);
    }

    .dv-conduct-actions .btn {
        flex: 1 1 100%;
    }

    .dv-fact-strip {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        padding: var(--dv-space-3);
        gap: var(--dv-space-3);
    }

    .dv-card-grid,
    .dv-kpi-row {
        grid-template-columns: 1fr;
    }

    .dv-gallery-strip {
        grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    }

    .dv-bell-menu {
        position: fixed;
        left: var(--dv-space-2);
        right: var(--dv-space-2);
        width: auto;
    }

    .dv-convert-bar {
        position: fixed;
        left: var(--dv-space-2);
        right: var(--dv-space-2);
        bottom: var(--dv-space-2);
        top: auto;
        margin: 0;
        z-index: 1030;
    }

    .dv-num-input {
        max-width: none;
    }

    .dv-reason {
        min-width: 0;
        flex: 1 1 100%;
    }
}


/* --------------------------------------------------------------------------
   Task 5, MT-8. The collapsing detail header.

   Leon, in the review: "you seeing all that information is not needed all the
   time ... the top bit of a project like this, like, we don't, this is not
   relevant. We can have like a little hide and expand." Dewlann made the same
   point about density.

   One implementation, applied by a class, rather than four copies across
   Project, Instruction, Repair and Defect.

   The record number and the status badge stay visible when collapsed. Those
   two are the reason anybody looks at the header at all, so hiding them would
   defeat the point of having one.
   ===================================================================== */
.dv-detail-meta.is-collapsed > span:not(.dv-keep) {
    display: none;
}

.dv-meta-toggle {
    background: none;
    border: 0;
    padding: 0 0.35rem;
    color: var(--dv-text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    line-height: 1;
}

.dv-meta-toggle:hover {
    color: var(--dv-blue);
}

/* A list of external references, e.g. the Stats SA releases on the CPA tab. */
.dv-link-list {
    list-style: none;
    padding: 0;
    margin: 0.25rem 0 0 0;
}

.dv-link-list li {
    padding: 0.15rem 0;
    font-size: 0.85rem;
}

.dv-link-list strong {
    display: inline-block;
    min-width: 5.5rem;
}

.dv-link-list .dv-muted {
    font-size: 0.8rem;
}

/* =====================================================================
   Task 36, MT-5. Field mode.

   Dewlann, in the review: "the moment we're on site, we need bigger icons, we
   need legacy options. We just need to focus on getting the data on the sheet."

   The reviewer of the Inspector login confirmed the responsive work is already
   sound, so this is not a responsiveness problem. It is a DENSITY problem: the
   same screen, correctly laid out for a tablet, still shows more than somebody
   standing on a road needs.

   So it is a class on <body> and nothing else. No parallel views: two copies of
   the conduct screen would diverge within a month.

   What it never does is hide something that cannot be reached another way, or
   change what a save does. It is the same system, quieter.
   ===================================================================== */
body.dv-field-mode {
    /* The theme routes every touch target through --dv-tap, and the FIELD USE
       block above already applies it below 992px. So field mode raises the
       variable rather than restating a list of selectors, which would fall out
       of date the first time a new control is added.

       42px to 54px. Measured, not guessed: at 42px the buttons were already
       reachable and field mode changed almost nothing, which is worse than not
       having it. */
    --dv-tap: 54px;
    font-size: 1.1rem;
}

/* And it has to hold above 992px as well. A tablet in landscape is 1024 wide
   and is still somebody standing next to a road. */
body.dv-field-mode .btn,
body.dv-field-mode .form-control,
body.dv-field-mode .form-select,
body.dv-field-mode .dv-nav-item,
body.dv-field-mode .dv-sidebar-user {
    min-height: var(--dv-tap);
}

body.dv-field-mode .btn,
body.dv-field-mode .form-control,
body.dv-field-mode .form-select {
    font-size: 1.05rem;
}

body.dv-field-mode .dv-icon-btn {
    min-width: var(--dv-tap);
}

body.dv-field-mode .dv-cond-btn {
    min-height: var(--dv-tap);
    min-width: 4.5rem;
    font-size: 1.1rem;
    padding: 0.6rem 1rem;
}

/* A tick box a gloved thumb can actually hit. */
body.dv-field-mode .form-check-input {
    width: 1.75rem;
    height: 1.75rem;
}

/* The KPI strip is a management view. On a road it is noise. */
body.dv-field-mode .dv-kpi,
body.dv-field-mode .dv-tab-count {
    display: none;
}

/* The detail header collapses to the number and the status. */
body.dv-field-mode .dv-detail-meta > span:not(.dv-keep) {
    display: none;
}

/* A table on a tablet becomes a stack of cards, because a horizontal scroll
   with one hand on a steering wheel is not a table. */
@media (max-width: 991.98px) {
    body.dv-field-mode .table-wrapper table thead {
        display: none;
    }

    body.dv-field-mode .table-wrapper table,
    body.dv-field-mode .table-wrapper tbody,
    body.dv-field-mode .table-wrapper tr,
    body.dv-field-mode .table-wrapper td {
        display: block;
        width: 100%;
    }

    /* Leon, 20 September 2026, on a phone: the stacked cards were wider than
       the screen, so the values sat off the right edge and a card of six
       figures looked empty. A table that has to scroll sideways keeps its
       34rem, but a table that has become a stack of cards is not scrolling any
       more and must fit the screen it is on. */
    body.dv-field-mode .table-wrapper > .table {
        min-width: 0;
    }

    body.dv-field-mode .table-wrapper tr {
        border: 1px solid var(--dv-line);
        border-radius: 0.5rem;
        margin-bottom: 0.6rem;
        padding: 0.5rem 0.75rem;
    }

    body.dv-field-mode .table-wrapper td {
        border: 0;
        padding: 0.25rem 0;
    }

    /* A stacked card with no labels is a column of orphan values: "Inspection",
       "RP-0002", "N9", "2026-08-20" tells a reader nothing. The heading the
       cell belongs under is carried on data-label by the field mode script and
       printed here, because the thead itself is hidden above. */
    body.dv-field-mode .table-wrapper td[data-label]::before {
        content: attr(data-label);
        display: block;
        font-size: 0.72rem;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        color: var(--dv-text-muted);
        margin-bottom: 0.1rem;
    }

    /* An empty cell would otherwise show its label with nothing under it. */
    body.dv-field-mode .table-wrapper td:empty {
        display: none;
    }
}

/* The toggle itself, in the app bar. */
.dv-field-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--dv-text-muted);
    white-space: nowrap;
}

/* Folded to icons, the menu shows the tick box alone. Its words would spill
   out of the strip. */
.dv-shell.dv-rail .dv-field-toggle {
    justify-content: center;
    width: 100%;
}

.dv-shell.dv-rail .dv-field-toggle span {
    display: none;
}


/* =====================================================================
   LEON, 20 SEPTEMBER 2026. THE MENU AND THE TOOLBARS ON A PHONE
   --------------------------------------------------------------------------- */

/* Help and Support, the Asset Map and Asset Approvals used to be anchored at
   the foot with Configure, which left a short scrolling list above them and
   made the menu awkward to move under a thumb. They are the last group of the
   scrolling list now, under a hairline so the grouping still reads. */
.dv-nav-extra {
    margin-top: var(--dv-space-3);
    padding-top: var(--dv-space-3);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.dv-shell.dv-rail .dv-nav-extra {
    margin-top: var(--dv-space-2);
    padding-top: var(--dv-space-2);
}

/* A row of buttons at the top of a screen: where to go and what to do. It
   wraps on its own down to a tablet, which reads well. On a phone it used to
   break into a ragged stack of pills of different widths, so there the two
   halves become their own full width rows: the months as one segmented strip,
   the actions two to a row, each a full sized target. */
.dv-page-tools {
    display: flex;
    flex-wrap: wrap;
    gap: var(--dv-space-2);
    align-items: center;
}

.dv-page-tools .dv-page-tools-spacer {
    margin-left: auto;
}

@media (max-width: 575.98px) {
    .dv-page-tools {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--dv-space-2);
    }

    .dv-page-tools .dv-page-tools-spacer {
        display: none;
    }

    /* The months read as one control across the top. */
    .dv-page-tools .dv-tools-period {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0;
    }

    .dv-page-tools .dv-tools-period > .btn {
        border-radius: 0;
        border-right-width: 0;
    }

    .dv-page-tools .dv-tools-period > .btn:first-child {
        border-top-left-radius: var(--dv-radius-sm);
        border-bottom-left-radius: var(--dv-radius-sm);
    }

    .dv-page-tools .dv-tools-period > .btn:last-child {
        border-top-right-radius: var(--dv-radius-sm);
        border-bottom-right-radius: var(--dv-radius-sm);
        border-right-width: 1px;
    }

    /* Every action is the same size, side by side, two to a row. */
    .dv-page-tools > .btn,
    .dv-page-tools > form,
    .dv-page-tools > .btn-group,
    .dv-page-tools .dv-tools-period > .btn {
        width: 100%;
        min-height: var(--dv-tap);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        white-space: nowrap;
    }

    /* A set of buttons that belong together, such as the months, takes the
       whole row and splits it evenly rather than spilling out of half of it. */
    .dv-page-tools > .btn-group {
        grid-column: 1 / -1;
    }

    .dv-page-tools > .btn-group > .btn {
        flex: 1 1 0;
        min-width: 0;
        min-height: var(--dv-tap);
    }

    /* Something that must not be cut in half, such as a project picker, takes
       the whole row. */
    .dv-page-tools > .dv-tools-wide,
    .dv-page-tools > form.dv-tools-wide {
        grid-column: 1 / -1;
    }

    .dv-page-tools > form.dv-tools-wide .form-select {
        width: 100%;
        min-height: var(--dv-tap);
    }
}




/* =====================================================================
   SPRINT 1 REGRESSION, 4 OCTOBER 2026

   The snag list from Leon's full regression of Sprint 1. Each rule says
   which snag it closes. Kept together so the fix round reads as one piece.
   ===================================================================== */

/* Sort arrows sat on the heading text in narrow columns. .table thead th set
   the padding after .sortable th did, so the room for the arrow was lost. */
.table.sortable > thead th {
    padding-right: 26px;
}

.table.sortable > thead th.no-sort {
    padding-right: 12px;
}

/* An Actions column holds one or two short links. A fixed 220 pixels left
   it half empty while dates and numbers broke over two lines beside it. */
.dv-actions-col {
    width: 1%;
    white-space: nowrap;
}

.table tbody td:has(> .table-action-link) {
    white-space: nowrap;
}

/* A reference, a date or an amount in a table never breaks over two lines.
   It keeps every character and is not shortened with an ellipsis. */
.table td.dv-nowrap,
.table th.dv-nowrap {
    white-space: nowrap;
}

/* A column that can go when the screen is narrow, on a tablet or a small
   laptop, so the table fits without scrolling sideways. Its value is still on
   the card view and on the record itself, and on a phone, where each row is a
   card, it comes back. */
@media (min-width: 576px) and (max-width: 1199.98px) {
    .table .dv-hide-narrow {
        display: none;
    }
}

/* A name column that wrapped over three lines while Email had room. */
.table .dv-col-name {
    min-width: 13rem;
}

/* --- Short add and edit forms sit on a card --------------------------------
   They floated on the grey page and their rows ran 11 pixels past it, because
   a Bootstrap row has negative side margins and nothing gave them room. The
   card's padding takes those margins, and each label lines up with the middle
   of the box beside it. */
.dv-form-card {
    background: var(--dv-surface);
    border-radius: var(--dv-radius);
    box-shadow: var(--dv-shadow);
    padding: var(--dv-space-5) var(--dv-space-5) var(--dv-space-3);
    max-width: 62rem;
}

.dv-form-card + .dv-form-card {
    margin-top: var(--dv-space-4);
}

.dv-form-card-title {
    font-family: var(--dv-font-head);
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--dv-navy);
    margin-bottom: var(--dv-space-3);
}

/* Every box is the tap height, so the label takes that height too and sits
   at the top of its row, level with the box rather than with the help text
   under it. */
@media (min-width: 576px) {
    .dv-form-card .col-form-label {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        align-self: flex-start;
        min-height: var(--dv-tap);
        padding-top: 0;
        padding-bottom: 0;
    }
}

@media (max-width: 575.98px) {
    .dv-form-card {
        padding: var(--dv-space-4) var(--dv-space-3) var(--dv-space-2);
    }
}

/* --- The side menu ----------------------------------------------------------
   The menu under your name, with Switch user in it, ran up over the brand at
   the top. It now stops below the brand row and scrolls. */
.dv-foot-menu {
    max-height: calc(100vh - 170px);
}

/* Who is signed in, at the head of that menu, in normal case on two lines,
   rather than one upper case line that wrapped. */
.dv-foot-menu-who {
    padding: var(--dv-space-1) var(--dv-space-2) var(--dv-space-2);
    line-height: 1.3;
}

.dv-foot-menu-who strong {
    display: block;
    font-size: 0.82rem;
    color: var(--dv-navy);
}

.dv-foot-menu-who span {
    display: block;
    font-size: 0.72rem;
    color: var(--dv-text-muted);
}

/* A small heading over a group in the main menu, used when the Configure
   screens are the only menu a person has, as for a Daveng Administrator. */
.dv-nav-heading {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    padding: var(--dv-space-1) 10px var(--dv-space-2);
}

.dv-shell.dv-rail .dv-nav-heading {
    display: none;
}

/* Field mode's label was grey on navy and hard to read. */
.dv-sidebar .dv-field-toggle {
    color: rgba(255, 255, 255, 0.85);
    padding: 0 8px var(--dv-space-2);
}

/* The drawer's close button, on a phone or tablet only. */
.dv-drawer-close {
    display: none;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: var(--dv-radius-sm);
    background: rgba(255, 255, 255, 0.14);
    color: #FFFFFF;
}

.dv-drawer-close svg {
    width: 18px;
    height: 18px;
}

@media (max-width: 991.98px) {
    .dv-drawer-close {
        display: inline-flex;
    }

    /* The drawer's shadow showed as a grey strip down the left of every page
       while it was closed. It only casts a shadow when it is open. */
    .dv-sidebar,
    .dv-shell.dv-rail .dv-sidebar,
    .dv-pre-collapsed .dv-sidebar {
        box-shadow: none;
    }

    .dv-shell.dv-drawer-open .dv-sidebar {
        box-shadow: var(--dv-shadow-lg);
    }
}

/* --- The app bar ------------------------------------------------------------
   While switched, the "Testing as" badge pushed the page title out and made
   every page scroll sideways on a phone. The title keeps its room, the badge
   gives way first, and on a phone it shortens to "Testing". */
.dv-appbar-title {
    flex: 0 1 auto;
    min-width: 4rem;
}

.dv-appbar-end {
    min-width: 0;
    flex: 0 1 auto;
}

.dv-appbar-end .dv-badge {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dv-testing-short {
    display: none;
}

@media (max-width: 575.98px) {
    .dv-testing-full {
        display: none;
    }

    .dv-testing-short {
        display: inline;
    }
}

/* --- List toolbars ----------------------------------------------------------
   On a tablet and a phone the toolbar stacked into four rows, one control to
   a row, and pushed the list below the first screen. Now the search and its
   filters share a row, and the exports, the view switch and Add share the
   next. On a phone the search takes a row of its own. Button text sits in the
   middle of the button, where it sat at the top on a phone. */
.dv-toolbar .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 991.98px) {
    .dv-toolbar-group {
        width: 100%;
    }

    .dv-toolbar-group .dv-search {
        flex: 1 1 12rem;
        width: auto;
        min-width: 0;
    }

    .dv-toolbar-group .dv-filter-select {
        flex: 1 1 9rem;
        width: auto;
        min-width: 0;
    }

    .dv-toolbar-group > .btn-primary {
        margin-left: auto;
    }
}

@media (max-width: 575.98px) {
    .dv-toolbar-group .dv-search {
        flex-basis: 100%;
    }

    /* With no dropdown beside it, the search keeps Filter on its own line. */
    .dv-toolbar-group:not(:has(.dv-filter-select)) .dv-search {
        flex-basis: 0;
    }

    .dv-toolbar-group .dv-filter-select {
        flex-basis: 0;
    }
}

/* Tiles two to a row on a phone, not one, so the list is still in sight. */
@media (max-width: 767.98px) {
    .dv-kpi-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dv-kpi {
        padding: var(--dv-space-2) var(--dv-space-3);
    }
}

/* --- Tables on a phone ------------------------------------------------------
   A table no longer scrolls sideways on a phone. Each row becomes a small
   card with each value under its heading, the way field mode already stacks
   a table. site.js copies each heading onto its cells. Snag 5, Sprint 3: on a
   small tablet too, up to 767 pixels, where a table of many columns could not
   fit even with the less needed ones stepped aside. */
@media (max-width: 767.98px) {
    .table-wrapper > .table {
        min-width: 0;
    }

    .table-wrapper table thead {
        display: none;
    }

    .table-wrapper table,
    .table-wrapper tbody,
    .table-wrapper tr,
    .table-wrapper td {
        display: block;
        width: 100%;
    }

    .table-wrapper {
        background: transparent;
        box-shadow: none;
        border-radius: 0;
        overflow: visible;
    }

    .table-wrapper tr {
        background: var(--dv-surface);
        border-radius: var(--dv-radius);
        box-shadow: var(--dv-shadow);
        margin-bottom: var(--dv-space-2);
        padding: var(--dv-space-2) var(--dv-space-3);
    }

    .table-wrapper > .table > tbody td {
        border: 0;
        padding: 3px 0;
        white-space: normal;
        text-align: left;
        background: transparent;
        box-shadow: none;
    }

    .table-wrapper td[data-label]::before {
        content: attr(data-label);
        display: block;
        font-size: 0.66rem;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        color: var(--dv-text-muted);
    }

    .table-wrapper td:empty {
        display: none;
    }

    /* The Actions heading says nothing its links do not. */
    .table-wrapper td[data-label="Actions"]::before {
        display: none;
    }
}

/* --- Item cards ------------------------------------------------------------
   A long company name was cut off under its type badge. A name wraps; a
   record number still never breaks. */
/* A card whose top line is only the record number and its status. The
   status stays on that line however long it is, and the name sits on a full
   width line of its own underneath. */
.dv-item-card-head-split {
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 2px;
}

.dv-item-card-head-split > .dv-item-card-number {
    flex: 0 1 auto;
    min-width: 0;
}

.dv-item-card-subrow {
    font-size: 0.74rem;
    color: var(--dv-text-muted);
    padding: 0 var(--dv-space-4) var(--dv-space-2);
}

.dv-item-card-number.dv-wrap-name {
    white-space: normal;
    line-height: 1.3;
}

/* --- Field mode -------------------------------------------------------------
   The Dashboard's tiles are the Dashboard. Field mode hides the tiles on the
   lists, where they are noise on site, but never on the Dashboard. */
body.dv-field-mode .dv-dashboard .dv-kpi {
    display: block;
}

/* --- Task 1.14. The contractor's logo -------------------------------------- */
.dv-logo-preview {
    display: inline-block;
    padding: var(--dv-space-2) var(--dv-space-3);
    border: 1px solid var(--dv-line);
    border-radius: var(--dv-radius-sm);
    background: var(--dv-surface);
}

.dv-logo-preview img {
    display: block;
    max-height: 48px;
    max-width: 240px;
}

.table td.dv-logo-cell img {
    display: block;
    max-height: 24px;
    max-width: 96px;
}

/* A dropdown that holds a company name, such as the contractor on Users. The
   standard filter width cut "Karoo Road Works (Pty) Ltd" short. */
.dv-filter-select.dv-filter-select-wide {
    width: 17rem;
}

@media (max-width: 991.98px) {
    .dv-toolbar-group .dv-filter-select.dv-filter-select-wide {
        flex: 1 1 14rem;
        width: auto;
    }
}

/* The Dashboard's tiles are its content, so their figures are a size larger
   than the tiles above a list. */
.dv-kpi-dash .dv-kpi-value {
    font-size: 1.8rem;
}

.dv-kpi-dash .dv-kpi-icon {
    width: 40px;
    height: 40px;
}

.dv-kpi-dash .dv-kpi-icon svg {
    width: 20px;
    height: 20px;
}

/* A button that is a link, such as Cancel, Back or Users, centres its word as
   a real button does. On a phone and a tablet every button is the tap height,
   and a link drew its word near the top. Third regression, 4 October 2026. */
a.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* On a phone, a list with a wide dropdown, such as the contractor on a Daveng
   Administrator's Users, gives the dropdown its own row and keeps Filter on
   the search's row, rather than alone on a third. */
@media (max-width: 575.98px) {
    .dv-toolbar-group .dv-filter-select.dv-filter-select-wide {
        flex-basis: 100%;
    }

    .dv-toolbar-group:has(.dv-filter-select-wide) .dv-search {
        flex-basis: 0;
    }
}

/* --- One width for every form ---------------------------------------------
   Second regression: the short forms stopped at 62rem while Add Project and
   the General Definitions list ran the full width. They now share it. */
.dv-page-narrow {
    max-width: 62rem;
}

.dv-page-narrow .dv-form-card {
    max-width: none;
}

/* --- A record someone may read but not change ------------------------------
   Second regression, 4 October 2026. A Manager's record was a greyed out copy
   of the edit form, with help text meant for someone editing. Read only, each
   box shows its value as plain text on the card, the dropdown arrows and the
   help go, and nothing looks like something to click. */
fieldset.dv-read-only .form-control,
fieldset.dv-read-only .form-select,
fieldset.dv-read-only .dv-readonly {
    border-color: transparent;
    background: transparent;
    background-image: none;
    box-shadow: none;
    color: var(--dv-text);
    font-family: inherit;
    font-weight: 600;
    padding-left: 0;
    opacity: 1;
    resize: none;
    -webkit-appearance: none;
    appearance: none;
}

fieldset.dv-read-only .input-group-text {
    background: transparent;
    border-color: transparent;
    padding-left: var(--dv-space-1);
    color: var(--dv-text-muted);
}

fieldset.dv-read-only .form-text {
    display: none;
}

fieldset.dv-read-only .form-control::placeholder {
    color: var(--dv-text);
    opacity: 1;
}

fieldset.dv-read-only textarea.form-control {
    min-height: 0;
    overflow: hidden;
}

fieldset.dv-read-only .form-check-input:disabled,
fieldset.dv-read-only .form-check-input:disabled ~ .form-check-label {
    opacity: 1;
}

fieldset.dv-read-only #dvTeamMembers {
    box-shadow: none;
    border: 0;
    padding: 0;
    background: transparent;
}

/* --- A page that is not there ------------------------------------------- */
.dv-notfound {
    max-width: 34rem;
    margin: var(--dv-space-6) auto;
    text-align: center;
}

/* ---------------------------------------------------------------------------
   Sprint 2, Task 2.4. Starting, ending and capturing a trip. Copied from
   RADAR's travel styles and trimmed: no checkpoints, roads or map pins.
   --------------------------------------------------------------------------- */

/* A note above a form, such as "Driving now? Start a Trip instead." */
.dv-carry-note {
    padding: var(--dv-space-3);
    margin-bottom: var(--dv-space-4);
    border-left: 3px solid var(--dv-blue);
    border-radius: var(--dv-radius-sm);
    background: var(--dv-tint-blue);
    font-size: 0.85rem;
}

.dv-carry-warn {
    border-left-color: var(--dv-warning);
    background: var(--dv-tint-amber);
}

/* What a trip comes to, as three figures rather than a line of text. */
.dv-trip-sum {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--dv-space-3);
    padding: var(--dv-space-3) var(--dv-space-4);
    border-radius: var(--dv-radius-sm);
    background: var(--dv-canvas);
}

.dv-trip-sum-value {
    font-family: var(--dv-font-head);
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--dv-navy);
    white-space: nowrap;
}

.dv-trip-sum-money { color: var(--dv-green-deep); }

.dv-trip-sum-label {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--dv-text-muted);
}

/* The odometer is the reading somebody signs for, so its box is large. */
.dv-trip-odometer {
    font-size: 1.35rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* Where the device says it is, with a button to take it again. */
.dv-trip-gps {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--dv-space-2);
    padding: var(--dv-space-2) var(--dv-space-3);
    border: 1px solid var(--dv-line-soft);
    border-radius: var(--dv-radius-sm);
    background: var(--dv-canvas);
}

.dv-trip-gps-text { font-size: 0.85rem; }

/* A trip under way, which must not be forgotten. */
.dv-trip-open-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--dv-space-3);
    margin-bottom: var(--dv-space-4);
    padding: var(--dv-space-3) var(--dv-space-4);
    border-radius: var(--dv-radius);
    background: var(--dv-tint-amber);
    box-shadow: inset 4px 0 0 var(--dv-warning);
    color: var(--dv-text);
}

.dv-trip-open-title {
    font-family: var(--dv-font-head);
    font-weight: 800;
    color: var(--dv-navy);
}

.dv-trip-open-text { font-size: 0.88rem; }

/* The facts of a trip under way, on the End page. */
.dv-trip-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--dv-space-3);
}

.dv-trip-fact-label {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--dv-text-muted);
}

.dv-trip-fact-value {
    font-weight: 700;
    color: var(--dv-navy);
    overflow-wrap: anywhere;
}

@media (max-width: 575.98px) {
    .dv-trip-sum { grid-template-columns: 1fr; gap: var(--dv-space-2); }
}

/* ---------------------------------------------------------------------------
   Sprint 2, Task 2.5. The month pages, copied from RADAR's Travel views and
   trimmed: the person at the top, the month's trips as cards, and the
   kilometres day by day.
   --------------------------------------------------------------------------- */
.dv-trip-person {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--dv-space-3);
    margin-bottom: var(--dv-space-4);
}

.dv-trip-person-who {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--dv-space-3);
}

.dv-trip-person-name {
    font-family: var(--dv-font-head);
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--dv-navy);
    line-height: 1.2;
}

.dv-avatar.dv-avatar-lg {
    width: 56px;
    height: 56px;
    font-size: 1.1rem;
    background: var(--dv-navy);
}

.dv-trip-kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.dv-trip-money { color: var(--dv-green-deep); }

.dv-trip-cards {
    display: flex;
    flex-direction: column;
    gap: var(--dv-space-3);
}

.dv-trip-card {
    display: block;
    padding: var(--dv-space-3) var(--dv-space-4);
    border-radius: var(--dv-radius);
    background: var(--dv-surface);
    box-shadow: var(--dv-shadow);
    color: var(--dv-text);
    text-decoration: none;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.dv-trip-card:hover {
    color: var(--dv-text);
    box-shadow: var(--dv-shadow-hover);
    transform: translateY(-2px);
}

.dv-trip-card.is-open { box-shadow: inset 4px 0 0 var(--dv-warning), var(--dv-shadow); }

.dv-trip-card-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--dv-space-3);
}

.dv-trip-card-date {
    font-family: var(--dv-font-head);
    font-weight: 800;
    color: var(--dv-navy);
}

.dv-trip-card-km {
    font-family: var(--dv-font-head);
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--dv-blue);
    white-space: nowrap;
}

.dv-trip-card-route {
    margin-top: 2px;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--dv-blue);
    overflow-wrap: anywhere;
}

.dv-trip-card-meta,
.dv-trip-card-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 0 var(--dv-space-3);
    margin-top: 4px;
    font-size: 0.84rem;
    color: var(--dv-text-muted);
}

.dv-trip-card-meta span + span::before,
.dv-trip-card-foot span + span::before {
    content: "\00B7";
    margin-right: var(--dv-space-3);
    color: var(--dv-line);
}

.dv-trip-card-money {
    margin-left: auto;
    font-weight: 700;
    color: var(--dv-green-deep);
}

.dv-trip-card-foot .dv-trip-card-money::before { content: none; }

/* Kilometres day by day: one slim column a day, the future faint. */
.dv-daybars {
    display: flex;
    align-items: stretch;
    gap: 3px;
    height: 190px;
    padding-top: var(--dv-space-2);
}

.dv-daybar {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-width: 0;
}

.dv-daybar-fill {
    display: block;
    width: 100%;
    min-height: 2px;
    border-radius: 4px 4px 1px 1px;
    background: var(--dv-line-soft);
}

.dv-daybar.has-km .dv-daybar-fill { background: var(--dv-blue-bright); }
.dv-daybar.has-km:hover .dv-daybar-fill { background: var(--dv-blue); }
.dv-daybar.is-future .dv-daybar-fill { background: var(--dv-canvas); }

.dv-daybar-day {
    height: 1.1rem;
    margin-top: 4px;
    font-size: 0.66rem;
    text-align: center;
    color: var(--dv-text-muted);
    white-space: nowrap;
}

/* The staff month's person cards open that person's month. */
a.dv-item-card { color: var(--dv-text); text-decoration: none; display: block; }
a.dv-item-card:hover { color: var(--dv-text); box-shadow: var(--dv-shadow-hover); }

@media (max-width: 575.98px) {
    .dv-daybars { height: 140px; gap: 1px; }
    .dv-trip-person-name { font-size: 1.1rem; }
    .dv-avatar.dv-avatar-lg { width: 44px; height: 44px; font-size: 0.95rem; }
}

/* ==========================================================================
   SPRINT 2 REGRESSION, 9 OCTOBER 2026
   ========================================================================== */

/* Table rows are plain white. Bootstrap takes a table's colour from the page,
   which is grey here, so every row was grey on a white card. */
.table {
    --bs-table-bg: var(--dv-surface);
}

/* A short section under a form, such as a person's Documents, is as wide as
   the form card above it rather than the whole page. A plant item's log keeps
   the full width, because its ten columns need it. */
.dv-card.dv-beside-form {
    max-width: 62rem;
}

/* The Dashboard's tiles are four to a row, so a row of three and a row of one
   keep the same tile width as a row of four. Two to a row below a desktop. */
.dv-dashboard .dv-kpi-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 991.98px) {
    .dv-dashboard .dv-kpi-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* On a phone a figure such as 173.6 km stays on one line. The icon gives way
   to make room; the tile's name says what it counts. */
@media (max-width: 575.98px) {
    .dv-kpi-dash .dv-kpi-value {
        white-space: nowrap;
        font-size: 1.4rem;
    }

    .dv-kpi-dash .dv-kpi-icon {
        display: none;
    }
}

/* The Up and Down buttons on General Definitions read as the links beside
   them: the same size and weight, on the same line, with the same gaps. One
   that cannot move is greyed out. */
.dv-link-button.table-action-link {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--dv-blue);
}

.table-action-link.dv-action-off {
    color: var(--dv-text-muted);
    font-weight: 400;
    pointer-events: none;
}

/* A unit after a box, such as hours or litres, takes the same width, so the
   boxes on a form end in line. */
.input-group-text.dv-unit {
    min-width: 4.5rem;
    justify-content: center;
}

/* A filter dropdown in its own small form, such as the project on Travel
   Logs, stretches like the other filters on a tablet and a phone. It was
   squeezed until its words ran into its arrow. */
@media (max-width: 991.98px) {
    .dv-toolbar-group > form:has(> .dv-filter-select) {
        flex: 1 1 9rem;
        min-width: 0;
    }

    .dv-toolbar-group > form > .dv-filter-select {
        width: 100%;
    }
}

/* On a phone the buttons in a record's banner, such as Edit, Print and Month
   on a trip, start on the left under the name rather than part way across. */
@media (max-width: 575.98px) {
    .dv-detail-actions {
        margin-left: 0;
    }
}

/* Between a tablet and a wide screen the search and its filters are a little
   narrower, so a list with three filters, such as Personnel, keeps its
   toolbar to two rows. */
@media (min-width: 992px) and (max-width: 1399.98px) {
    .dv-search {
        width: 200px;
    }

    .dv-filter-select {
        width: 150px;
    }

    .dv-filter-select.dv-filter-select-wide {
        width: 15rem;
    }
}

/* --- A record someone may read but not change, compact ----------------------
   Leon, 9 October 2026: a Manager's record had far too much empty space. Each
   row kept the edit form's tap height and gap with no box to fill it, and a
   label sat in the middle of that height while notes started at the top, so
   the two did not line up. Read only, the rows sit close together in one
   column, each label level with the first line of its value, and the card is
   only as wide as it needs to be. Edit forms keep their tap sized boxes. */
form.dv-form-card:has(> fieldset.dv-read-only) {
    max-width: 48rem;
}

fieldset.dv-read-only > .row.mb-3 {
    margin-bottom: var(--dv-space-1) !important;
}

fieldset.dv-read-only .form-control,
fieldset.dv-read-only .form-select,
fieldset.dv-read-only .dv-readonly,
fieldset.dv-read-only .input-group-text {
    min-height: 0;
    height: auto;
    padding-top: var(--dv-space-1);
    padding-bottom: var(--dv-space-1);
    line-height: 1.5;
}

@media (min-width: 576px) {
    .dv-form-card fieldset.dv-read-only .col-form-label {
        min-height: 0;
        align-items: flex-start;
        padding-top: 5px;
        padding-bottom: var(--dv-space-1);
        line-height: 1.5;
    }
}

/* The Back button sits a little below the last row, not a full gap. */
fieldset.dv-read-only + .row {
    margin-top: var(--dv-space-3);
}

/* A link inside a read-only record, such as Their month on a person, stays a
   link. Bootstrap switches off every button inside a disabled fieldset, so a
   Manager saw it greyed out and could not click it. */
fieldset.dv-read-only a.btn-secondary {
    pointer-events: auto;
    opacity: 1;
    background: var(--dv-surface);
    border-color: var(--dv-line);
    color: var(--dv-text);
}

fieldset.dv-read-only a.btn-secondary:hover {
    background: var(--dv-tint-blue);
    border-color: rgba(8, 138, 112, 0.35);
    color: var(--dv-blue-deep);
}

/* A value with a unit, such as 10 hours or R 650.00, reads as one phrase: the
   box is only as wide as its value, so the unit sits beside it. */
fieldset.dv-read-only .input-group {
    flex-wrap: nowrap;
    width: auto;
}

fieldset.dv-read-only .input-group > .form-control,
fieldset.dv-read-only .dv-readonly.flex-grow-1 {
    flex: 0 0 auto !important;
    width: auto;
    min-width: 2ch;
    field-sizing: content;
}

fieldset.dv-read-only .input-group-text.dv-unit {
    min-width: 0;
    justify-content: flex-start;
}

/* ==========================================================================
   Task 3.2. RADAR's list card and the one row toolbar, copied from RADAR's
   Sprint 6 (Tasks 6.5 and 6.6, 7 to 9 October 2026). The card class
   dv-rfi-card is dv-list-card here, and dv-rfi-actions is
   dv-list-card-actions, since this app has no request for inspection.
   ========================================================================== */

/* The card: the number on the left and the status on the right, on one line. */
.dv-list-card .dv-item-card-number { font-size: 1.2rem; }
.dv-list-card .dv-item-card-head { flex-wrap: nowrap; justify-content: space-between; }
.dv-list-card .dv-item-card-head > div:first-child { flex: 1 1 auto; }
.dv-list-card .dv-item-card-line > span:last-child { text-align: right; }
.dv-list-card-actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; }

/* More than one badge sits together at the right of the number. */
.dv-list-card-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px;
    flex: 0 1 auto;
}

/* A card that is late carries a red edge. */
.dv-item-card.is-overdue {
    border-left: 3px solid var(--dv-danger);
}

/* Late, in the house danger colour and bold. */
.dv-days-behind { color: var(--dv-danger); font-weight: 700; }

/* The toolbar below 1280 pixels: the search across the top, then the
   filters, Filter, the exports and Cards or Table on one line under it,
   wrapping only where a phone runs out of room. */
@media (max-width: 1279.98px) {
    .dv-toolbar.dv-toolbar-compact {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-start;
    }

    .dv-toolbar.dv-toolbar-compact > .dv-toolbar-group:first-child {
        display: contents;
    }

    .dv-toolbar.dv-toolbar-compact .dv-search {
        flex: 1 1 100%;
        width: auto;
    }

    .dv-toolbar.dv-toolbar-compact .dv-filter-select {
        flex: 1 1 9rem;
        width: auto;
    }

    .dv-toolbar.dv-toolbar-compact > .dv-toolbar-group:last-child {
        width: auto;
        flex-wrap: nowrap;
        margin-left: auto;
    }
}

/* The lists' toolbars on one row, the search and the filters on the left and
   the buttons on the right. On a wide screen the boxes are a little narrower
   so the row fits; below 1280 pixels the compact toolbar takes over and the
   row wraps. */
@media (min-width: 1280px) {
    .dv-toolbar.dv-toolbar-oneline .dv-search {
        width: 210px;
    }

    .dv-toolbar.dv-toolbar-oneline .dv-filter-select {
        width: 165px;
    }
}

/* On a laptop screen, about 1366 pixels, the boxes are narrower still, so
   the toolbar stays on one row. */
@media (min-width: 1280px) and (max-width: 1599.98px) {
    .dv-toolbar.dv-toolbar-oneline .dv-search {
        width: 115px;
    }

    .dv-toolbar.dv-toolbar-oneline .dv-filter-select {
        width: 125px;
    }
}

@media (min-width: 1600px) {
    .dv-toolbar.dv-toolbar-oneline .dv-search {
        width: 260px;
    }
}

/* Cards and Table as icons, a grid of four squares and three lines, with the
   word as the tooltip. */
.dv-viewswitch a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 10px;
}

.dv-viewswitch-icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Clear filters, as a cross, so a list with a filter in use stays on one row. */
.dv-clear-icon {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

/* Task 3.3. The project page's tiles, two to a row inside their card, with no
   gap under the last row. Field mode leaves a record's own tiles showing. */
.dv-project-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 0;
}

body.dv-field-mode .dv-project-kpis .dv-kpi {
    display: block;
}

/* Task 3.3. On a phone a record's tabs are a little tighter. They wrapped onto
   a second line until Leon, 12 October 2026: "Make the tabs scroll like RADAR
   instead of wrapping". The strip now stays on one line and scrolls, with a
   fade at the edge that has more (initTabHints in site.js). */
@media (max-width: 575.98px) {
    .dv-tab {
        padding: 8px 12px;
    }
}

/* Task 3.4. Remove on a row, a POST behind a confirm, reads as a link in the
   house danger colour. */
.dv-link-button.table-action-link.dv-action-danger {
    color: var(--dv-danger);
}

/* Task 3.5. On a laptop screen, 1200 to 1599 pixels, a heading of two words
   may take two lines, so a register with many columns, such as Plant with its
   project and team, fits the page without scrolling sideways. */
@media (min-width: 1200px) and (max-width: 1599.98px) {
    .table thead th {
        white-space: normal;
    }
}

/* Task 3.5. A column that also steps aside on a laptop screen, up to 1439
   pixels, for a register with many columns. Its value stays on the card and
   on the record, and on a phone it comes back. */
@media (min-width: 576px) and (max-width: 1439.98px) {
    .table .dv-hide-laptop {
        display: none;
    }
}

/* Snag 2, Sprint 3. On a laptop screen the search and the filters started at
   their narrowest and stayed there, so their words were cut off even with room
   to spare. From 1280 pixels they start narrow, so the row still fits, and
   then grow into any free space, the search up to 260 pixels and a filter up
   to 200, so their words read in full whenever the row has room. */
@media (min-width: 1280px) {
    .dv-toolbar.dv-toolbar-oneline > .dv-toolbar-group:first-child {
        flex: 1 1 auto;
        min-width: 0;
    }

    /* A width of 0 keeps a box's own content out of where the row breaks: it
       starts at its basis, then grows. */
    .dv-toolbar.dv-toolbar-oneline .dv-search {
        flex: 10 1 115px;
        width: 0;
        min-width: 115px;
        max-width: 260px;
    }

    /* A filter grows only as far as its own words need; the search grows
       first and takes the room that is left. */
    .dv-toolbar.dv-toolbar-oneline .dv-filter-select {
        flex: 1 1 125px;
        width: 0;
        min-width: 125px;
        max-width: max-content;
    }
}

/* Snag 3, Sprint 3. A record's header on a phone: its buttons keep the size
   they have on every other screen rather than the tall tap size, and the facts
   under the name sit close together, one to a line, as the card rows do. */
@media (max-width: 575.98px) {
    .dv-detail-actions .btn {
        min-height: 0;
        min-width: 0;
    }

    .dv-detail-meta {
        flex-direction: column;
        gap: var(--dv-space-1);
    }
}

/* ==========================================================================
   Task 3.10. The job card's stage stepper, copied from RADAR's project
   stage strip: six stages numbered, those done in green, the current one in
   blue. On a phone the strip takes two rows of three, so every word fits.
   ========================================================================== */
.dv-stage-strip {
    display: flex;
    border-radius: var(--dv-radius-sm);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
    position: relative;
}

.dv-stage {
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
    padding: 8px 4px;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: rgba(255, 255, 255, 0.72);
    border-right: 2px solid rgba(45, 42, 42, 0.45);
    position: relative;
}

.dv-stage:last-child {
    border-right: none;
}

.dv-stage-n {
    display: block;
    font-family: var(--dv-font-head);
    font-size: 0.72rem;
    font-weight: 800;
}

.dv-stage.done {
    background: rgba(233, 201, 63, 0.3);
    color: rgba(255, 255, 255, 0.88);
}

.dv-stage.active {
    background: linear-gradient(135deg, var(--dv-blue-bright), var(--dv-blue));
    color: #FFFFFF;
}

@media (max-width: 575.98px) {
    .dv-stage-strip {
        flex-wrap: wrap;
    }

    .dv-stage {
        flex: 1 1 33.333%;
        border-bottom: 2px solid rgba(45, 42, 42, 0.45);
    }
}

/* Task 4.2. The flow's stepper: a sub line under each step, the next phase
   greyed, and Changes Asked shown in amber on step 2 as it loops back. Seven
   steps: four on the first row and three on the second on a phone. */
.dv-stage-sub {
    display: block;
    font-weight: 600;
    font-size: 0.58rem;
    letter-spacing: 0;
    opacity: 0.85;
    margin-top: 2px;
}

.dv-stage.later {
    color: rgba(255, 255, 255, 0.42);
    background: rgba(0, 0, 0, 0.12);
}

.dv-stage.active.loop {
    background: var(--dv-warning);
}

@media (max-width: 767.98px) {
    .dv-stage-strip-flow {
        flex-wrap: wrap;
    }

    .dv-stage-strip-flow .dv-stage {
        flex: 1 1 25%;
        border-bottom: 2px solid rgba(45, 42, 42, 0.45);
    }

    .dv-stage-strip-flow .dv-stage:nth-child(n+5) {
        flex: 1 1 33.333%;
    }
}

/* Back and Move, under the header, on the right. */
.dv-stage-moves {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: var(--dv-space-2);
    margin: calc(var(--dv-space-2) * -1) 0 var(--dv-space-4);
}

/* A record someone may only read: its label and value rows close together,
   each label level with its value, as fieldset.dv-read-only does for a form. */
.dv-rows-compact .dv-row {
    justify-content: flex-start;
    padding: 4px 0;
    border-bottom: none;
}

.dv-rows-compact .dv-row-label {
    flex: 0 0 9.5rem;
}

.dv-rows-compact .dv-row-value {
    text-align: left;
}

/* Snag 5, Sprint 3. From 576 pixels a heading of two words may take two
   lines, so a list with many columns, such as Job Cards, fits a tablet
   without scrolling sideways. */
@media (min-width: 576px) and (max-width: 1199.98px) {
    .table thead th {
        white-space: normal;
    }
}

/* Task 3.11. The items total on a job card's Items tab, in the toolbar's place
   of a search box. */
.dv-items-total {
    font-weight: 600;
    color: var(--dv-navy, #2D2A2A);
}

/* Task 3.11. On a phone, where each row is a small card, the total under a
   table is a card of its own: the word on the left, the amount on the right. */
@media (max-width: 767.98px) {
    .table-wrapper tfoot {
        display: block;
        width: 100%;
    }

    .table-wrapper tfoot tr.dv-total-row {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
    }

    .table-wrapper tfoot tr.dv-total-row td {
        width: auto;
        border: 0;
        padding: 3px 0;
        background: transparent;
    }
}

/* --------------------------------------------------------------------------
   Leon, 12 October 2026: the phone changes made in RADAR that morning (RADAR
   Sprint 7, Task 7.9), copied here. site.js holds their behaviour:
   initTabHints, initPhoneFilters, dvBackCloses and dvNotice.
   -------------------------------------------------------------------------- */

/* The screen's name keeps each word whole (_Layout draws each in dv-nobr), so
   a phone breaks it between words and never inside a number. */
.dv-nobr {
    white-space: nowrap;
}

/* Tab strips. A strip wider than the screen scrolls sideways on its own, and
   a fade at an edge says there is more there. site.js sets the two classes
   as the strip scrolls. A record's tabs scroll this way on a phone too (Leon,
   12 October 2026), where they used to wrap. */
.dv-tabs {
    scroll-snap-type: x proximity;
    /* The snap keeps the strip's own 5 pixel padding, so the first tab is not
       pulled past it, which scrolled the strip and faded that tab. */
    scroll-padding-inline: 5px;
    scrollbar-width: none;
}

.dv-tabs::-webkit-scrollbar {
    display: none;
}

.dv-tabs .dv-tab {
    scroll-snap-align: start;
}

/* Snag 10. The last tab snaps to the strip's end, so a strip scrolled to its
   end stays there and is not pulled back to the last tab's start, which left
   the right fade over the last tab. */
.dv-tabs .dv-tab:last-child {
    scroll-snap-align: end;
}

.dv-tabs.dv-tabs-more-right {
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent);
}

.dv-tabs.dv-tabs-more-left {
    -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 48px), transparent);
    mask-image: linear-gradient(to left, #000 calc(100% - 48px), transparent);
}

.dv-tabs.dv-tabs-more-left.dv-tabs-more-right {
    -webkit-mask-image: linear-gradient(to right, transparent, #000 48px, #000 calc(100% - 48px), transparent);
    mask-image: linear-gradient(to right, transparent, #000 48px, #000 calc(100% - 48px), transparent);
}

@media (max-width: 767.98px) {
    /* The screen's name may take two lines rather than being cut off. */
    .dv-appbar {
        gap: 8px;
    }

    .dv-appbar-title {
        flex: 1 1 auto;
        min-width: 0;
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        line-height: 1.15;
        font-size: 0.95rem;
    }

    /* A thumb needs at least 36 pixels. These were 14 to 30. */
    .dv-hamburger {
        min-width: 40px;
        min-height: 40px;
    }

    .table-action-link,
    .btn.table-action-link,
    .btn.btn-link.btn-sm {
        display: inline-flex;
        align-items: center;
        min-height: 36px;
    }

    .table-action-link {
        min-width: 40px;
        justify-content: center;
    }

    .dv-viewswitch a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 40px;
        min-height: 36px;
    }

    .dv-tabs .dv-tab {
        min-height: 40px;
        display: inline-flex;
        align-items: center;
    }

    .modal .btn-close {
        width: 40px;
        height: 40px;
        padding: 0;
        background-size: 14px;
    }

    /* A link inside a sentence or a table cell, such as Download template or
       a value's name on General Definitions, keeps its line and is given a
       taller area to press. */
    .form-text a,
    .dv-row-label a,
    .dv-carry-note a,
    .table-wrapper td > a:not(.table-action-link):not(.btn) {
        display: inline-block;
        padding: 11px 0;
        margin: -11px 0;
    }

    /* Save stays in reach. A window's buttons sit at its foot and stay there
       while a long window scrolls. */
    .modal .modal-footer {
        position: sticky;
        bottom: 0;
        z-index: 3;
        background: var(--dv-surface);
        box-shadow: 0 -6px 12px -10px rgba(0, 0, 0, 0.35);
    }
}

/* On a phone a list toolbar is the search box and a Filters button; the
   filters open in place under them (initPhoneFilters in site.js). Above
   phone width the panel takes no room of its own, so the toolbar looks
   exactly as it did. */
/* .dv-toolbar .btn makes every toolbar button flex, so the hiding rule names
   the toolbar too. */
.dv-filters-toggle,
.dv-toolbar .btn.dv-filters-toggle {
    display: none;
}

.dv-filters-panel {
    display: contents;
}

@media (max-width: 767.98px) {
    .dv-toolbar.dv-has-phone-filters > .dv-toolbar-group:first-child {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        width: 100%;
    }

    .dv-toolbar.dv-has-phone-filters .dv-search {
        flex: 1 1 0;
        width: auto;
        min-width: 0;
        max-width: none;
    }

    .dv-toolbar.dv-has-phone-filters .dv-filters-toggle {
        display: inline-flex;
        align-items: center;
        flex: 0 0 auto;
        min-height: 36px;
    }

    .dv-toolbar.dv-has-phone-filters .dv-filters-toggle.active {
        background: var(--dv-navy);
        border-color: var(--dv-navy);
        color: #FFFFFF;
    }

    .dv-toolbar.dv-has-phone-filters .dv-filters-panel {
        display: none;
    }

    .dv-toolbar.dv-has-phone-filters .dv-filters-panel.open {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        flex: 1 1 100%;
        width: 100%;
    }

    /* Each filter the full width, the buttons side by side under them. */
    .dv-toolbar.dv-has-phone-filters .dv-filters-panel.open > * {
        flex: 1 1 100%;
        width: 100%;
        max-width: 100%;
    }

    .dv-toolbar.dv-has-phone-filters .dv-filters-panel.open > .btn,
    .dv-toolbar.dv-has-phone-filters .dv-filters-panel.open > button {
        flex: 1 1 0;
        width: auto;
    }

    /* The buttons beside a list's filters (PDF, Excel, Cards or Table, Add)
       wrap on a phone rather than running off the edge. */
    .dv-toolbar.dv-toolbar-compact > .dv-toolbar-group:last-child,
    .dv-toolbar > .dv-toolbar-group:last-child {
        flex-wrap: wrap;
        margin-left: 0;
        max-width: 100%;
    }

    /* A single filter in a small form of its own takes the full width, so its
       words are never under its arrow. */
    .dv-toolbar-group > form {
        width: 100%;
    }

    .dv-toolbar-group > form > .dv-filter-select {
        width: 100%;
    }
}

/* Many Android phones are 360 pixels wide. Below 400 the top bar's gaps are
   tighter and the name a little smaller, so the name gets two whole lines. */
@media (max-width: 399.98px) {
    .dv-appbar {
        gap: 8px;
        padding-left: 10px;
        padding-right: 10px;
    }

    .dv-appbar-title {
        font-size: 0.85rem;
        letter-spacing: -0.3px;
    }
}

/* A save that did not happen is said over the top of the screen in red
   (dvNotice in site.js), above any window, and falls away. */
.dv-notice-host {
    width: min(92vw, 26rem);
    z-index: 2000;
}

.dv-notice-host .toast {
    width: 100%;
    cursor: pointer;
    transition: opacity 0.3s;
}

.toast.dv-toast-error {
    background: #991B1B;
    color: #FFFFFF;
    border-left: 4px solid #F6BDBD;
    border-radius: var(--dv-radius);
    box-shadow: var(--dv-shadow-lg);
    font-weight: 600;
}

.dv-notice-host .toast.dv-toast-leaving {
    opacity: 0;
}

/* Snag 8. A "Not saved." message that would cover the box it names sits
   lower instead, above a window's Save bar or at the foot of the screen, so
   the box stays in sight. site.js sets how far up. */
.dv-notice-host.dv-notice-foot {
    top: auto;
}


/* ==========================================================================
   Task 4.4. The Resources tab: Teams, People and Plant one under the other at
   every width. Side by side, the Actions column leaves too little room, and
   the tables would scroll sideways even at 1920 pixels.
   ========================================================================== */
.dv-res-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--dv-space-4);
}

/* ==========================================================================
   Task 4.4. An Add window's tick list: one line per team, person or plant
   item, the box on the left, the name over its details. It scrolls inside the
   window, so Add stays in reach on a phone.
   ========================================================================== */
.dv-pick-list {
    max-height: 22rem;
    overflow-y: auto;
    border: 1px solid var(--dv-line-soft);
    border-radius: var(--dv-radius-sm);
}

.dv-pick-row {
    display: flex;
    align-items: flex-start;
    gap: var(--dv-space-2);
    padding: 8px 12px;
    margin: 0;
    border-bottom: 1px solid var(--dv-line-soft);
    cursor: pointer;
}

.dv-pick-row:last-of-type {
    border-bottom: none;
}

.dv-pick-row:hover {
    background: var(--dv-canvas);
}

.dv-pick-row .form-check-input {
    margin-top: 3px;
    flex: 0 0 auto;
}

.dv-pick-list [data-dv-pick-none] {
    padding: 8px 12px;
}

@media (max-width: 767.98px) {
    .dv-pick-row {
        padding: 12px;
    }

    .dv-pick-row .form-check-input {
        width: 1.25rem;
        height: 1.25rem;
    }

    /* 16 pixel text, so the phone does not zoom in when the box is tapped. */
    .modal [data-dv-pick-search] {
        font-size: 16px;
        min-height: 38px;
    }
}


/* ==========================================================================
   Task 4.5. The Items and prices tab: the totals at the top, then one card
   per stretch of road with its name and buttons on one line over its items.
   ========================================================================== */
.dv-item-totals .dv-total-line .dv-row-label,
.dv-item-totals .dv-total-line .dv-row-value {
    font-weight: 800;
    color: var(--dv-text);
}

.dv-stretch-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--dv-space-2);
    margin-bottom: var(--dv-space-2);
}

.dv-stretch-name {
    font-family: var(--dv-font-head);
    font-weight: 700;
    color: var(--dv-navy);
}

.dv-stretch-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--dv-space-2);
}

.dv-lane-ticks {
    display: flex;
    flex-wrap: wrap;
    gap: var(--dv-space-2) var(--dv-space-4);
}

.dv-modal-foot-split {
    justify-content: space-between;
}

/* Snag 13. A window's Remove or Clear dates sits after Save in the form, so
   Enter saves, and is drawn first, on the left, by its order. */
.dv-modal-foot-split .dv-foot-first {
    order: -1;
}

@media (max-width: 767.98px) {
    .dv-stretch-actions {
        width: 100%;
    }

    .dv-stretch-actions .btn,
    .dv-stretch-actions form {
        flex: 1 1 0;
    }

    .dv-stretch-actions form .btn {
        width: 100%;
    }

    /* 16 pixel text in the job card's windows, so the phone does not zoom in. */
    .dv-job-window .form-control,
    .dv-job-window .form-select {
        font-size: 16px;
        min-height: 38px;
    }
}


/* Task 4.6. The rows an import refused, in the Import window. */
.dv-import-errors {
    background: var(--dv-tint-red);
    border-radius: var(--dv-radius-sm);
    padding: var(--dv-space-2) var(--dv-space-3);
    color: var(--dv-text);
}

.dv-import-errors ul {
    padding-left: 1.1rem;
}


/* ==========================================================================
   Task 4.7. The programme's calendar. It is wide by nature, so it scrolls
   sideways inside its own box at every width, with the road column fixed on
   the left. A planned working day is blue with the people in it; a planned
   weekend or holiday is striped; weekends and holidays are shaded.
   ========================================================================== */
.dv-segment {
    display: inline-flex;
}

.dv-segment .btn {
    border-radius: 0;
}

.dv-segment .btn:first-of-type {
    border-radius: var(--dv-radius-pill) 0 0 var(--dv-radius-pill);
}

.dv-segment .btn:last-of-type {
    border-radius: 0 var(--dv-radius-pill) var(--dv-radius-pill) 0;
}

/* Task 4.7. The programme as a Gantt chart. Leon, 25 October 2026, from his
   Gantt example: "I need the differentiator to be a little bit clearer ...
   clean and crisp, not bland and boring." So every part reads at a glance:
     the weeks    a colour band over each week's days, blue to violet;
     a road       a navy header cell with white text, and a white row with
     stretch      its dark bar from its first item's start to its last end;
     an item      a light blue name cell and a grey track for its days, with
                  its bar in its team's colour and the team's badge at the end;
     the rows     white gaps between them, and a white line at each Monday.
   Narrow day cells; today marked in orange. A calendar that fits the page
   fills its width; a longer one scrolls inside its box with the names fixed
   on the left. */
.dv-gantt-wrap {
    overflow-x: auto;
    padding: 0 0 4px;
    background: #FFFFFF;
}

.dv-gantt {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 3px;
    font-size: 0.75rem;
    color: #2D2A2A;
}

.dv-gantt th,
.dv-gantt td {
    min-width: 26px;
    height: 30px;
    padding: 0;
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
}

/* --- The heading: the weeks, then the days, each week in its own colour --- */
.dv-gantt-weeks th {
    height: 26px;
    background: #EEF1F5;
    color: #2D2A2A;
    font-size: 0.72rem;
    font-weight: 700;
    border-left: 2px solid #FFFFFF;
}

.dv-gantt-days th {
    height: 30px;
    color: #FFFFFF;
    font-size: 0.6rem;
    font-weight: 600;
    line-height: 1.1;
}

.dv-gantt-days th span {
    font-size: 0.72rem;
    font-weight: 700;
}

.dv-gantt-days th {
    border-left: 1px solid rgba(255, 255, 255, 0.35);
}

.dv-gantt-days th.dv-gantt-mon {
    border-left: 2px solid #FFFFFF;
}

/* Snag 348. The weeks run through the deeper teals and the charcoals, so the white day
   letters on them read at 4.5 to 1 or better. */
.dv-gantt-weeks .dv-gantt-w0 { box-shadow: inset 0 -3px 0 #077A63; }
.dv-gantt-weeks .dv-gantt-w1 { box-shadow: inset 0 -3px 0 #066B57; }
.dv-gantt-weeks .dv-gantt-w2 { box-shadow: inset 0 -3px 0 #055C4A; }
.dv-gantt-weeks .dv-gantt-w3 { box-shadow: inset 0 -3px 0 #5A5656; }
.dv-gantt-weeks .dv-gantt-w4 { box-shadow: inset 0 -3px 0 #4A4545; }
.dv-gantt-weeks .dv-gantt-w5 { box-shadow: inset 0 -3px 0 #2D2A2A; }

.dv-gantt-days .dv-gantt-w0 { background: #077A63; }
.dv-gantt-days .dv-gantt-w1 { background: #066B57; }
.dv-gantt-days .dv-gantt-w2 { background: #055C4A; }
.dv-gantt-days .dv-gantt-w3 { background: #5A5656; }
.dv-gantt-days .dv-gantt-w4 { background: #4A4545; }
.dv-gantt-days .dv-gantt-w5 { background: #2D2A2A; }

/* A weekend or holiday in the heading: the week's colour, a little darker. */
.dv-gantt-days th.dv-gantt-we,
.dv-gantt-days th.dv-gantt-hol {
    box-shadow: inset 0 0 0 100px rgba(15, 23, 42, 0.22);
}

.dv-gantt-days th.dv-gantt-today {
    background: #F97316;
    box-shadow: none;
}

/* --- The names on the left stay while the days scroll --- */
.dv-gantt .dv-gantt-lab {
    position: sticky;
    left: 0;
    z-index: 2;
    min-width: 340px;
    max-width: 340px;
    padding: 4px 48px 4px 10px;
    border-right: 3px solid #FFFFFF;
    text-align: left;
    white-space: normal;
}

.dv-gantt thead .dv-gantt-lab {
    z-index: 3;
    background: #FFFFFF;
    color: #6B7280;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    vertical-align: bottom;
    padding-bottom: 8px;
}

.dv-gantt thead .dv-gantt-total,
.dv-gantt thead .dv-gantt-team,
.dv-gantt thead .dv-gantt-people,
.dv-gantt thead .dv-gantt-cost {
    background: #FFFFFF;
    color: #6B7280;
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    vertical-align: bottom;
    padding-bottom: 8px;
}

/* --- A road stretch: navy name cell, white row, no bar (Snag 47) --- */
.dv-gantt-stretch td {
    background: #FFFFFF;
    cursor: pointer;
}

.dv-gantt-stretch .dv-gantt-lab {
    background: var(--dv-navy);
    background-clip: padding-box;
    color: #FFFFFF;
    border: 2px solid #FFFFFF;
    border-left-width: 6px;
    border-right-width: 6px;
    border-radius: 9px;
}

.dv-gantt-stretch:hover .dv-gantt-lab {
    background: var(--dv-navy-soft);
}

.dv-gantt-stretch .dv-gantt-km {
    color: rgba(255, 255, 255, 0.72);
}

.dv-gantt-stretch .dv-gantt-dur {
    border-color: transparent;
    background: rgba(255, 255, 255, 0.92);
    color: var(--dv-navy);
}

.dv-gantt-stretch .dv-gantt-caret {
    border-top-color: #FFFFFF;
}

/* --- An item: light blue name cell, grey track --- */
.dv-gantt-item .dv-gantt-lab {
    background: #F6F8FC;
    padding-left: 32px;
}

.dv-gantt-item td {
    background: #EDF2F9;
    border-left: 1px solid #FFFFFF;
}

.dv-gantt-item td.dv-gantt-we,
.dv-gantt-item td.dv-gantt-hol {
    background: #E7E7E8;
}

.dv-gantt-item td.dv-gantt-mon {
    border-left: 2px solid #FFFFFF;
}

.dv-gantt-item td.dv-gantt-total,
.dv-gantt-item td.dv-gantt-team,
.dv-gantt-item td.dv-gantt-people,
.dv-gantt-item td.dv-gantt-lab {
    border-left: 0;
}

.dv-gantt-item td.dv-gantt-total,
.dv-gantt-item td.dv-gantt-team,
.dv-gantt-item td.dv-gantt-people {
    background: #FFFFFF;
}

/* The team's square in front of an item's name. */
.dv-gantt-square {
    position: absolute;
    top: 50%;
    left: 11px;
    width: 12px;
    height: 12px;
    margin-top: -6px;
    border-radius: 3px;
}

.dv-gantt-square.dv-gantt-none {
    background: #FFFFFF;
    border: 1.5px solid #C5CEDB;
}

/* The People column: the people a day, in a navy box for a road stretch and a blue box for an item. */
.dv-gantt .dv-gantt-people {
    min-width: 46px;
    background: #FFFFFF;
}

.dv-gantt-pill {
    display: inline-block;
    min-width: 30px;
    height: 24px;
    padding: 0 6px;
    line-height: 24px;
    border-radius: 6px;
    color: #FFFFFF;
    font-size: 0.7rem;
    font-weight: 700;
}

.dv-gantt-pill-navy {
    background: var(--dv-navy);
}

.dv-gantt-pill-blue {
    background: #077A63;
}

/* --- The bars. Day cells inside a plan join into one bar, rounded at its ends --- */
.dv-gantt-bar {
    display: block;
    height: 24px;
    line-height: 24px;
    color: #FFFFFF;
    font-size: 0.68rem;
    font-weight: 700;
}

.dv-gantt-first .dv-gantt-bar {
    margin-left: 2px;
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
}

.dv-gantt-last .dv-gantt-bar {
    margin-right: 2px;
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
}

/* A weekend or holiday inside a plan: the bar carries on, faded, with no people. */
.dv-gantt-rest {
    opacity: 0.45;
}

.dv-gantt-c0 { background: #077A63; }
.dv-gantt-c1 { background: #4A4545; }
.dv-gantt-c2 { background: #B45309; }
.dv-gantt-c3 { background: #7C3AED; }
.dv-gantt-c4 { background: #BE185D; }
.dv-gantt-c5 { background: #15803D; }
.dv-gantt-c6 { background: #C2410C; }
.dv-gantt-c7 { background: #8A6D1D; }

/* Today: a thin orange line down the chart. */
.dv-gantt tbody td.dv-gantt-today,
.dv-gantt tfoot td.dv-gantt-today {
    background-image: linear-gradient(#F97316, #F97316);
    background-size: 2px 100%;
    background-position: center;
    background-repeat: no-repeat;
}

/* --- Words in the name cell --- */
/* The working days, on the right of the name. */
.dv-gantt-dur {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    padding: 1px 7px;
    border: 1px solid #D3DAE5;
    border-radius: 999px;
    background: #FFFFFF;
    color: #2D2A2A;
    font-size: 0.66rem;
    font-weight: 700;
}

.dv-gantt-km {
    color: #6B7280;
    font-weight: 400;
    margin-left: 4px;
}

/* One line each, so every item line is the same low height. */
.dv-gantt-desc,
.dv-gantt-meta {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.dv-gantt-desc {
    font-weight: 600;
    color: var(--dv-navy);
}

.dv-gantt-meta {
    font-size: 0.68rem;
    color: #5B6577;
}

.dv-gantt-notes {
    display: block;
    font-size: 0.68rem;
    color: #5B6577;
}

.dv-gantt-caret {
    display: inline-block;
    width: 0;
    height: 0;
    margin-right: 6px;
    vertical-align: middle;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #6B7280;
    transition: transform 0.15s ease;
}

.dv-gantt-folded .dv-gantt-caret {
    transform: rotate(-90deg);
}

.dv-gantt-folded .dv-gantt-item {
    display: none;
}

.dv-gantt-swatch {
    display: inline-block;
    width: 9px;
    height: 9px;
    margin-right: 4px;
    border-radius: 2px;
    vertical-align: -1px;
}

/* --- The right: person days, and the team's badge --- */
.dv-gantt .dv-gantt-total {
    min-width: 52px;
    font-weight: 700;
    color: #111827;
    border-left: 3px solid #FFFFFF;
}

.dv-gantt .dv-gantt-team {
    min-width: 44px;
}

.dv-gantt-badge {
    display: inline-block;
    width: 26px;
    height: 26px;
    line-height: 26px;
    border-radius: 50%;
    color: #FFFFFF;
    font-size: 0.64rem;
    font-weight: 700;
}

/* --- The item lines open their plan with one click --- */
.dv-gantt tr[data-dv-prog-row] {
    cursor: pointer;
}

.dv-gantt tr[data-dv-prog-row]:hover td:not(.dv-gantt-total):not(.dv-gantt-team):not(.dv-gantt-people) {
    background-color: #E4E4E5;
}

.dv-gantt tr[data-dv-prog-row]:hover td.dv-gantt-today {
    background-color: #E4E4E5;
}

.dv-gantt tr[data-dv-prog-row]:focus-visible {
    outline: 2px solid var(--dv-blue);
    outline-offset: -2px;
}

/* --- The Labour row --- */
.dv-gantt tfoot td {
    height: 34px;
    font-weight: 700;
    color: #111827;
    background: #FFFFFF;
    border-top: 2px solid var(--dv-navy);
}

.dv-gantt tfoot .dv-gantt-lab {
    background: #FFFFFF;
}

.dv-gantt-legend {
    flex-wrap: wrap;
    gap: 6px 14px;
}

.dv-gantt-key {
    font-size: 0.75rem;
    color: #374151;
    white-space: nowrap;
}

@media (max-width: 767.98px) {
    .dv-gantt .dv-gantt-lab {
        min-width: 190px;
        max-width: 190px;
    }

    .dv-gantt-item .dv-gantt-lab {
        padding-left: 28px;
    }

    .dv-gantt-square {
        left: 9px;
    }

    .dv-gantt th,
    .dv-gantt td {
        min-width: 24px;
    }

    .dv-gantt-km {
        display: block;
        margin-left: 14px;
    }
}


/* ==========================================================================
   Task 4.10. The Return to Client tab: the checks with a tick or a cross,
   the documents to send one per line with their buttons on the right, and
   the address, note and Return to Client under them.
   ========================================================================== */
.dv-checks {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dv-checks li {
    display: flex;
    align-items: center;
    gap: var(--dv-space-2);
    padding: 6px 0;
    border-bottom: 1px solid var(--dv-line-soft);
}

.dv-checks li:last-child {
    border-bottom: none;
}

.dv-check-mark {
    flex: 0 0 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.75rem;
}

.dv-check-ok .dv-check-mark {
    background: var(--dv-tint-green);
    color: var(--dv-green-deep);
}

.dv-check-no .dv-check-mark {
    background: var(--dv-tint-red);
    color: var(--dv-danger);
}

.dv-send-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--dv-space-2);
    padding: 8px 0;
    border-bottom: 1px solid var(--dv-line-soft);
}

.dv-send-name {
    min-width: 0;
    overflow-wrap: anywhere;
}

.dv-send-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--dv-space-2);
}

.dv-return-go {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--dv-space-3);
    margin-top: var(--dv-space-3);
}

@media (max-width: 767.98px) {
    .dv-send-actions {
        width: 100%;
    }

    .dv-send-actions form,
    .dv-send-actions > .btn {
        flex: 1 1 0;
    }

    .dv-send-actions .btn {
        width: 100%;
        min-height: 38px;
    }

    .dv-return-go .btn {
        width: 100%;
        min-height: 38px;
    }

    #dvReturnTo,
    #dvReturnNote {
        font-size: 16px;
    }
}

/* ---------------------------------------------------------------------------
   Task 4.11. Where a job card stands with the client, above its tabs: with the
   client (with the two reply buttons), changes asked, or accepted.
   --------------------------------------------------------------------------- */
.dv-reply-notice {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--dv-space-2) var(--dv-space-3);
}

.dv-reply-actions {
    display: flex;
    gap: var(--dv-space-2);
}

.dv-carry-ok {
    border-left-color: var(--dv-success);
    background: var(--dv-tint-green);
}

@media (max-width: 767.98px) {
    .dv-reply-actions {
        width: 100%;
    }

    .dv-reply-actions .btn {
        flex: 1 1 0;
        min-height: 38px;
    }
}

/* ---------------------------------------------------------------------------
   Task 4.12. A job card's Documents tab in parts: Added, Ready to send, and
   Sent to the client, one card per version with its reply under the table.
   --------------------------------------------------------------------------- */
.dv-docs-heading {
    margin-top: var(--dv-space-4);
}

.dv-version-head {
    margin-bottom: var(--dv-space-3);
    font-size: 0.9rem;
    overflow-wrap: anywhere;
}

.dv-version-reply {
    margin-top: var(--dv-space-3);
    font-size: 0.85rem;
}

/* Snag 19. The tick under a document sent before: send it again with the next version. */
.dv-send-again {
    margin: var(--dv-space-1) 0 0;
    font-size: 0.85rem;
}

@media (max-width: 767.98px) {
    .dv-send-again {
        min-height: 38px;
        display: flex;
        align-items: center;
        gap: var(--dv-space-2);
    }
}

/* Snag 20. A programme row's notes under its plan line, readable by everyone. */
.dv-prog-notes {
    font-style: italic;
    white-space: normal;
    overflow-wrap: anywhere;
}

/* Sprint 4, Leon's change of 25 October 2026, as RADAR's Sprint 8: a phone
   zooms in on a box whose text is under 16 pixels the moment it is tapped.
   Every text box, dropdown and note box is 16px on a phone. Phone only. */
@media (max-width: 767.98px) {
    input.form-control,
    textarea.form-control,
    select.form-select,
    body.dv-field-mode input.form-control,
    body.dv-field-mode textarea.form-control,
    body.dv-field-mode select.form-select {
        font-size: 16px;
    }
}

/* Leon, 25 October 2026. The new stretch's fields in the item window line up
   with every other box in the window, edge to edge: no padding of their own. */
.dv-item-new-stretch {
    margin-bottom: var(--dv-space-3);
}

/* ---------------------------------------------------------------------------
   Leon, 25 October 2026. The portal, more compact for the tablet and the
   phone: a smaller header and title, a slimmer stage bar, smaller tabs, and
   cards whose headings take less room than the values under them. First on
   the job card screens, then, at Leon's word the same day, on every page:
   the layout puts dv-compact on the page. RADAR keeps its larger look.
   --------------------------------------------------------------------------- */
.dv-stage-strip-flow {
    margin-top: var(--dv-space-3);
}

.dv-compact .dv-detail-head {
    padding: 14px 18px;
    margin-bottom: var(--dv-space-3);
}

.dv-compact .dv-detail-head-row {
    margin-bottom: var(--dv-space-2);
    align-items: center;
}

.dv-compact .dv-detail-number {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.2px;
}

.dv-compact .dv-detail-name {
    font-size: 0.82rem;
    margin-top: 2px;
}

.dv-compact .dv-detail-meta {
    gap: 4px var(--dv-space-4);
    font-size: 0.74rem;
}

.dv-compact .dv-stage-strip-flow {
    margin-top: 10px;
}

.dv-compact .dv-stage {
    padding: 5px 4px;
    line-height: 1.3;
}

/* The step's number sits on the line with its name. */
.dv-compact .dv-stage-n {
    display: inline;
    margin-right: 4px;
}

.dv-compact .dv-stage-sub {
    font-size: 0.55rem;
    margin-top: 1px;
}

.dv-compact .dv-tabs {
    padding: 4px;
    margin-bottom: var(--dv-space-3);
}

.dv-compact .dv-tab {
    padding: 6px 12px;
    font-size: 0.7rem;
    letter-spacing: 0.4px;
}

.dv-compact .dv-card {
    padding: var(--dv-space-4);
    margin-bottom: var(--dv-space-3);
}

.dv-compact .dv-card > .dv-card-heading,
.dv-compact .dv-card > div:first-child:has(> .dv-card-heading) {
    margin: calc(var(--dv-space-4) * -1) calc(var(--dv-space-4) * -1) var(--dv-space-3);
    padding: 9px var(--dv-space-4);
}

.dv-compact .dv-card-heading {
    font-size: 0.66rem;
    letter-spacing: 0.6px;
}

.dv-compact .dv-card > div:first-child:has(> .dv-card-heading) > .dv-card-heading {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

/* A register's cards: a smaller name and closer padding. */
.dv-compact .dv-item-card-head {
    padding: var(--dv-space-3) var(--dv-space-3) var(--dv-space-1);
}

.dv-compact .dv-item-card-number {
    font-size: 0.9rem;
    font-weight: 700;
}

.dv-compact .dv-item-card-body {
    padding: 0 var(--dv-space-3) var(--dv-space-2);
}

.dv-compact .dv-item-card-foot {
    padding: var(--dv-space-2) var(--dv-space-3);
}

/* A record's rows of label and value sit closer. */
.dv-compact .dv-row {
    padding: 6px 0;
}

.dv-compact .dv-carry-note {
    padding: 8px var(--dv-space-3);
    margin-bottom: var(--dv-space-3);
}

.dv-compact .dv-empty {
    padding: var(--dv-space-4);
}

.dv-compact .dv-toolbar {
    margin-bottom: var(--dv-space-3);
}

/* On a phone the step's second line goes, so four steps fit a row, and
   the header and cards sit closer to their edges. */
@media (max-width: 767.98px) {
    .dv-compact .dv-detail-head {
        padding: 12px 14px;
    }

    .dv-compact .dv-detail-number {
        font-size: 1.05rem;
    }

    .dv-compact .dv-stage-sub {
        display: none;
    }

    /* The three greyed steps of the next phase stay on the tablet and the
       desktop; on a phone the bar shows the four steps of the flow, one row. */
    .dv-compact .dv-stage-strip-flow .dv-stage.later {
        display: none;
    }

    .dv-compact .dv-detail-meta {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 2px var(--dv-space-3);
    }

    .dv-compact .dv-detail-actions .btn {
        min-height: 38px;
    }

    .dv-compact .dv-card {
        padding: var(--dv-space-3);
    }

    .dv-compact .dv-card > .dv-card-heading,
    .dv-compact .dv-card > div:first-child:has(> .dv-card-heading) {
        margin: calc(var(--dv-space-3) * -1) calc(var(--dv-space-3) * -1) var(--dv-space-3);
        padding: 8px var(--dv-space-3);
    }
}

/* Leon, 25 October 2026. A record's stage beside its title in the top bar,
   where the job card page's header card used to show it. */
.dv-appbar-status {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--dv-space-1);
}

/* Leon, 25 October 2026. The price list, opened under the item box to look an
   item up: a filter and a short list that scrolls inside its own box. */
.dv-item-browse {
    margin-top: var(--dv-space-2);
    padding: var(--dv-space-2);
    border: 1px solid var(--dv-line);
    border-radius: var(--dv-radius-sm);
    background: var(--dv-surface);
}

.dv-item-browse-list {
    max-height: 15rem;
    overflow-y: auto;
}

.dv-item-browse-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px var(--dv-space-2);
    width: 100%;
    padding: 6px var(--dv-space-2);
    border: none;
    border-bottom: 1px solid var(--dv-line-soft);
    background: none;
    text-align: left;
    font-size: 0.82rem;
    color: var(--dv-text);
}

.dv-item-browse-row:hover,
.dv-item-browse-row:focus-visible {
    background: var(--dv-tint-blue);
}

.dv-item-browse-desc {
    flex: 1 1 12rem;
    min-width: 0;
}

@media (max-width: 767.98px) {
    .dv-item-browse-row {
        min-height: 38px;
    }
}

/* Leon, 25 October 2026. A table inside a card, such as the Teams, People
   and Plant on a job card, was a second dark band under the card's own
   heading. Inside a card the table sits flat in a thin border with a light
   heading; a table on its own, such as a register, keeps the dark one. */
.dv-compact .dv-card .table-wrapper {
    box-shadow: none;
    border: 1px solid var(--dv-line);
    border-radius: var(--dv-radius-sm);
}

.dv-compact .dv-card .table > thead th,
.dv-compact .dv-card .table thead th {
    background: var(--dv-canvas);
    color: var(--dv-text-muted);
    border-bottom: 1px solid var(--dv-line);
    letter-spacing: 0.3px;
}

.dv-compact .dv-card .table > tfoot td {
    background: var(--dv-canvas);
}

.dv-compact .dv-card .sortable th:hover {
    background: var(--dv-tint-blue);
}

/* Leon, 25 October 2026: "Can these headers be the same size please. Please
   check this everywhere." A card's heading strip is one height on every page,
   whether it holds only the heading or the heading with a button beside it,
   such as Documents to send with Add other. A button in the strip is drawn a
   little lower so it fits; on a phone it keeps 38 pixels for a thumb. */
.dv-card > .dv-card-heading,
.dv-card > div:first-child:has(> .dv-card-heading),
.dv-compact .dv-card > .dv-card-heading,
.dv-compact .dv-card > div:first-child:has(> .dv-card-heading) {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    height: 46px;
    padding-top: 0;
    padding-bottom: 0;
}

.dv-card > div:first-child:has(> .dv-card-heading) .btn {
    min-height: 0;
    height: 32px;
    padding-top: 0;
    padding-bottom: 0;
    display: inline-flex;
    align-items: center;
}

@media (max-width: 767.98px) {
    .dv-card > .dv-card-heading,
    .dv-card > div:first-child:has(> .dv-card-heading),
    .dv-compact .dv-card > .dv-card-heading,
    .dv-compact .dv-card > div:first-child:has(> .dv-card-heading) {
        height: 48px;
    }

    .dv-card > div:first-child:has(> .dv-card-heading) .btn {
        height: 38px;
    }
}

/* ==========================================================================
   Leon, 25 October 2026: "This is the look I want everywhere", from his
   pictures of a job card's Programme and Resources tabs. Clean and calm:
   white cards with a thin cool grey border on a very light page, a heading
   row in each card with a blue to teal mark, tables in a rounded light box,
   counts in small pills, a team's colour beside its name, and one white tab
   strip with the open tab in blue. Later rules here win over the earlier
   ones for the same parts, so the look is set in one place.
   ========================================================================== */
:root {
    --dv-canvas:        #F7F7F7;
    --dv-card-line:     #DFDFE0;
    --dv-line:          #E2E2E3;
    --dv-line-soft:     #EDEDED;
    --dv-text-muted:    #6E6A6A;
    --dv-row-hover:     #EEF8F5;
    --bs-body-bg:       #F7F7F7;
}

/* --- The tabs: one white rounded strip, the open tab filled blue --- */
.dv-tabs,
.dv-compact .dv-tabs {
    gap: 2px;
    padding: 5px;
    background: #FFFFFF;
    border: 1px solid var(--dv-card-line);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(45, 42, 42, 0.04);
}

.dv-tab,
.dv-compact .dv-tab {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    background: transparent;
    border-radius: 9px;
    color: #5A5656;
}

.dv-tab:hover,
.dv-compact .dv-tab:hover {
    background: var(--dv-row-hover);
    color: var(--dv-navy);
}

.dv-tab.active,
.dv-compact .dv-tab.active {
    color: #FFFFFF;
    background: linear-gradient(135deg, var(--dv-blue-bright), var(--dv-blue));
    box-shadow: 0 2px 6px rgba(8, 138, 112, 0.25);
}

.dv-tab-count {
    background: #F1F1F1;
    color: #2D2A2A;
}

.dv-tab:focus-visible,
.btn:focus-visible,
.dv-nav-item:focus-visible {
    outline: 2px solid var(--dv-blue-bright);
    outline-offset: 2px;
}

/* --- Cards: white, thin cool grey border, 14 pixel corners, a breath of shadow --- */
.dv-card,
.dv-compact .dv-card {
    background: #FFFFFF;
    border: 1px solid var(--dv-card-line);
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(45, 42, 42, 0.04);
    padding: 18px;
    margin-bottom: 16px;
}

/* The card's heading row: white, a fine line under it, the title a little larger. */
.dv-card > .dv-card-heading,
.dv-card > div:first-child:has(> .dv-card-heading),
.dv-compact .dv-card > .dv-card-heading,
.dv-compact .dv-card > div:first-child:has(> .dv-card-heading) {
    height: 52px;
    margin: -18px -18px 16px;
    padding: 0 18px;
    background: #FFFFFF;
    border-bottom: 1px solid var(--dv-line-soft);
    border-radius: 13px 13px 0 0;
}

.dv-card-heading,
.dv-compact .dv-card-heading {
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: var(--dv-navy);
}

.dv-card-heading::before {
    width: 3px;
    height: 18px;
    background: linear-gradient(180deg, var(--dv-blue-bright), #18AAA9);
}

/* --- Tables inside a card: a rounded light box, pale heading, fine row lines --- */
.dv-card .table-wrapper,
.dv-compact .dv-card .table-wrapper {
    border: 1px solid var(--dv-card-line);
    border-radius: 12px;
    box-shadow: none;
    overflow: auto;
}

.dv-card .table > thead th,
.dv-card .table thead th,
.dv-compact .dv-card .table > thead th,
.dv-compact .dv-card .table thead th {
    background: #F6F6F6;
    color: var(--dv-text-muted);
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.4px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--dv-line);
}

.dv-card .table > tbody > tr > td,
.dv-compact .dv-card .table > tbody > tr > td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--dv-line-soft);
    color: #2D2A2A;
    vertical-align: middle;
}

.dv-card .table > tbody > tr:last-child > td {
    border-bottom: 0;
}

.dv-card .table-hover > tbody > tr:hover > *,
.dv-card .table > tbody > tr.dv-clickable:hover > * {
    --bs-table-accent-bg: var(--dv-row-hover);
    background-color: var(--dv-row-hover);
}

.dv-card .table td strong {
    color: var(--dv-navy);
}

.dv-card .sortable th:hover,
.dv-compact .dv-card .sortable th:hover {
    background: #EFEFEF;
}

/* A count in a small pale pill, such as a team's members. */
.dv-count-pill {
    display: inline-block;
    min-width: 28px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #F1F1F1;
    color: #2D2A2A;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
}

/* A team's colour beside its name, the same as its bars on the programme. */
.dv-team-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 10px;
    border-radius: 50%;
    vertical-align: 0;
}

/* --- Empty text inside a card --- */
.dv-card > p.dv-muted,
.dv-card > div > p.dv-muted.mb-0 {
    color: var(--dv-text-muted);
    padding: 4px 0;
}

/* --- Notices: pale fill, thin border, a stronger left edge, rounded --- */
.dv-carry-note,
.dv-compact .dv-carry-note {
    padding: 12px 16px;
    border: 1px solid var(--dv-line);
    border-left: 4px solid var(--dv-blue);
    border-radius: 10px;
}

.dv-carry-ok {
    border-color: #BFE3C6;
    border-left-color: #2F9E58;
    background: #EAF6E7;
    color: #1F4D2E;
}

.dv-carry-warn {
    border-color: #F3DDB5;
    border-left-color: var(--dv-warning);
}

.dv-reply-notice.dv-carry-ok {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.dv-notice-tick {
    flex-shrink: 0;
    margin-right: 10px;
}

/* --- The side menu: the open item a lighter navy with a narrow blue edge --- */
.dv-nav-item.active,
.dv-nav-item.active:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #FFFFFF;
    box-shadow: inset 3px 0 0 var(--dv-blue-bright);
}

.dv-nav-item.active .dv-nav-icon {
    color: #FFFFFF;
}

/* --- Buttons with their file's icon --- */
.dv-btn-img {
    width: 16px;
    height: 16px;
    margin-right: 6px;
    vertical-align: -3px;
}

/* --- Field mode as a switch --- */
.dv-switch .form-check-input {
    width: 2.1em;
    height: 1.15em;
    margin: 0;
    border-radius: 2em;
    background-color: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
    background-position: left center;
    background-repeat: no-repeat;
    background-size: contain;
    transition: background-position 0.15s ease-in-out;
    cursor: pointer;
}

.dv-switch .form-check-input:checked {
    background-color: var(--dv-green);
    border-color: var(--dv-green);
    background-position: right center;
}

.dv-switch .form-check-input:focus-visible {
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.35);
}

@media (max-width: 767.98px) {
    .dv-card,
    .dv-compact .dv-card {
        padding: 14px;
    }

    .dv-card > .dv-card-heading,
    .dv-card > div:first-child:has(> .dv-card-heading),
    .dv-compact .dv-card > .dv-card-heading,
    .dv-compact .dv-card > div:first-child:has(> .dv-card-heading) {
        height: 50px;
        margin: -14px -14px 14px;
        padding: 0 14px;
    }

    .dv-card .table > thead th,
    .dv-card .table > tbody > tr > td {
        padding: 9px 10px;
    }
}

/* --------------------------------------------------------------------------
   Leon, 25 October 2026: "can we please get this look and feel through the
   entire platform. All screens." So the same light look reaches every
   table, the record header on a project's and a trip's page, and every
   window, not only the job card.
   -------------------------------------------------------------------------- */

/* Every table, a register's too: a rounded white box with a thin border and a
   pale heading row, in place of the dark heading band. */
.table-wrapper {
    background: #FFFFFF;
    border: 1px solid var(--dv-card-line);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(45, 42, 42, 0.04);
}

.table > thead th,
.table thead th {
    background: #F6F6F6;
    color: var(--dv-text-muted);
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.4px;
    border-bottom: 1px solid var(--dv-line);
}

.sortable th:hover,
.sortable th.no-sort:hover {
    background: #EFEFEF;
}

.sortable th.no-sort:hover {
    background: #F6F6F6;
}

.table > tbody > tr > td {
    border-bottom: 1px solid var(--dv-line-soft);
    color: #2D2A2A;
    vertical-align: middle;
}

.table > tbody > tr:last-child > td {
    border-bottom: 0;
}

.table-hover > tbody > tr:hover > *,
.table > tbody > tr.dv-clickable:hover > * {
    --bs-table-accent-bg: var(--dv-row-hover);
    background-color: var(--dv-row-hover);
}

.table td strong,
.table td a.table-action-link:first-child {
    color: var(--dv-navy);
}

/* A record's header, on a project's or a trip's page: a white card with dark
   text, not a dark band. */
.dv-detail-head,
.dv-compact .dv-detail-head {
    background: #FFFFFF;
    border: 1px solid var(--dv-card-line);
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(45, 42, 42, 0.04);
    color: #2D2A2A;
}

.dv-detail-head::after {
    display: none;
}

.dv-detail-number {
    color: var(--dv-navy);
}

.dv-detail-name {
    color: var(--dv-text-muted);
}

.dv-detail-meta {
    color: var(--dv-text-muted);
}

.dv-detail-meta strong {
    color: #2D2A2A;
}

/* A window's heading: white with a fine line under it and navy words. */
.modal-header {
    background: #FFFFFF;
    color: var(--dv-navy);
    border-bottom: 1px solid var(--dv-line-soft);
}

.modal-title {
    color: var(--dv-navy);
}

.modal-header .btn-close {
    filter: none;
}

.modal-content {
    border: 1px solid var(--dv-card-line);
    border-radius: 14px;
}

/* A good status, such as Accepted or Active, carries a small green tick. */
.dv-badge-good::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 5px;
    vertical-align: -2px;
    border-radius: 50%;
    background: #2F9E58 url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3e%3cpath d='M3.2 6.2l1.8 1.8L8.8 4.2' fill='none' stroke='%23fff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e") center / 12px 12px no-repeat;
}

/* The parties on a job card: the role in small capitals on the left, the
   name in bold with its contact lines under it, all from one left edge. */
.dv-parties .dv-row {
    align-items: flex-start;
}

.dv-parties .dv-row-label {
    flex: 0 0 38%;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--dv-text-muted);
    padding-top: 2px;
}

.dv-parties .dv-row-value {
    flex: 1 1 auto;
    text-align: left;
    font-weight: 700;
    color: var(--dv-navy);
    line-height: 1.55;
}

.dv-parties .dv-row-value .dv-muted {
    font-weight: 400;
    color: #2D2A2A;
}

/* The page's one main button may carry a small icon before its words. */
.dv-btn-icon {
    width: 14px;
    height: 14px;
    margin-right: 6px;
    vertical-align: -2px;
}

@media (max-width: 767.98px) {
    .dv-parties .dv-row {
        flex-wrap: wrap;
        gap: 2px;
    }

    .dv-parties .dv-row-label {
        flex-basis: 100%;
    }
}

/* A register's cards and the dashboard's tiles: the same thin border and
   corners as every other card. */
.dv-item-card,
.dv-kpi {
    border: 1px solid var(--dv-card-line);
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(45, 42, 42, 0.04);
}

/* A chosen button among its neighbours, such as This month on the travel
   logs, is pale blue with blue words, not a dark grey block. */
.btn-secondary.active,
.btn-secondary:active {
    background: #E3F4EF;
    border-color: #9FD9CB;
    color: var(--dv-blue);
}

/* On a phone a card's table rows stack as small cards of their own, so the
   table's outer box goes, rather than drawing a box around the boxes. */
@media (max-width: 767.98px) {
    .dv-card .table-wrapper,
    .dv-compact .dv-card .table-wrapper {
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }
}

/* Leon, 25 October 2026: a list card has no Open button. Its number is the
   link, drawn as the number, and a click anywhere on the card opens it. */
a.dv-card-number-link,
a.dv-card-number-link:hover {
    display: inline-block;
    text-decoration: none;
}

a.dv-card-number-link:focus-visible {
    outline: 2px solid var(--dv-blue-bright);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ==========================================================================
   Leon, 25 October 2026: "Can you explain why you cannot style it like the
   picture I gave? ... It's everywhere." His pictures are drawn at a larger
   scale than the compact look: 16 pixel text at about 1670 pixels wide, card
   titles about 17 pixels, tabs about 13, the page title about 26, rows about
   44 pixels high. So on a desktop (1200 pixels and wider) the whole look is
   sized to the pictures, in rem so it grows together. Leon then found 16
   pixel text too big, so it is 14 pixel text up to 1599 pixels wide and 15
   from 1600. A tablet and a phone keep the compact sizes Leon asked for on
   25 October.
   ========================================================================== */
@media (min-width: 1200px) {
    html {
        font-size: 14px;
    }

    :root {
        --dv-sidebar-w: 264px;
        --dv-appbar-h:  4.4rem;
    }

    /* The side menu and the top bar. */
    .dv-nav-item {
        font-size: 0.98rem;
        padding: 0.7rem 0.85rem;
        border-radius: 10px;
    }

    .dv-appbar-title {
        font-size: 1.55rem;
        font-weight: 800;
    }

    .dv-appbar-subtitle,
    .dv-appbar .dv-badge {
        font-size: 0.85rem;
        padding: 0.35rem 0.85rem;
    }

    /* Badges, notices and buttons. */
    .dv-badge {
        font-size: 0.78rem;
        padding: 0.25rem 0.7rem;
    }

    .dv-carry-note,
    .dv-compact .dv-carry-note {
        font-size: 1rem;
        padding: 0.8rem 1.1rem;
        margin-bottom: 1rem;
    }

    .btn {
        font-size: 0.95rem;
    }

    .btn-sm {
        font-size: 0.92rem;
        min-height: 2.75rem;
        padding: 0.5rem 1.1rem;
        border-radius: 10px;
    }

    .dv-toolbar .form-control,
    .dv-toolbar .form-select {
        font-size: 0.95rem;
        min-height: 2.75rem;
    }

    /* The tabs. */
    .dv-tabs,
    .dv-compact .dv-tabs {
        padding: 0.35rem;
        margin-bottom: 1.1rem;
    }

    .dv-tab,
    .dv-compact .dv-tab {
        font-size: 0.8rem;
        font-weight: 700;
        letter-spacing: 0.3px;
        padding: 0.75rem 1.1rem;
    }

    .dv-tab-count {
        font-size: 0.72rem;
    }

    /* Cards and their heading rows. */
    .dv-card,
    .dv-compact .dv-card {
        padding: 1.25rem;
        margin-bottom: 1.1rem;
    }

    .dv-card > .dv-card-heading,
    .dv-card > div:first-child:has(> .dv-card-heading),
    .dv-compact .dv-card > .dv-card-heading,
    .dv-compact .dv-card > div:first-child:has(> .dv-card-heading) {
        height: 3.75rem;
        margin: -1.25rem -1.25rem 1.1rem;
        padding: 0 1.25rem;
    }

    .dv-card-heading,
    .dv-compact .dv-card-heading {
        font-size: 1.02rem;
        letter-spacing: 0.4px;
    }

    .dv-card-heading::before {
        width: 4px;
        height: 1.3rem;
    }

    .dv-card > div:first-child:has(> .dv-card-heading) .btn {
        height: 2.4rem;
    }

    /* A record's label and value rows. */
    .dv-row,
    .dv-compact .dv-row {
        font-size: 1rem;
        padding: 0.7rem 0;
    }

    .dv-row-label {
        font-size: 1rem;
    }

    .dv-parties .dv-row-label {
        font-size: 0.8rem;
    }

    /* Tables. */
    .table {
        font-size: 0.95rem;
    }

    .table > thead th,
    .table thead th,
    .dv-card .table > thead th,
    .dv-compact .dv-card .table thead th {
        font-size: 0.72rem;
        padding: 0.8rem 1rem;
    }

    .table > tbody > tr > td,
    .dv-card .table > tbody > tr > td,
    .dv-compact .dv-card .table > tbody > tr > td {
        padding: 0.8rem 1rem;
    }

    .dv-count-pill {
        font-size: 0.85rem;
        padding: 0.15rem 0.65rem;
    }

    /* A register's cards. */
    .dv-compact .dv-item-card-head {
        padding: 1rem 1.1rem 0.4rem;
    }

    .dv-compact .dv-item-card-number {
        font-size: 1.1rem;
    }

    .dv-compact .dv-item-card-body {
        padding: 0 1.1rem 0.9rem;
        font-size: 0.95rem;
    }

    .dv-item-card-line {
        padding: 0.2rem 0;
    }

    /* Windows. */
    .modal-title {
        font-size: 1rem;
    }

    /* The programme: the chart in its own white panel, the cells sized with the text. */
    .dv-gantt-wrap {
        border: 1px solid var(--dv-card-line);
        border-radius: 14px;
        padding: 0.4rem 0.6rem 0.6rem;
        box-shadow: 0 1px 2px rgba(45, 42, 42, 0.04);
    }

    .dv-gantt {
        font-size: 0.85rem;
    }

    .dv-gantt th,
    .dv-gantt td {
        min-width: 1.85rem;
        height: 2.5rem;
    }

    .dv-gantt-weeks th {
        height: 2.1rem;
        font-size: 0.8rem;
    }

    .dv-gantt-days th {
        height: 2.4rem;
        font-size: 0.66rem;
    }

    .dv-gantt-days th span {
        font-size: 0.8rem;
    }

    .dv-gantt .dv-gantt-lab {
        min-width: 26rem;
        max-width: 26rem;
        padding-right: 3.6rem;
    }

    .dv-gantt-desc {
        font-size: 0.88rem;
    }

    .dv-gantt-meta,
    .dv-gantt-notes {
        font-size: 0.76rem;
    }

    .dv-gantt-dur {
        font-size: 0.74rem;
    }

    .dv-gantt-bar {
        height: 1.65rem;
        line-height: 1.65rem;
        font-size: 0.76rem;
    }

    .dv-gantt-pill {
        min-width: 2.1rem;
        height: 1.7rem;
        line-height: 1.7rem;
        font-size: 0.8rem;
    }

    .dv-gantt-badge {
        width: 1.85rem;
        height: 1.85rem;
        line-height: 1.85rem;
        font-size: 0.72rem;
    }

    .dv-gantt-square {
        width: 0.85rem;
        height: 0.85rem;
        margin-top: -0.425rem;
    }

    .dv-gantt-item .dv-gantt-lab {
        padding-left: 2.2rem;
    }

    .dv-gantt .dv-gantt-people {
        min-width: 3.1rem;
    }

    .dv-gantt .dv-gantt-total {
        min-width: 3.4rem;
    }

    .dv-gantt .dv-gantt-team {
        min-width: 2.8rem;
    }
}

@media (min-width: 1600px) {
    html {
        font-size: 15px;
    }

    :root {
        --dv-sidebar-w: 264px;
    }
}

/* --------------------------------------------------------------------------
   Leon, 25 October 2026: "also the borders. check everything." Every border
   is one of two cool greys, so nothing looks patched together:
     the edge of a thing   cards, tabs, windows, table boxes, buttons, notices
                           (--dv-card-line, firm enough to see on the page);
     a line inside it      under a heading, between rows (--dv-line-soft).
   A box a person types in is a step firmer (--dv-field-line), so it reads as
   a field. Cards also carry a soft shadow, as in the pictures.
   -------------------------------------------------------------------------- */
:root {
    --dv-card-line:   #DBDBDC;
    --dv-line:        #DBDBDC;
    --dv-line-soft:   #EBEBEB;
    --dv-field-line:  #CDCDCE;
    --dv-field-hover: #A8A8A9;
    --dv-card-shadow: 0 1px 2px rgba(45, 42, 42, 0.05), 0 4px 14px rgba(45, 42, 42, 0.05);
}

.dv-card,
.dv-compact .dv-card,
.dv-item-card,
.dv-kpi,
.dv-detail-head,
.dv-compact .dv-detail-head,
.dv-gantt-wrap,
.table-wrapper,
.dv-tabs,
.dv-compact .dv-tabs {
    border-color: var(--dv-card-line);
}

.dv-card,
.dv-compact .dv-card,
.dv-item-card,
.dv-kpi,
.dv-detail-head,
.dv-compact .dv-detail-head {
    box-shadow: var(--dv-card-shadow);
}

.btn-secondary {
    border-color: var(--dv-card-line);
}

.form-control,
.form-select {
    border-color: var(--dv-field-line);
}

.form-control:hover,
.form-select:hover {
    border-color: var(--dv-field-hover);
}

.modal-content {
    border-color: var(--dv-card-line);
}

.modal-footer {
    border-top-color: var(--dv-line-soft);
}

/* A notice's left edge takes its own colour: green for good news, amber for
   a warning, blue otherwise. */
.dv-carry-note.dv-carry-ok {
    border-color: #BFE3C6;
    border-left-color: #2F9E58;
}

.dv-carry-note.dv-carry-warn {
    border-color: #F1DDB8;
    border-left-color: var(--dv-warning);
}

/* Contact lines under a party's name read at the row's own size. */
.dv-parties .dv-row-value .dv-muted {
    font-size: 0.92em;
}

/* An item's bar runs over the white line between its days, so it reads as
   one bar, as in Leon's picture, not a row of blocks. */
.dv-gantt-item td.dv-gantt-on:not(.dv-gantt-first) .dv-gantt-bar {
    margin-left: -1px;
}

.dv-gantt-item td.dv-gantt-on.dv-gantt-mon:not(.dv-gantt-first) .dv-gantt-bar {
    margin-left: -2px;
}

/* Snag 27. An item's number leads its line on the programme, in bold. */
.dv-gantt-num {
    font-weight: 700;
    color: var(--dv-navy);
    margin-right: 0.4em;
}

/* Snag 28, Test Ninja's phone suggestion: on a phone the People column goes
   (the people are on the item's own line and in each day) and the names are
   narrower, so about twice as many days show beside them. */
@media (max-width: 767.98px) {
    .dv-gantt .dv-gantt-people {
        display: none;
    }

    /* Snag 95, retest. Room on the right for the days pill, "10 d" too, so
       the wrapped Original and Revised lines stop short of it. */
    .dv-gantt .dv-gantt-lab {
        min-width: 150px;
        max-width: 150px;
        padding-right: 3.6rem;
    }
}

/* Task 5.9. A rate typed in an item's row on the Items and prices tab. The box
   sits right aligned in its cell, as wide as a rate, with a short note under
   it: "Saved." for a moment, or the reason it was refused. */
.dv-rate-cell {
    min-width: 7.5rem;
}

.dv-rate-box {
    display: inline-block;
    width: 7.5rem;
    max-width: 100%;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.dv-rate-box::placeholder {
    color: var(--dv-warning);
    opacity: 1;
}

.dv-rate-note {
    display: block;
    font-size: 0.8em;
    color: var(--dv-text-muted);
    white-space: normal;
    min-height: 0;
}

.dv-rate-note:empty {
    display: none;
}

.dv-rate-note.dv-rate-refused {
    color: var(--dv-danger);
}

@media (max-width: 767.98px) {
    .dv-rate-box {
        width: 9rem;
        font-size: 16px;
        min-height: 38px;
    }
}

/* Task 5.10. Several items planned at once. Each item line starts with a tick
   box where the team's square was; once the item is planned the box keeps its
   team's colour, ticked or not. Each road stretch's header has a box that
   ticks all its items. A bar above the chart says how many are ticked. */
.dv-gantt-tick {
    position: absolute;
    top: 50%;
    left: 8px;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 0;
    cursor: pointer;
}

.dv-gantt-tick.dv-gantt-tick-c0, .dv-gantt-tick.dv-gantt-tick-c0:checked { background-color: #077A63; border-color: #077A63; }
.dv-gantt-tick.dv-gantt-tick-c1, .dv-gantt-tick.dv-gantt-tick-c1:checked { background-color: #4A4545; border-color: #4A4545; }
.dv-gantt-tick.dv-gantt-tick-c2, .dv-gantt-tick.dv-gantt-tick-c2:checked { background-color: #B45309; border-color: #B45309; }
.dv-gantt-tick.dv-gantt-tick-c3, .dv-gantt-tick.dv-gantt-tick-c3:checked { background-color: #7C3AED; border-color: #7C3AED; }
.dv-gantt-tick.dv-gantt-tick-c4, .dv-gantt-tick.dv-gantt-tick-c4:checked { background-color: #BE185D; border-color: #BE185D; }
.dv-gantt-tick.dv-gantt-tick-c5, .dv-gantt-tick.dv-gantt-tick-c5:checked { background-color: #15803D; border-color: #15803D; }
.dv-gantt-tick.dv-gantt-tick-c6, .dv-gantt-tick.dv-gantt-tick-c6:checked { background-color: #C2410C; border-color: #C2410C; }
.dv-gantt-tick.dv-gantt-tick-c7, .dv-gantt-tick.dv-gantt-tick-c7:checked { background-color: #8A6D1D; border-color: #8A6D1D; }

.dv-gantt-tick-all {
    vertical-align: middle;
    width: 16px;
    height: 16px;
    margin: -2px 6px 0 0;
    cursor: pointer;
    border-color: #FFFFFF;
}

.dv-tick-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
    padding: 0.45rem 0.75rem;
    border: 1px solid var(--dv-card-line);
    border-left: 3px solid var(--dv-blue);
    border-radius: 8px;
    background: var(--dv-tint-blue);
}

.dv-tick-bar[hidden] {
    display: none;
}

.dv-tick-count {
    font-weight: 700;
    color: var(--dv-navy);
    margin-right: 0.25rem;
}

.dv-plan-many-list {
    max-height: 14rem;
    overflow-y: auto;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--dv-line-soft);
    border-radius: 8px;
}

.dv-plan-many-stretch {
    font-weight: 700;
    color: var(--dv-navy);
}

.dv-plan-many-items {
    margin: 0 0 0.4rem 0;
    padding-left: 1.1rem;
}

@media (max-width: 767.98px) {
    .dv-gantt-tick {
        left: 4px;
        width: 22px;
        height: 22px;
        margin-top: -11px;
    }

    .dv-gantt-tick-all {
        width: 22px;
        height: 22px;
    }

    .dv-tick-bar .btn {
        flex: 1 1 auto;
        min-height: 38px;
    }

    .dv-tick-count {
        flex: 1 1 100%;
    }
}

/* Snag 30, Test Ninja's phone suggestion. On a phone an item on the Items and
   prices tab is a card with Item, Unit and Quantity side by side on its first
   line, the Description under them, then Rate and Amount side by side, with
   closer lines, so about twice as many items show on the screen while
   pricing. */
@media (max-width: 767.98px) {
    .table-wrapper .dv-items-table > tbody > tr {
        display: grid;
        grid-template-columns: 1.3fr 1fr 1fr;
        column-gap: var(--dv-space-3);
    }

    .dv-card .table-wrapper .table.dv-items-table > tbody > tr > td {
        width: auto;
        min-width: 0;
        padding: 2px 0;
    }

    .table-wrapper .dv-items-table > tbody > tr > td:nth-child(1) { grid-column: 1; grid-row: 1; }
    .table-wrapper .dv-items-table > tbody > tr > td:nth-child(3) { grid-column: 2; grid-row: 1; }
    .table-wrapper .dv-items-table > tbody > tr > td:nth-child(4) { grid-column: 3; grid-row: 1; }
    .table-wrapper .dv-items-table > tbody > tr > td:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
    .table-wrapper .dv-items-table > tbody > tr > td:nth-child(5) { grid-column: 1 / span 2; grid-row: 3; }
    .table-wrapper .dv-items-table > tbody > tr > td:nth-child(6) { grid-column: 3; grid-row: 3; }

    .table-wrapper .dv-items-table .dv-rate-box {
        width: 100%;
    }
}

/* Snag 31, Test Ninja's phone suggestion. On a phone the ticked items bar
   stays at the foot of the screen while anything is ticked, so the count and
   Plan ticked items are under the thumb however far down the chart the last
   tick was. The page gains room at its foot so the bar covers nothing. A
   window opened from it sits above it. */
@media (max-width: 767.98px) {
    .dv-tick-bar {
        position: fixed;
        left: var(--dv-space-2);
        right: var(--dv-space-2);
        bottom: var(--dv-space-2);
        z-index: 1040;
        margin: 0;
        box-shadow: var(--dv-shadow);
        background: var(--dv-surface);
    }

    body.dv-ticking {
        padding-bottom: 7.5rem;
    }
}

/* Snag 33. With Daily Reports and Work Done, a started job card has nine
   tabs. On a desktop (1200 pixels and wider) they sit closer, with no letter
   spacing, a slightly smaller word and the counts tucked in, so all nine show
   at 1280 with the menu open. Below 1200 the strip scrolls on one line with a
   fade, as before. */
@media (min-width: 1200px) {
    .dv-tabs .dv-tab,
    .dv-compact .dv-tabs .dv-tab {
        font-size: 0.72rem;
        letter-spacing: 0;
        padding: 0.75rem 0.38rem;
    }

    .dv-tabs .dv-tab-count {
        margin-left: 3px;
        padding: 1px 4px;
    }
}

/* Snag 33. From 1440 pixels there is room again, so the tabs get a little of
   their padding back. */
@media (min-width: 1440px) {
    .dv-tabs .dv-tab,
    .dv-compact .dv-tabs .dv-tab {
        padding: 0.75rem 0.8rem;
    }
}

/* Task 5.4. The daily report window: one line per labour grade, the grade on
   the left and a short number box on the right, the total under them; the
   plant ticks one under the other; the signed report's name with Remove
   beside it. On the Daily Reports tab the work done wraps. */
.dv-labour-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--dv-space-3);
    padding: 3px 0;
    border-bottom: 1px solid var(--dv-line-soft);
}

.dv-labour-grade {
    flex: 1 1 auto;
    margin: 0;
}

.dv-labour-number {
    flex: 0 0 6rem;
    width: 6rem;
    text-align: right;
}

.dv-labour-total {
    border-bottom: 0;
    padding-top: 6px;
}

.dv-labour-total strong {
    flex: 0 0 6rem;
    text-align: right;
    padding-right: 0.75rem;
}

.dv-daily-signed {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--dv-space-3);
}

.dv-daily-work {
    white-space: normal;
    min-width: 12rem;
}

@media (max-width: 767.98px) {
    .dv-labour-number {
        flex-basis: 7rem;
        width: 7rem;
        min-height: 38px;
    }
}

/* Snag 35, Test Ninja's phone suggestion. On a phone each document in the
   Added part of the Documents tab is a card with the Name on its own line,
   Type and Date side by side, Size and Added side by side, then Download and
   Remove, with closer lines, so about twice as many show on the screen. */
@media (max-width: 767.98px) {
    .table-wrapper .dv-docs-table > tbody > tr {
        display: grid;
        grid-template-columns: 1fr 1fr;
        column-gap: var(--dv-space-3);
    }

    .dv-card .table-wrapper .table.dv-docs-table > tbody > tr > td,
    .table-wrapper .table.dv-docs-table > tbody > tr > td {
        width: auto;
        min-width: 0;
        padding: 2px 0;
    }

    .table-wrapper .dv-docs-table > tbody > tr > td:nth-child(1),
    .table-wrapper .dv-docs-table > tbody > tr > td:nth-child(6) {
        grid-column: 1 / -1;
    }
}

/* Task 5.5. The Work Done tab: each item's line, with its figures and
   Capture on the right and its repairs under it; Done in amber when it is more
   than the job card's quantity. In the capture window, the photos sit small
   in a row with Before or After under each, and open large in the window. */
.dv-work-item {
    padding: var(--dv-space-2) 0;
    border-top: 1px solid var(--dv-line-soft);
}

.dv-work-item:first-of-type {
    border-top: 0;
}

.dv-work-item-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--dv-space-2) var(--dv-space-3);
}

.dv-work-item-name {
    flex: 1 1 18rem;
    min-width: 0;
}

.dv-work-figures {
    display: flex;
    flex-wrap: wrap;
    gap: var(--dv-space-3);
    font-variant-numeric: tabular-nums;
    color: var(--dv-text-muted);
}

.dv-work-figures strong {
    color: var(--dv-text);
}

.dv-work-over,
.dv-work-over strong {
    color: var(--dv-warning);
}

.dv-work-item .table-wrapper {
    margin-top: var(--dv-space-2);
}

.dv-repair-photos {
    display: flex;
    flex-wrap: wrap;
    gap: var(--dv-space-3);
}

.dv-repair-photo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    width: 92px;
}

.dv-repair-thumb {
    padding: 0;
    border: 1px solid var(--dv-card-line);
    border-radius: 8px;
    background: var(--dv-surface);
    overflow: hidden;
    width: 92px;
    height: 70px;
    cursor: zoom-in;
}

.dv-repair-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.dv-repair-photo-type {
    font-size: 0.8em;
    color: var(--dv-text-muted);
}

.dv-repair-add-photos {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--dv-space-2);
}

.dv-repair-photo-large {
    max-width: 100%;
    max-height: 60vh;
    border-radius: 8px;
    border: 1px solid var(--dv-card-line);
}

.dv-repair-position {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--dv-space-2) var(--dv-space-3);
}

@media (max-width: 767.98px) {
    .dv-work-capture,
    .dv-repair-add-photos .btn,
    .dv-repair-position .btn {
        min-height: 38px;
    }

    .dv-work-capture {
        width: 100%;
    }
}

/* Snags 36 and 37. The daily report and capture windows are used on site on
   a phone or a tablet. Below desktop width every plant line is a full width
   row about 44 pixels tall with a bigger box, so a tap anywhere on the line
   ticks it, and every box is 16 pixels, so an iPad does not zoom in either. */
@media (max-width: 1199.98px) {
    .dv-capture-window .form-control,
    .dv-capture-window .form-select,
    .dv-capture-window textarea {
        font-size: 16px;
    }

    .dv-capture-window .dv-daily-plant .form-check {
        display: flex;
        align-items: center;
        gap: var(--dv-space-3);
        min-height: 44px;
        margin: 0;
        padding: 0 var(--dv-space-2);
        border-bottom: 1px solid var(--dv-line-soft);
        cursor: pointer;
    }

    .dv-capture-window .dv-daily-plant .form-check-input {
        float: none;
        width: 22px;
        height: 22px;
        margin: 0;
        flex: 0 0 22px;
    }

    .dv-capture-window .dv-daily-plant .form-check-label {
        flex: 1 1 auto;
        cursor: pointer;
    }
}

/* Task 5.6. A document that went with a request for inspection, one a line. */
.dv-inspection-doc {
    padding: 3px 0;
    border-bottom: 1px solid var(--dv-line-soft);
    overflow-wrap: anywhere;
}

/* Snag 41, Test Ninja's phone suggestion. On a phone each repair under an
   item on the Work Done tab is a card with Date and Quantity on its first
   line, Team, Status and Photos on the second, and Rework of under them when
   it has one, with closer lines, so it is about a third of the height. */
@media (max-width: 767.98px) {
    .table-wrapper .dv-repairs-table > tbody > tr {
        display: grid;
        grid-template-columns: 1.2fr 1fr 0.7fr;
        column-gap: var(--dv-space-3);
    }

    .dv-card .table-wrapper .table.dv-repairs-table > tbody > tr > td,
    .table-wrapper .table.dv-repairs-table > tbody > tr > td {
        width: auto;
        min-width: 0;
        padding: 2px 0;
    }

    .table-wrapper .dv-repairs-table > tbody > tr > td:nth-child(1) { grid-column: 1; grid-row: 1; }
    .table-wrapper .dv-repairs-table > tbody > tr > td:nth-child(2) { grid-column: 2 / span 2; grid-row: 1; }
    .table-wrapper .dv-repairs-table > tbody > tr > td:nth-child(3) { grid-column: 1; grid-row: 2; }
    .table-wrapper .dv-repairs-table > tbody > tr > td:nth-child(4) { grid-column: 2; grid-row: 2; }
    .table-wrapper .dv-repairs-table > tbody > tr > td:nth-child(5) { grid-column: 3; grid-row: 2; }
    .table-wrapper .dv-repairs-table > tbody > tr > td:nth-child(6) { grid-column: 1 / -1; grid-row: 3; }
}

/* Task 5.7. A repair's outcome in its window, with Start rework or Reworked
   beside it; and Record outcome inside an opened request, in its own box. */
.dv-repair-outcome {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--dv-space-2) var(--dv-space-3);
    padding: var(--dv-space-2) var(--dv-space-3);
    border: 1px solid var(--dv-card-line);
    border-radius: 8px;
    background: var(--dv-canvas);
}

.dv-outcome-form {
    padding: var(--dv-space-3);
    border: 1px solid var(--dv-card-line);
    border-radius: 8px;
}

/* Snag 46. A fixed or read only item in the repair window is text that wraps,
   the same size as the boxes around it below desktop width. */
.dv-repair-item-text { white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 1199.98px) {
    .dv-repair-item-text { font-size: 16px; }
}

/* ---------------------------------------------------------------------------
   Snag 51, Leon, 1 November 2026. On a phone a job card's tabs are one
   drop-down menu, showing the open tab, instead of a strip to scroll.
   Snag 52. On a phone the stage note above the tabs is one small line.
   --------------------------------------------------------------------------- */
.dv-tabs-menu {
    display: none;
}

@media (max-width: 767.98px) {
    .dv-tabs-menu {
        display: block;
        margin-bottom: var(--dv-space-3);
    }

    .dv-tabs-menu + .dv-tabs,
    .dv-compact .dv-tabs-menu + .dv-tabs {
        display: none;
    }

    .dv-tabs-menu-btn {
        display: flex;
        align-items: center;
        gap: 8px;
        width: 100%;
        min-height: 44px;
        padding: 8px 14px;
        border: 1px solid var(--dv-card-line);
        border-radius: 12px;
        background: #FFFFFF;
        color: var(--dv-navy);
        font-size: 16px;
        font-weight: 700;
        text-align: left;
        box-shadow: 0 1px 2px rgba(45, 42, 42, 0.04);
    }

    .dv-tabs-menu-btn::after {
        margin-left: auto;
    }

    .dv-tabs-menu-list {
        width: 100%;
        padding: 4px;
        border: 1px solid var(--dv-card-line);
        border-radius: 12px;
    }

    .dv-tabs-menu-list .dropdown-item {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        min-height: 44px;
        padding: 8px 12px;
        border-radius: 8px;
        font-size: 16px;
        color: var(--dv-navy);
    }

    .dv-tabs-menu-list .dropdown-item.active,
    .dv-tabs-menu-list .dropdown-item:active {
        background: var(--dv-blue);
        color: #FFFFFF;
    }

    .dv-carry-note.dv-reply-notice,
    .dv-compact .dv-carry-note.dv-reply-notice {
        padding: 6px 10px;
        margin-bottom: var(--dv-space-2);
        border-radius: 8px;
        font-size: 13px;
        line-height: 1.35;
    }

    .dv-reply-notice .dv-notice-tick {
        width: 14px;
        height: 14px;
    }
}

/* Task 6.3. Planning an item in its line: the days marked by the two clicks,
   and the Team and People boxes under the item's name, which stay in view
   while the days scroll. A phone gets 16 pixel boxes, one under the other. */
/* Snag 58. The marks win over the row's hover colour and the weekend and
   week shading: the theme blue at a light strength, with a firm blue edge
   top and bottom, and on the first and the last day. */
.dv-gantt tr[data-dv-prog-row] td.dv-gantt-mark.dv-gantt-mark:not(.dv-gantt-total):not(.dv-gantt-team):not(.dv-gantt-people),
.dv-gantt tr[data-dv-prog-row]:hover td.dv-gantt-mark.dv-gantt-mark:not(.dv-gantt-total):not(.dv-gantt-team):not(.dv-gantt-people) {
    background-color: color-mix(in srgb, var(--dv-blue) 35%, #FFFFFF);
    box-shadow: inset 0 2px 0 var(--dv-blue), inset 0 -2px 0 var(--dv-blue);
}

.dv-gantt tr[data-dv-prog-row] td.dv-gantt-mark.dv-gantt-mark.dv-gantt-mark-first:not(.dv-gantt-total):not(.dv-gantt-team):not(.dv-gantt-people) {
    box-shadow: inset 0 2px 0 var(--dv-blue), inset 0 -2px 0 var(--dv-blue), inset 3px 0 0 var(--dv-blue);
}

.dv-gantt tr[data-dv-prog-row] td.dv-gantt-mark.dv-gantt-mark.dv-gantt-mark-last:not(.dv-gantt-total):not(.dv-gantt-team):not(.dv-gantt-people) {
    box-shadow: inset 0 2px 0 var(--dv-blue), inset 0 -2px 0 var(--dv-blue), inset -3px 0 0 var(--dv-blue);
}

.dv-gantt tr[data-dv-prog-row] td.dv-gantt-mark.dv-gantt-mark.dv-gantt-mark-first.dv-gantt-mark-last:not(.dv-gantt-total):not(.dv-gantt-team):not(.dv-gantt-people) {
    box-shadow: inset 0 2px 0 var(--dv-blue), inset 0 -2px 0 var(--dv-blue), inset 3px 0 0 var(--dv-blue), inset -3px 0 0 var(--dv-blue);
}

.dv-gantt-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    cursor: default;
}

.dv-gantt-inline .form-select {
    flex: 1 1 130px;
    min-width: 0;
    max-width: 180px;
}

.dv-gantt-inline .form-control {
    flex: 0 0 72px;
    width: 72px;
}

.dv-gantt-inline-note {
    flex: 1 1 100%;
    font-size: 0.72rem;
    color: var(--dv-text-muted);
}

.dv-gantt-inline-note:empty {
    display: none;
}

@media (max-width: 767.98px) {
    .dv-gantt-inline .form-select,
    .dv-gantt-inline .form-control {
        flex: 1 1 100%;
        max-width: none;
        width: 100%;
        min-height: 38px;
        font-size: 16px;
    }
}

/* Snag 57, Test Ninja's phone suggestion. A one column table (a project's
   Roads) stays plain rows on a phone: one box, a line between rows, each row
   a full width tap of 44 pixels, and no heading over each name. */
@media (max-width: 767.98px) {
    .table-wrapper.dv-rows-plain {
        background: var(--dv-surface);
        border: 1px solid var(--dv-card-line);
        border-radius: var(--dv-radius);
        overflow: hidden;
    }

    .table-wrapper.dv-rows-plain tr {
        display: flex;
        align-items: center;
        min-height: 44px;
        margin: 0;
        padding: 0 var(--dv-space-3);
        border-radius: 0;
        box-shadow: none;
        border-bottom: 1px solid var(--dv-line-soft);
    }

    .table-wrapper.dv-rows-plain tr:last-child {
        border-bottom: 0;
    }

    .table-wrapper.dv-rows-plain td[data-label]::before {
        display: none;
    }
}

/* Task 6.4. A revised item keeps its original days on its line: a thin,
   faded bar in the team's colour across the top of each original day, over
   the normal bar of the revised days. */
.dv-gantt td[data-day] {
    position: relative;
}

.dv-gantt-base {
    position: absolute;
    left: 0;
    right: 0;
    top: 1px;
    height: 5px;
    opacity: 0.4;
    pointer-events: none;
}

.dv-gantt-base.dv-gantt-base-first {
    left: 2px;
    border-top-left-radius: 3px;
    border-bottom-left-radius: 3px;
}

.dv-gantt-base.dv-gantt-base-last {
    right: 2px;
    border-top-right-radius: 3px;
    border-bottom-right-radius: 3px;
}

/* Task 6.4. On a phone each programme change is a short card, as Rules
   learned asks: Date and By side by side, the Item on its own line, From and
   To side by side, then the Reason. */
@media (max-width: 767.98px) {
    .table-wrapper .dv-prog-changes > tbody > tr {
        display: grid;
        grid-template-columns: 1fr 1fr;
        column-gap: var(--dv-space-3);
    }

    .dv-card .table-wrapper .table.dv-prog-changes > tbody > tr > td,
    .table-wrapper .table.dv-prog-changes > tbody > tr > td {
        width: auto;
        min-width: 0;
        padding: 2px 0;
    }

    .table-wrapper .dv-prog-changes > tbody > tr > td:nth-child(1) { order: 1; }
    .table-wrapper .dv-prog-changes > tbody > tr > td:nth-child(6) { order: 2; }
    .table-wrapper .dv-prog-changes > tbody > tr > td:nth-child(2) { order: 3; grid-column: 1 / -1; }
    .table-wrapper .dv-prog-changes > tbody > tr > td:nth-child(3) { order: 4; }
    .table-wrapper .dv-prog-changes > tbody > tr > td:nth-child(4) { order: 5; }
    .table-wrapper .dv-prog-changes > tbody > tr > td:nth-child(5) { order: 6; grid-column: 1 / -1; }
}

/* Task 6.6. The Cost column after Team, the Plant row under Labour, and the
   line under the chart: Loses in red, Makes in green. Shown only to a
   Contractor Administrator and a Manager. */
.dv-gantt .dv-gantt-cost {
    min-width: 78px;
    padding: 0 8px;
    text-align: right;
    white-space: nowrap;
    font-weight: 600;
    color: #111827;
    background: #FFFFFF;
}

.dv-gantt tfoot .dv-gantt-plant td {
    border-top: 1px solid var(--dv-line-soft);
}

/* Snag 61. A day's plant cost is small to fit its narrow cell; the Plant
   total in the Cost column matches the Labour total above it. */
.dv-gantt tfoot .dv-gantt-plant td:not(.dv-gantt-cost):not(.dv-gantt-lab) {
    font-size: 0.66rem;
}

.dv-gantt tfoot td.dv-gantt-cost {
    font-weight: 700;
}

.dv-prog-money {
    font-size: 0.86rem;
}

.dv-money-loses {
    color: var(--dv-danger);
}

.dv-money-makes {
    color: var(--dv-green-deep);
}

/* Task 6.8. The daily report's attendance register: each person's name with
   Present on the left and Hours on the right, the general workers with their
   number and hours each, stand-ins by name, and the total line. On a phone
   every box is 16 pixels and at least 38 pixels high, so the phone does not
   zoom and a thumb can hit it. */
.dv-attendance-line {
    display: flex;
    align-items: center;
    gap: var(--dv-space-2);
    padding: 4px 0;
    border-bottom: 1px solid var(--dv-line-soft);
}

.dv-attendance-name {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
}

.dv-attendance .dv-attendance-hours {
    flex: 0 0 88px;
    width: 88px;
}

.dv-attendance .dv-attendance-count {
    flex: 0 0 72px;
    width: 72px;
}

.dv-attendance .dv-attendance-standin {
    flex: 1 1 auto;
    min-width: 0;
}

.dv-attendance .dv-attendance-hours[readonly] {
    background: var(--dv-line-soft);
}

.dv-attendance-total {
    font-weight: 700;
}

.dv-old-labour {
    padding-left: 1.1rem;
    font-size: 0.86rem;
}

@media (max-width: 767.98px) {
    .dv-attendance .form-control,
    .dv-attendance .btn {
        min-height: 38px;
        font-size: 16px;
    }

    .dv-attendance .form-check-input {
        width: 1.3rem;
        height: 1.3rem;
    }
}

/* Snag 60, Test Ninja's phone suggestion. A revised item's original dates sit
   in its small line on a desktop and a tablet, and on a line of their own on a
   phone, where the small line is cut short. */
.dv-gantt-original-line {
    display: none;
}

@media (max-width: 767.98px) {
    .dv-gantt-original-inline {
        display: none;
    }

    .dv-gantt-meta.dv-gantt-original-line {
        display: block;
        white-space: normal;
        overflow: visible;
    }
}

/* Task 6.9. Planned against worked: worked hours above the plan in the
   theme's warning colour, and the total line in bold. On a phone each row is
   a short card: Date and Team side by side, then the figures two to a line. */
.dv-over-plan,
.table-wrapper .table td.dv-over-plan,
.table-wrapper .table > tbody > tr > td.dv-over-plan {
    color: var(--dv-warning);
    font-weight: 700;
}

.dv-rollup-table tfoot td {
    font-weight: 700;
    border-top: 2px solid var(--dv-card-line);
}

@media (max-width: 767.98px) {
    .table-wrapper .dv-rollup-table > tbody > tr,
    .table-wrapper .dv-rollup-table > tfoot > tr {
        display: grid;
        grid-template-columns: 1fr 1fr;
        column-gap: var(--dv-space-3);
    }

    .table-wrapper .table.dv-rollup-table > tbody > tr > td,
    .table-wrapper .table.dv-rollup-table > tfoot > tr > td {
        width: auto;
        min-width: 0;
        padding: 2px 0;
        text-align: left;
    }

    .table-wrapper .dv-rollup-table > tfoot > tr > td:first-child {
        grid-column: 1 / -1;
    }
}

/* Task 6.7. The Work Plan tab's Today card: each team with its colour, its
   items for today and those behind, and the "3 days behind" badge in amber,
   on Today and on the items below. */
.dv-today-team {
    padding: var(--dv-space-2) 0;
    border-top: 1px solid var(--dv-line-soft);
}

.dv-today-team:first-of-type {
    border-top: 0;
}

.dv-today-team-name {
    margin-bottom: 4px;
}

.dv-today-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--dv-space-2) var(--dv-space-3);
    padding: 4px 0 4px var(--dv-space-3);
}

.dv-today-item-name {
    flex: 1 1 16rem;
    min-width: 0;
}

.dv-badge.dv-behind {
    background: #FEF3E2;
    color: #9A5B06;
    border: 1px solid var(--dv-warning);
}

@media (max-width: 767.98px) {
    .dv-today-item {
        padding-left: 0;
    }

    .dv-today-item .dv-link-button {
        min-height: 38px;
    }
}

.dv-today-capture {
    color: var(--dv-blue);
    font-weight: 600;
}


/* Snag 64. A heading line over the attendance: Present over the ticks and
   Hours over the hours boxes, then Number and Hours each over the two general
   worker boxes. The headings line up with the boxes under them. */
.dv-attendance-head {
    display: flex;
    align-items: flex-end;
    gap: var(--dv-space-2);
    padding: 2px 0;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--dv-text-muted);
    border-bottom: 1px solid var(--dv-line-soft);
}

.dv-attendance-head .dv-attendance-head-hours {
    flex: 0 0 88px;
    width: 88px;
}

.dv-attendance-head .dv-attendance-head-count {
    flex: 0 0 72px;
    width: 72px;
}

/* Snag 65, as Snag 36 for the plant lines. Below desktop width each person is
   a full width line about 44 pixels tall with a 22 pixel tick, and a tap
   anywhere on the name side of the line ticks or clears Present. */
@media (max-width: 1199.98px) {
    .dv-attendance .dv-attendance-line[data-dv-person] {
        min-height: 44px;
        padding: 0;
    }

    .dv-attendance .dv-attendance-line[data-dv-person] .dv-attendance-name {
        display: flex;
        align-items: center;
        gap: var(--dv-space-3);
        align-self: stretch;
        min-height: 44px;
        padding: 0 var(--dv-space-2) 0 0;
        cursor: pointer;
    }

    .dv-attendance .dv-attendance-line[data-dv-person] .form-check-input {
        float: none;
        width: 22px;
        height: 22px;
        margin: 0;
        flex: 0 0 22px;
    }

    .dv-attendance .dv-attendance-line[data-dv-person] .form-check-label {
        flex: 1 1 auto;
        cursor: pointer;
    }
}

/* Snag 66. On a phone each daily report is a short card, as Rules learned
   asks: Date and Team on the first line, Weather, People and Hours on the
   next, Work done on its own line, then Signed and Captured by. */
@media (max-width: 767.98px) {
    .table-wrapper .dv-daily-table > tbody > tr {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        column-gap: var(--dv-space-3);
    }

    .dv-card .table-wrapper .table.dv-daily-table > tbody > tr > td,
    .table-wrapper .table.dv-daily-table > tbody > tr > td {
        width: auto;
        min-width: 0;
        padding: 2px 0;
        text-align: left;
    }

    .table-wrapper .dv-daily-table > tbody > tr > td:nth-child(1) { grid-column: 1; }
    .table-wrapper .dv-daily-table > tbody > tr > td:nth-child(2) { grid-column: 2 / -1; }
    .table-wrapper .dv-daily-table > tbody > tr > td:nth-child(6) { grid-column: 1 / -1; }
    .table-wrapper .dv-daily-table > tbody > tr > td:nth-child(8) { grid-column: span 2; }
}

/* Snag 67, Test Ninja's phone suggestion. On a phone each line in Today ends
   with a full width Capture work button under its figures, always in the
   same place, like the Capture buttons on the items below. */
@media (max-width: 767.98px) {
    .dv-today-item .dv-work-figures {
        flex: 1 1 100%;
    }

    .dv-today-item .dv-link-button.dv-today-capture {
        display: block;
        flex: 1 1 100%;
        width: 100%;
        min-height: 44px;
        padding: 6px 12px;
        text-align: center;
        background: var(--dv-surface);
        border: 1px solid var(--dv-line);
        border-radius: 6px;
    }
}

/* Leon, 6 November 2026. Done in Today goes to the item's records in the list
   below, and the item it goes to is marked. */
.dv-done-link {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.dv-done-link:hover {
    color: var(--dv-blue);
}

.dv-work-item:target {
    background: #EEF5FF;
    scroll-margin-top: 76px;
}

/* On a phone, the last line of a captured record says who and when. */
@media (max-width: 767.98px) {
    .table-wrapper .dv-repairs-table > tbody > tr > td:nth-child(7) { grid-column: 1; grid-row: 4; }
    .table-wrapper .dv-repairs-table > tbody > tr > td:nth-child(8) { grid-column: 2 / span 2; grid-row: 4; }
}

/* Snag 78. Radio buttons in a horizontal form sit on their label's line. */
.dv-radio-col {
    padding-top: calc(0.375rem + 6px);
}

/* Snag 81. The Team filter on the Work Plan is wide enough for All teams and its arrow. */
#dvWorkTeam {
    min-width: 9rem;
}

/* Snag 83. On a phone a request for inspection is a short card: its number,
   when it was sent and its repairs on one line, then who it went to and who
   sent it, then the outcome. */
@media (max-width: 767.98px) {
    .table-wrapper .dv-insp-table > tbody > tr {
        display: grid;
        grid-template-columns: auto 1fr auto;
        column-gap: var(--dv-space-3);
    }

    .dv-card .table-wrapper .table.dv-insp-table > tbody > tr > td,
    .table-wrapper .table.dv-insp-table > tbody > tr > td {
        width: auto;
        min-width: 0;
        padding: 2px 0;
        text-align: left;
    }

    .table-wrapper .dv-insp-table > tbody > tr > td:nth-child(1) { grid-column: 1; grid-row: 1; }
    .table-wrapper .dv-insp-table > tbody > tr > td:nth-child(2) { grid-column: 2; grid-row: 1; }
    .table-wrapper .dv-insp-table > tbody > tr > td:nth-child(5) { grid-column: 3; grid-row: 1; }
    .table-wrapper .dv-insp-table > tbody > tr > td:nth-child(3) { grid-column: 1 / span 2; grid-row: 2; }
    .table-wrapper .dv-insp-table > tbody > tr > td:nth-child(4) { grid-column: 3; grid-row: 2; }
    .table-wrapper .dv-insp-table > tbody > tr > td:nth-child(6) { grid-column: 1 / -1; grid-row: 3; }

    /* The number's button keeps its 40 pixel tap area, with the number at its left edge, under its heading. */
    .table-wrapper .dv-insp-table > tbody > tr > td:nth-child(1) .dv-link-button {
        justify-content: flex-start;
    }
}

/* Task 7.3. On a phone each row of the Materials table is a short card, as
   Keep in Mind's rule of 31 October 2026 asks: the Material on its own line,
   Category and Use side by side, Unit and Active side by side, then Edit. */
@media (max-width: 767.98px) {
    .table-wrapper .dv-materials-table > tbody > tr {
        display: grid;
        grid-template-columns: 1fr 1fr;
        column-gap: var(--dv-space-3);
    }

    .dv-card .table-wrapper .table.dv-materials-table > tbody > tr > td,
    .table-wrapper .table.dv-materials-table > tbody > tr > td {
        width: auto;
        min-width: 0;
        padding: 2px 0;
    }

    .table-wrapper .dv-materials-table > tbody > tr > td:nth-child(2) {
        grid-column: 1 / -1;
        order: -1;
    }

    .table-wrapper .dv-materials-table > tbody > tr > td:nth-child(6) {
        grid-column: 1 / -1;
    }
}

/* Task 7.5. On a phone each row of the Stock tables is a short card. On hand:
   the Material on its own line, Category and Unit, Received and Issued, then
   On hand. Movements: the Material on its own line, Date and Type, Quantity
   and Team, Job instruction and Recorded by, then Notes and Edit. */
@media (max-width: 767.98px) {
    .table-wrapper .dv-onhand-table > tbody > tr,
    .table-wrapper .dv-movements-table > tbody > tr {
        display: grid;
        grid-template-columns: 1fr 1fr;
        column-gap: var(--dv-space-3);
    }

    .dv-card .table-wrapper .table.dv-onhand-table > tbody > tr > td,
    .table-wrapper .table.dv-onhand-table > tbody > tr > td,
    .dv-card .table-wrapper .table.dv-movements-table > tbody > tr > td,
    .table-wrapper .table.dv-movements-table > tbody > tr > td {
        width: auto;
        min-width: 0;
        padding: 2px 0;
        text-align: left;
    }

    .table-wrapper .dv-onhand-table > tbody > tr > td:nth-child(2),
    .table-wrapper .dv-movements-table > tbody > tr > td:nth-child(3) {
        grid-column: 1 / -1;
        order: -1;
    }

    /* Snag 91. Six narrow columns, so three short values can share a line:
       On hand reads Category and Unit, then Received, Issued and On hand;
       Movements reads Date and Type, then Quantity, Team and Job instruction,
       then Notes and Recorded by. Figures sit on the left, under their heading. */
    .table-wrapper .dv-onhand-table > tbody > tr,
    .table-wrapper .dv-movements-table > tbody > tr {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .table-wrapper .dv-onhand-table > tbody > tr > td.text-end,
    .table-wrapper .dv-movements-table > tbody > tr > td.text-end {
        text-align: left !important;
    }

    .table-wrapper .dv-onhand-table > tbody > tr > td:nth-child(1),
    .table-wrapper .dv-movements-table > tbody > tr > td:nth-child(1),
    .table-wrapper .dv-movements-table > tbody > tr > td:nth-child(2),
    .table-wrapper .dv-movements-table > tbody > tr > td:nth-child(7),
    .table-wrapper .dv-movements-table > tbody > tr > td:nth-child(8) {
        grid-column: span 3;
    }

    .table-wrapper .dv-onhand-table > tbody > tr > td:nth-child(3),
    .table-wrapper .dv-onhand-table > tbody > tr > td:nth-child(4),
    .table-wrapper .dv-onhand-table > tbody > tr > td:nth-child(5),
    .table-wrapper .dv-onhand-table > tbody > tr > td:nth-child(6),
    .table-wrapper .dv-movements-table > tbody > tr > td:nth-child(4),
    .table-wrapper .dv-movements-table > tbody > tr > td:nth-child(5),
    .table-wrapper .dv-movements-table > tbody > tr > td:nth-child(6) {
        grid-column: span 2;
    }

    .table-wrapper .dv-onhand-table > tbody > tr > td:nth-child(3) {
        grid-column: span 3;
    }

    .table-wrapper .dv-movements-table > tbody > tr > td:nth-child(9) {
        grid-column: 1 / -1;
    }
}

/* Snag 90. Stock's Project line, above the toolbar at every width. */
.dv-stock-project {
    display: flex;
    align-items: center;
    gap: var(--dv-space-2);
    margin-bottom: var(--dv-space-2);
}

.dv-stock-project .form-select {
    width: auto;
    max-width: 100%;
    min-width: 0;
}

@media (max-width: 767.98px) {
    .dv-stock-project .form-select {
        flex: 1 1 auto;
        width: 100%;
    }
}

/* Task 7.6. What an import did, in the Import window: the rows added and
   updated, and any skipped rows with why. A refused file keeps the red of
   .dv-import-errors. */
.dv-import-result {
    background: var(--dv-tint-green);
    border-radius: var(--dv-radius-sm);
    padding: var(--dv-space-2) var(--dv-space-3);
    color: var(--dv-text);
}

.dv-import-result ul {
    padding-left: 1.1rem;
}

/* Task 7.8. Add several: a grid of rows in a wide window. Every column fits
   the window from 1024 pixels up; below that each row is a short card. */
#dvAddItems .modal-dialog {
    max-width: min(1400px, calc(100vw - 24px));
}

.dv-items-grid {
    table-layout: fixed;
    width: 100%;
    margin-bottom: 0;
    border-collapse: collapse;
}

.dv-items-grid th {
    font-size: 0.72rem;
    white-space: normal;
}

.dv-items-grid td {
    padding: 2px;
    vertical-align: top;
}

/* Snag 94. Side is wide enough for "Not given", "LHS and RHS" and
   "Centre line" at 1024 pixels, Lanes for "FL, CL, SL", and the boxes' arrows take less room. */
.dv-items-grid th:nth-child(1) { width: 10%; }
.dv-items-grid th:nth-child(2),
.dv-items-grid th:nth-child(3) { width: 7%; }
.dv-items-grid th:nth-child(4) { width: 13%; }
.dv-items-grid th:nth-child(5) { width: 11%; }
.dv-items-grid th:nth-child(6) { width: 10%; }
.dv-items-grid th:nth-child(7) { width: 7%; }
.dv-items-grid th:nth-child(8) { width: 17%; }
.dv-items-grid th:nth-child(9) { width: 6%; }
.dv-items-grid th:nth-child(10) { width: 8%; }
.dv-items-grid .dv-grid-remove-col { width: 4%; text-align: center; }

.dv-items-grid .form-select-sm {
    padding-left: 0.4rem;
    padding-right: 1.5rem;
    background-position: right 0.35rem center;
}

/* Snag 93. The row stepper shows below 1024 pixels only. */
.dv-grid-stepper {
    display: none;
}

.dv-items-grid input[readonly] {
    background: var(--dv-tint-navy);
}

.dv-grid-remove {
    font-size: 1.2rem;
    line-height: 1;
    padding: 4px 6px;
}

.dv-items-grid tr.dv-grid-refused input,
.dv-items-grid tr.dv-grid-refused select {
    border-color: var(--dv-danger, #C0392B);
}

.dv-items-grid tr.dv-grid-error td {
    color: var(--dv-danger, #C0392B);
    font-size: 0.8rem;
    padding: 0 4px 6px;
}

@media (max-width: 1023.98px) {
    .dv-items-grid,
    .dv-items-grid tbody {
        display: block;
    }

    .dv-items-grid thead {
        display: none;
    }

    /* Snag 93. One row at a time: the row being filled, with the stepper
       and Add row right under it. */
    .dv-items-grid tr[data-dv-grid-row]:not(.dv-grid-current),
    .dv-items-grid tr[data-dv-grid-row]:not(.dv-grid-current) + tr.dv-grid-error {
        display: none !important;
    }

    .dv-grid-stepper {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: var(--dv-space-2);
        margin-bottom: var(--dv-space-2);
    }

    .dv-grid-stepper.dv-grid-stepper-one {
        display: none;
    }

    .dv-grid-stepper-text {
        font-weight: 600;
        color: var(--dv-navy, #2D2A2A);
    }

    .dv-items-grid tr[data-dv-grid-row] {
        display: grid;
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 4px var(--dv-space-2);
        padding: var(--dv-space-2);
        margin-bottom: var(--dv-space-2);
        border: 1px solid var(--dv-card-line);
        border-radius: var(--dv-radius);
        background: var(--dv-surface);
    }

    .dv-items-grid tr[data-dv-grid-row] > td {
        display: block;
        padding: 0;
        border: 0;
        grid-column: span 3;
    }

    .dv-items-grid tr[data-dv-grid-row] > td[data-label]::before {
        content: attr(data-label);
        display: block;
        font-size: 0.66rem;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        color: var(--dv-text-muted);
    }

    /* Road with the remove cross beside it; Start and End; Side and Lanes;
       Item; Quantity, Unit and Rate; then Description. */
    .dv-items-grid tr[data-dv-grid-row] > td:nth-child(1) {
        grid-row: 1;
        grid-column: 1 / 6;
    }

    .dv-items-grid tr[data-dv-grid-row] > td:nth-child(6),
    .dv-items-grid tr[data-dv-grid-row] > td:nth-child(8) {
        grid-column: 1 / -1;
    }

    .dv-items-grid tr[data-dv-grid-row] > td:nth-child(7),
    .dv-items-grid tr[data-dv-grid-row] > td:nth-child(9),
    .dv-items-grid tr[data-dv-grid-row] > td:nth-child(10) {
        grid-column: span 2;
    }

    .dv-items-grid tr[data-dv-grid-row] > td:nth-child(8) {
        order: 1;
    }

    .dv-items-grid tr[data-dv-grid-row] > td.dv-grid-remove-col {
        grid-row: 1;
        grid-column: 6;
        display: flex;
        justify-content: flex-end;
        align-items: flex-end;
        width: auto;
    }

    .dv-items-grid .dv-grid-remove {
        min-width: 38px;
        min-height: 38px;
    }

    .dv-items-grid tr.dv-grid-error {
        display: block;
        margin: -6px 0 var(--dv-space-2);
    }

}

@media (max-width: 767.98px) {
    .dv-items-grid input,
    .dv-items-grid select {
        font-size: 16px;
        min-height: 38px;
    }
}

/* Task 7.9. Original and revised dates made clear. The original days of a
   revised item are an outline in the team's colour with no fill, along the
   top of the line; the revised bar keeps the team's colour with an orange
   edge (the theme's warning colour). A key shows both when an item was
   revised. Items that never changed look as before. */
.dv-gantt-base {
    top: 0;
    height: 9px;
    opacity: 1;
}

.dv-gantt-base::after {
    content: "";
    position: absolute;
    top: 2px;
    bottom: 2px;
    left: 0;
    right: 0;
    background: var(--dv-surface);
}

/* The outline closes only at the first and last original day, so the days join into one box. */
.dv-gantt-base.dv-gantt-base-first::after {
    left: 2px;
    border-top-left-radius: 2px;
    border-bottom-left-radius: 2px;
}

.dv-gantt-base.dv-gantt-base-last::after {
    right: 2px;
    border-top-right-radius: 2px;
    border-bottom-right-radius: 2px;
}

.dv-gantt-bar.dv-gantt-revised {
    box-shadow: inset 0 2px 0 var(--dv-warning), inset 0 -2px 0 var(--dv-warning);
}

.dv-gantt-first .dv-gantt-bar.dv-gantt-revised {
    box-shadow: inset 2px 0 0 var(--dv-warning), inset 0 2px 0 var(--dv-warning), inset 0 -2px 0 var(--dv-warning);
}

.dv-gantt-last .dv-gantt-bar.dv-gantt-revised {
    box-shadow: inset -2px 0 0 var(--dv-warning), inset 0 2px 0 var(--dv-warning), inset 0 -2px 0 var(--dv-warning);
}

.dv-gantt-first.dv-gantt-last .dv-gantt-bar.dv-gantt-revised {
    box-shadow: inset 0 0 0 2px var(--dv-warning);
}

.dv-gantt-key-original {
    background: transparent;
    border: 2px solid var(--dv-navy-soft, #4A4545);
}

.dv-gantt-key-revised {
    background: var(--dv-blue-bright, #0B9D80);
    box-shadow: inset 0 0 0 2px var(--dv-warning);
}

/* Snag 95. The original and revised dates wrap, so both dates and the
   Revised badge show whole in a narrow item column, as on a phone. */
.dv-gantt-dates-line {
    display: block;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
}

.dv-badge-revised {
    display: inline-block;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--dv-tint-amber);
    color: #9A5B00;
    font-size: 0.66rem;
    font-weight: 700;
    line-height: 1.5;
}

/* Task 7.12. Under a captured quantity, the measurements it was worked out
   from ("2 x 3 x 0.5 m") or Typed, small and muted. A supporting document of
   a capture, one a line: its name, its size and Remove. */
.dv-measure-text {
    font-size: 0.78rem;
    white-space: normal;
}

.dv-repair-doc {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px var(--dv-space-3);
    padding: 4px 0;
    border-bottom: 1px solid var(--dv-line-soft);
    overflow-wrap: anywhere;
}

.dv-repair-doc a {
    min-width: 0;
}

/* Task 7.11. The Work Plan's This week card, in place of Today: the heading
   with the percentage complete and the week arrows; each team with its
   colour, its Outstanding lines, then a small calendar of the nine days
   (this Monday to next Tuesday), the same look as the programme: weekends
   shaded, today in orange. A planned day is filled in the team's colour and
   carries the quantity captured that day in a white pill. On a phone the
   item's words sit over its nine days. */
.dv-week-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--dv-space-2) var(--dv-space-3);
}

.dv-week-title {
    flex: 1 1 auto;
}

.dv-week-nav {
    display: flex;
    flex-wrap: wrap;
    gap: var(--dv-space-2);
}

.dv-week-team {
    padding: var(--dv-space-2) 0;
    border-top: 1px solid var(--dv-line-soft);
}

.dv-week-team:first-of-type {
    border-top: 0;
}

.dv-week-sub {
    margin: 4px 0 2px var(--dv-space-3);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--dv-text-muted);
}

.dv-week-pct {
    font-weight: 700;
}

.dv-week-grid {
    margin-top: var(--dv-space-2);
    border: 1px solid var(--dv-card-line);
    border-radius: var(--dv-radius);
    overflow: hidden;
}

.dv-week-row {
    display: grid;
    grid-template-columns: minmax(15rem, 4fr) repeat(9, minmax(0, 1fr));
    border-top: 1px solid var(--dv-line-soft);
}

.dv-week-row:first-child {
    border-top: 0;
}

.dv-week-head {
    background: #F6F6F6;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--dv-text-muted);
    text-align: center;
}

.dv-week-head .dv-week-lab {
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    align-self: end;
}

.dv-week-lab {
    min-width: 0;
    padding: 6px var(--dv-space-2);
}

.dv-week-item {
    overflow-wrap: anywhere;
}

.dv-week-figures {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px var(--dv-space-3);
    margin-top: 2px;
    font-size: 0.85rem;
}

.dv-week-day {
    padding: 4px 0;
    border-left: 1px solid var(--dv-line-soft);
}

.dv-week-day.dv-week-we,
.dv-week-day.dv-week-hol {
    background: #E7E7E8;
}

.dv-week-day.dv-week-today {
    background: #F97316;
    color: #FFFFFF;
}

.dv-week-cell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border-left: 1px solid var(--dv-line-soft);
}

.dv-week-cell.dv-week-we,
.dv-week-cell.dv-week-hol {
    background: #E7E7E8;
}

.dv-week-cell.dv-week-today {
    box-shadow: inset 2px 0 0 #F97316, inset -2px 0 0 #F97316;
}

.dv-week-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.dv-week-btn:hover,
.dv-week-btn:focus-visible {
    box-shadow: inset 0 0 0 2px var(--dv-navy, #2D2A2A);
    outline: none;
}

.dv-week-qty {
    display: inline-block;
    padding: 1px 4px;
    border-radius: 999px;
    background: #FFFFFF;
    color: var(--dv-navy, #2D2A2A);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.3;
    max-width: 100%;
    overflow: hidden;
    text-overflow: clip;
    white-space: nowrap;
}

.dv-week-cell:not(.dv-week-planned) .dv-week-qty {
    background: #F1F1F1;
}

@media (max-width: 767.98px) {
    .dv-week-row {
        grid-template-columns: repeat(9, minmax(0, 1fr));
    }

    .dv-week-row > .dv-week-lab {
        grid-column: 1 / -1;
    }

    .dv-week-head > .dv-week-lab {
        display: none;
    }

    .dv-week-row:not(.dv-week-head) > .dv-week-lab {
        border-bottom: 1px solid var(--dv-line-soft);
    }

    .dv-week-row > .dv-week-day:nth-child(2),
    .dv-week-row > .dv-week-cell:nth-child(2) {
        border-left: 0;
    }

    .dv-week-nav .btn {
        min-height: 38px;
    }
}

/* Task 7.11. The week's buttons and percentage keep their own words, not the
   heading's capitals, with a space after the arrow. */
.dv-week-heading .dv-week-nav .btn,
.dv-week-heading .dv-week-percent {
    text-transform: none;
    letter-spacing: normal;
}

.dv-week-nav .btn {
    gap: 4px;
}

/* Task 7.13. The capture window's two tabs, Work and Daily report, in a strip
   under its heading; and the line beside Save that says why it waits. */
.dv-tabs.dv-window-tabs {
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    border-bottom: 1px solid var(--dv-card-line);
    flex: 0 0 auto;
}

.dv-window-tabs .dv-tab {
    border: 0;
    background: transparent;
}

.dv-window-tabs .dv-tab.active {
    background: linear-gradient(135deg, var(--dv-blue-bright), var(--dv-blue));
}

.dv-cap-needed {
    flex: 1 1 100%;
    color: #9A5B06;
    font-size: 0.85rem;
    font-weight: 600;
}

.dv-daily-for {
    padding: var(--dv-space-2) var(--dv-space-3);
    border: 1px solid var(--dv-card-line);
    border-radius: 8px;
    background: var(--dv-canvas);
}

/* Task 7.14. A Team Leader's shortcuts: the Job instruction choice is wide
   enough for a number and a title, and on a phone takes the line. */
.dv-shortcut-card {
    min-width: 16rem;
    max-width: 28rem;
}

.dv-workplan-switch {
    margin-bottom: var(--dv-space-2);
}

@media (max-width: 767.98px) {
    .dv-shortcut-card {
        min-width: 0;
        max-width: none;
        flex: 1 1 auto;
        font-size: 16px;
    }

    .dv-workplan-switch .dv-toolbar-group,
    .dv-toolbar .dv-toolbar-group:has(.dv-shortcut-card) {
        flex: 1 1 100%;
    }
}

/* Snag 97. On a phone held either way, the capture and daily report windows
   fill the screen, as Bootstrap's full screen rule does only below 576
   pixels wide, so a phone held sideways keeps its height for the fields. */
@media (max-width: 767.98px), (max-height: 500px) and (max-width: 1023.98px) {
    #dvRepair .modal-dialog,
    #dvDailyReport .modal-dialog {
        width: 100vw;
        max-width: none;
        height: 100%;
        margin: 0;
    }

    #dvRepair .modal-content,
    #dvDailyReport .modal-content {
        height: 100%;
        border: 0;
        border-radius: 0;
    }

    #dvRepair .modal-header,
    #dvDailyReport .modal-header {
        border-radius: 0;
    }
}

@media (max-height: 500px) {
    #dvRepair .modal-header,
    #dvDailyReport .modal-header {
        padding-top: 6px;
        padding-bottom: 6px;
    }

    .dv-tabs.dv-window-tabs {
        padding: 3px 5px;
    }

    .dv-window-tabs .dv-tab {
        padding: 6px 14px;
    }

    #dvRepair .modal-footer,
    #dvDailyReport .modal-footer {
        padding-top: 4px;
        padding-bottom: 4px;
    }

    .dv-daily-for {
        padding: 4px var(--dv-space-2);
        margin-bottom: var(--dv-space-2) !important;
    }
}

/* Snag 98. A Team Leader's Daily Reports list has the Job instruction first,
   so on a phone its card reads Job instruction, Date and Team on the first
   line, Weather, People and Hours on the next, then Work done across the
   whole card, then Signed. */
@media (max-width: 767.98px) {
    .table-wrapper .dv-daily-table.dv-shortcut-daily > tbody > tr > td:nth-child(n) { grid-column: auto; }
    .table-wrapper .dv-daily-table.dv-shortcut-daily > tbody > tr > td:nth-child(7) { grid-column: 1 / -1; }
    .table-wrapper .dv-daily-table.dv-shortcut-daily > tbody > tr > td:nth-child(8) { grid-column: 1 / -1; }
}

/* Snag 105. Orange means Revised only. Today is marked in the theme's navy:
   the Programme's day heading and its line down the chart, and the Work
   Plan week's day heading and its column. */
.dv-gantt-days th.dv-gantt-today {
    background: var(--dv-navy);
    color: #FFFFFF;
}

.dv-gantt tbody td.dv-gantt-today,
.dv-gantt tfoot td.dv-gantt-today {
    background-image: linear-gradient(var(--dv-navy), var(--dv-navy));
}

.dv-week-day.dv-week-today {
    background: var(--dv-navy);
    color: #FFFFFF;
}

.dv-week-cell.dv-week-today {
    box-shadow: inset 2px 0 0 var(--dv-navy), inset -2px 0 0 var(--dv-navy);
}

/* Snag 110, retest. Work that can no longer change still says how its
   quantity came about ("Typed." or "Worked out from ..."), though its other
   help lines are hidden. */
fieldset.dv-read-only .form-text[data-dv-measure-note] {
    display: block;
}

/* Snag 106. Keep in Mind's rule of 31 October 2026 for the older lists in
   Table view: on a phone each row is a short card, with the name or number
   across the card, short values three to a line, then the long values
   (a description, an employer, an email) and Actions across the card.
   Personnel, Plant, Job Instructions, Projects, Teams, Companies, Vehicles
   and Users. */
@media (max-width: 767.98px) {
    .table-wrapper .dv-phone-grid > tbody > tr {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        column-gap: var(--dv-space-3);
    }

    .dv-card .table-wrapper .table.dv-phone-grid > tbody > tr > td,
    .table-wrapper .table.dv-phone-grid > tbody > tr > td {
        width: auto;
        min-width: 0;
        padding: 2px 0;
        overflow-wrap: anywhere;
    }

    .table-wrapper .dv-phone-grid > tbody > tr > td:first-child,
    .table-wrapper .dv-phone-grid > tbody > tr > td:last-child,
    .table-wrapper .dv-pg-personnel > tbody > tr > td:nth-child(5),
    .table-wrapper .dv-pg-plant > tbody > tr > td:nth-child(3),
    .table-wrapper .dv-pg-plant > tbody > tr > td:nth-child(5),
    .table-wrapper .dv-pg-jobcards > tbody > tr > td:nth-child(3),
    .table-wrapper .dv-pg-projects > tbody > tr > td:nth-child(2),
    .table-wrapper .dv-pg-projects > tbody > tr > td:nth-child(5),
    .table-wrapper .dv-pg-users > tbody > tr > td:nth-child(3),
    .table-wrapper .dv-pg-users > tbody > tr > td:nth-child(5) {
        grid-column: 1 / -1;
    }
}

/* Snag 106. The long values follow the short ones, then Actions. A record's
   own name (a project's name, a job instruction's title) stays under its number. */
@media (max-width: 767.98px) {
    .table-wrapper .dv-pg-personnel > tbody > tr > td:nth-child(5),
    .table-wrapper .dv-pg-plant > tbody > tr > td:nth-child(3),
    .table-wrapper .dv-pg-plant > tbody > tr > td:nth-child(5),
    .table-wrapper .dv-pg-projects > tbody > tr > td:nth-child(5),
    .table-wrapper .dv-pg-users > tbody > tr > td:nth-child(3),
    .table-wrapper .dv-pg-users > tbody > tr > td:nth-child(5) {
        order: 1;
    }

    .table-wrapper .dv-phone-grid > tbody > tr > td:last-child {
        order: 2;
    }
}

/* ===========================================================================
   Sprint 8, Task 8.2. The map: Leaflet in a rounded box with the card's thin
   cool grey edge, the Map and Satellite switch top left, and the zoom and
   recentre buttons top right in white, as Dewlann's wireframes show. Full
   width and 260 pixels tall on a phone.
   =========================================================================== */
.dv-map {
    position: relative;
    width: 100%;
    height: 340px;
    border: 1px solid var(--dv-card-line);
    border-radius: var(--dv-radius);
    overflow: hidden;
    background: var(--dv-tint-blue);
    z-index: 0;
}

.dv-map-small {
    height: 220px;
}

.dv-map-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--dv-space-2);
    min-height: 32px;
    margin-top: var(--dv-space-2);
}

.dv-map .leaflet-control-attribution {
    font-size: 0.625rem;
}

.dv-map-switch {
    display: inline-flex;
    padding: 3px;
    gap: 2px;
    border-radius: var(--dv-radius-pill);
    background: var(--dv-surface);
    box-shadow: var(--dv-shadow-hover);
}

.dv-map-switch button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border: 0;
    border-radius: var(--dv-radius-pill);
    background: transparent;
    color: var(--dv-navy);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
}

.dv-map-switch button svg {
    width: 15px;
    height: 15px;
}

.dv-map-switch button.active {
    background: var(--dv-navy);
    color: var(--dv-surface);
}

.dv-map .leaflet-bar {
    border: 0;
    border-radius: var(--dv-radius-sm);
    box-shadow: var(--dv-shadow-hover);
    overflow: hidden;
}

.dv-map .leaflet-bar a {
    width: 34px;
    height: 34px;
    line-height: 34px;
    color: var(--dv-navy);
    font-size: 1.125rem;
}

.dv-map .dv-map-recentre a {
    display: flex;
    align-items: center;
    justify-content: center;
}

.dv-map .dv-map-recentre svg {
    width: 18px;
    height: 18px;
}

.dv-map-pin-wrap {
    background: transparent;
    border: 0;
}

.dv-map-pin {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 3px solid var(--dv-surface);
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    background: var(--dv-pin-colour, var(--dv-navy));
    color: var(--dv-surface);
    box-shadow: var(--dv-shadow-hover);
}

.dv-map-pin svg {
    width: 16px;
    height: 16px;
    transform: rotate(45deg);
}

.dv-map-picker {
    cursor: crosshair;
}

.dv-map-picker[data-read-only="true"] {
    cursor: grab;
}

.dv-head-pill {
    padding: 4px 10px;
    font-weight: 600;
}

@media (max-width: 767.98px) {
    .dv-map,
    .dv-map-small {
        height: 260px;
    }

    .dv-map-switch button {
        padding: 6px 12px;
    }
}

/* ===========================================================================
   Sprint 8, Task 8.4. The shared look of the role pages, as Dewlann's
   wireframes show: colourful drawn icons in round pale tiles, a colour per
   project category, initials circles in place of photos, tiles with a thin
   coloured edge, a project banner, and a welcome banner.
   =========================================================================== */
:root {
    /* The icons' own colours. */
    --dv-ic-yellow:     #F5B82E;
    --dv-ic-orange:     #F28C28;
    --dv-ic-red:        #E5484D;
    --dv-ic-green:      #3FA34D;
    --dv-ic-greenlight: #8BCB5A;
    --dv-ic-teal:       #14A99A;
    --dv-ic-blue:       #0B9D80;
    --dv-ic-bluedeep:   #088A70;
    --dv-ic-sky:        #9FDCCB;
    --dv-ic-purple:     #8B5CF6;
    --dv-ic-brown:      #B98552;
    --dv-ic-grey:       #8C96A6;
    --dv-ic-light:      #DCE7F3;
    --dv-ic-dark:       #2E3644;
    --dv-ic-white:      #FFFFFF;

    /* A colour per project category, and its pale tint. */
    --dv-cat-rrm:               #3FA34D;
    --dv-cat-rrm-tint:          #E8F5E9;
    --dv-cat-reseal:            #F28C28;
    --dv-cat-reseal-tint:       #FFF1E3;
    --dv-cat-upgrading:         #8B5CF6;
    --dv-cat-upgrading-tint:    #F1EBFE;
    --dv-cat-linemarking:       #14A99A;
    --dv-cat-linemarking-tint:  #E0F6F3;
    --dv-cat-other:             #7A8496;
    --dv-cat-other-tint:        #EEF1F5;
    --dv-cat-blue:              #0B9D80;
    --dv-cat-blue-tint:         #E6F4F0;
    --dv-cat-amber:             #E8930C;
    --dv-cat-amber-tint:        #FEF4E2;
    --dv-cat-red:               #E5484D;
    --dv-cat-red-tint:          #FDECEC;

    /* The initials circles, one colour per person. Each is deep enough that the
       white initials read easily (Task 11.20). */
    --dv-av-1: #2D2A2A;
    --dv-av-2: #2E7D32;
    --dv-av-3: #C2410C;
    --dv-av-4: #7C3AED;
    --dv-av-5: #0F766E;
    --dv-av-6: #C62828;
    --dv-av-7: #5A5656;
    --dv-av-8: #8A6D1D;
}

.dvi-yellow { fill: var(--dv-ic-yellow); }
.dvi-orange { fill: var(--dv-ic-orange); }
.dvi-red { fill: var(--dv-ic-red); }
.dvi-green { fill: var(--dv-ic-green); }
.dvi-greenlight { fill: var(--dv-ic-greenlight); }
.dvi-teal { fill: var(--dv-ic-teal); }
.dvi-blue { fill: var(--dv-ic-blue); }
.dvi-bluedeep { fill: var(--dv-ic-bluedeep); }
.dvi-sky { fill: var(--dv-ic-sky); }
.dvi-purple { fill: var(--dv-ic-purple); }
.dvi-brown { fill: var(--dv-ic-brown); }
.dvi-grey { fill: var(--dv-ic-grey); }
.dvi-light { fill: var(--dv-ic-light); }
.dvi-dark { fill: var(--dv-ic-dark); }
.dvi-white { fill: var(--dv-ic-white); }

.dv-cat-rrm { --dv-cat: var(--dv-cat-rrm); --dv-cat-pale: var(--dv-cat-rrm-tint); }
.dv-cat-reseal { --dv-cat: var(--dv-cat-reseal); --dv-cat-pale: var(--dv-cat-reseal-tint); }
.dv-cat-upgrading { --dv-cat: var(--dv-cat-upgrading); --dv-cat-pale: var(--dv-cat-upgrading-tint); }
.dv-cat-linemarking { --dv-cat: var(--dv-cat-linemarking); --dv-cat-pale: var(--dv-cat-linemarking-tint); }
.dv-cat-other { --dv-cat: var(--dv-cat-other); --dv-cat-pale: var(--dv-cat-other-tint); }
.dv-cat-blue { --dv-cat: var(--dv-cat-blue); --dv-cat-pale: var(--dv-cat-blue-tint); }
.dv-cat-amber { --dv-cat: var(--dv-cat-amber); --dv-cat-pale: var(--dv-cat-amber-tint); }
.dv-cat-red { --dv-cat: var(--dv-cat-red); --dv-cat-pale: var(--dv-cat-red-tint); }

/* An icon, and an icon in its round pale tile. */
.dv-ic {
    display: block;
    width: 100%;
    height: 100%;
}

.dv-ic-tile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    padding: 11px;
    border-radius: 50%;
    background: var(--dv-cat-pale, var(--dv-cat-blue-tint));
}

.dv-ic-tile-sm {
    width: 36px;
    height: 36px;
    padding: 7px;
}

.dv-ic-tile-lg {
    width: 72px;
    height: 72px;
    padding: 14px;
}

/* Initials in a coloured circle, in place of a photo. */
.dv-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--dv-av, var(--dv-av-1));
    color: var(--dv-surface);
    font-family: var(--dv-font-head);
    font-weight: 700;
    font-size: 0.875rem;
    letter-spacing: 0.02em;
    box-shadow: 0 0 0 3px var(--dv-surface), 0 0 0 4px var(--dv-card-line);
}

.dv-initials-sm { width: 30px; height: 30px; font-size: 0.6875rem; box-shadow: none; }
.dv-initials-lg { width: 64px; height: 64px; font-size: 1.375rem; }
.dv-av-1 { --dv-av: var(--dv-av-1); }
.dv-av-2 { --dv-av: var(--dv-av-2); }
.dv-av-3 { --dv-av: var(--dv-av-3); }
.dv-av-4 { --dv-av: var(--dv-av-4); }
.dv-av-5 { --dv-av: var(--dv-av-5); }
.dv-av-6 { --dv-av: var(--dv-av-6); }
.dv-av-7 { --dv-av: var(--dv-av-7); }
.dv-av-8 { --dv-av: var(--dv-av-8); }

/* The tile: icon in its round pale tile, a large number, a short label, an
   arrow, and a thin coloured edge on the left. The whole tile is the link. */
.dv-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: var(--dv-space-3);
    margin-bottom: var(--dv-space-4);
}

.dv-tile {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--dv-space-3);
    min-height: 88px;
    padding: var(--dv-space-3) var(--dv-space-4);
    border: 1px solid var(--dv-card-line);
    border-left: 4px solid var(--dv-cat, var(--dv-cat-blue));
    border-radius: var(--dv-radius);
    background: var(--dv-surface);
    box-shadow: var(--dv-card-shadow, var(--dv-shadow));
    color: var(--dv-text);
    text-decoration: none;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

a.dv-tile:hover,
a.dv-tile:focus-visible,
button.dv-tile:hover {
    box-shadow: var(--dv-shadow-hover);
    color: var(--dv-text);
    transform: translateY(-1px);
}

button.dv-tile {
    width: 100%;
    text-align: left;
    font: inherit;
    cursor: pointer;
}

.dv-tile.is-on {
    background: var(--dv-cat-pale, var(--dv-cat-blue-tint));
    box-shadow: 0 0 0 2px var(--dv-cat, var(--dv-cat-blue));
}

.dv-tile-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1 1 auto;
}

.dv-tile-value {
    font-family: var(--dv-font-head);
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--dv-navy);
}

.dv-tile-label {
    font-size: 0.875rem;
    color: var(--dv-text-muted);
    overflow-wrap: break-word;
    line-height: 1.25;
}

.dv-tile-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--dv-cat-pale, var(--dv-cat-blue-tint));
    color: var(--dv-cat, var(--dv-cat-blue));
}

.dv-tile-arrow svg {
    width: 14px;
    height: 14px;
}

/* The project banner, in place of a photo: the category's colour with its large icon. */
.dv-project-banner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 150px;
    border-radius: var(--dv-radius);
    background: linear-gradient(135deg, var(--dv-cat-pale, var(--dv-cat-other-tint)) 0%, var(--dv-surface) 100%);
    border: 1px solid var(--dv-card-line);
    overflow: hidden;
}

.dv-project-banner::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 6px;
    background: var(--dv-cat, var(--dv-cat-other));
}

.dv-project-banner .dv-ic {
    width: 96px;
    height: 96px;
}

.dv-project-banner-sm {
    height: 96px;
}

.dv-project-banner-sm .dv-ic {
    width: 60px;
    height: 60px;
}

/* The welcome banner: a large initials circle, the welcome, the role and
   region, and one short line on the right. */
.dv-welcome {
    display: flex;
    align-items: center;
    gap: var(--dv-space-4);
    padding: var(--dv-space-4) var(--dv-space-5);
    margin-bottom: var(--dv-space-4);
    border: 1px solid var(--dv-card-line);
    border-radius: var(--dv-radius);
    background: linear-gradient(90deg, var(--dv-cat-blue-tint) 0%, var(--dv-surface) 100%);
    box-shadow: var(--dv-card-shadow, var(--dv-shadow));
}

.dv-welcome-who {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.dv-welcome-name {
    font-family: var(--dv-font-head);
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--dv-navy);
    line-height: 1.2;
}

.dv-welcome-role {
    color: var(--dv-text-muted);
}

.dv-welcome-note {
    margin-left: auto;
    padding-left: var(--dv-space-5);
    border-left: 1px solid var(--dv-card-line);
    color: var(--dv-navy);
    font-style: italic;
    max-width: 50%;
}

/* A category in a small pill, in its own colour. */
.dv-cat-pill {
    display: inline-block;
    padding: 2px 10px;
    border-radius: var(--dv-radius-pill);
    background: var(--dv-cat-pale, var(--dv-cat-other-tint));
    color: var(--dv-cat, var(--dv-cat-other));
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

/* A map pin in its category's colour, carrying the category's icon. */
.dv-map-pin.dv-pin-cat {
    width: 38px;
    height: 38px;
    background: var(--dv-cat, var(--dv-navy));
}

.dv-map-pin.dv-pin-cat .dv-ic {
    width: 22px;
    height: 22px;
    padding: 2px;
    border-radius: 50%;
    background: var(--dv-surface);
    transform: rotate(45deg);
}

.dv-map-pin.is-picked {
    box-shadow: 0 0 0 4px var(--dv-cat-pale, var(--dv-cat-blue-tint)), var(--dv-shadow-hover);
}

.dv-map-count {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    background: var(--dv-navy);
    color: var(--dv-surface);
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}

.dv-map .leaflet-tooltip {
    padding: 4px 10px;
    border: 1px solid var(--dv-card-line);
    border-radius: var(--dv-radius-sm);
    color: var(--dv-navy);
    font-weight: 600;
    box-shadow: var(--dv-shadow-hover);
}

.dv-map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    padding: 6px 10px;
    border-radius: var(--dv-radius-sm);
    background: var(--dv-surface);
    box-shadow: var(--dv-shadow-hover);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--dv-navy);
}

.dv-map-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.dv-map-legend .dv-ic-tile {
    width: 22px;
    height: 22px;
    padding: 3px;
}

@media (max-width: 767.98px) {
    .dv-tiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--dv-space-2);
    }

    .dv-tile {
        flex-wrap: wrap;
        gap: var(--dv-space-2);
        min-height: 0;
        padding: var(--dv-space-3);
    }

    .dv-tile .dv-ic-tile {
        width: 40px;
        height: 40px;
        padding: 8px;
    }

    .dv-tile-value {
        font-size: 1.375rem;
    }

    .dv-tile-arrow {
        display: none;
    }

    .dv-welcome {
        flex-wrap: wrap;
        padding: var(--dv-space-3) var(--dv-space-4);
    }

    .dv-welcome-note {
        margin-left: 0;
        padding-left: 0;
        border-left: 0;
        max-width: none;
        flex: 1 1 100%;
    }

    .dv-project-banner {
        height: 110px;
    }
}

/* ===========================================================================
   Sprint 8, Task 8.7. The project overview, as the Construction Manager
   wireframe shows it: Project Details, the Project Team with the organogram
   joined by lines and the key staff list, then Teams, Job instructions,
   Materials and Plant. On a phone each tier of the organogram stacks one card
   to a line.
   =========================================================================== */
.dv-card-heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--dv-space-2);
    margin-bottom: var(--dv-space-4);
    padding-bottom: var(--dv-space-3);
    border-bottom: 1px solid var(--dv-line);
}

.dv-card-heading-row .dv-card-heading {
    margin: 0;
    padding: 0;
    border-bottom: 0;
}

/* Two or three choices in one pill, the chosen one in navy. */
.dv-seg {
    display: inline-flex;
    padding: 3px;
    gap: 2px;
    border: 1px solid var(--dv-card-line);
    border-radius: var(--dv-radius-pill);
    background: var(--dv-canvas);
}

.dv-seg button {
    padding: 5px 14px;
    border: 0;
    border-radius: var(--dv-radius-pill);
    background: transparent;
    color: var(--dv-navy);
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}

.dv-seg button.active {
    background: var(--dv-navy);
    color: var(--dv-surface);
}

.dv-person-line {
    display: inline-flex;
    align-items: center;
    gap: var(--dv-space-2);
}

.dv-overview-details .dv-project-banner {
    margin-bottom: var(--dv-space-3);
}

.dv-overview-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--dv-space-3);
    margin-bottom: var(--dv-space-3);
}

.dv-overview-name {
    font-family: var(--dv-font-head);
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--dv-navy);
    line-height: 1.25;
}

.dv-overview-facts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--dv-space-2);
    margin-bottom: var(--dv-space-3);
}

.dv-overview-facts > div,
.dv-overview-manager,
.dv-overview-description {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.dv-overview-manager,
.dv-overview-description {
    margin-bottom: var(--dv-space-3);
}

/* The organogram, joined by lines. */
.dv-org {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--dv-space-2) 0;
}

.dv-org-tier {
    display: flex;
    justify-content: center;
    width: 100%;
}

.dv-org-link {
    width: 2px;
    height: 18px;
    background: var(--dv-blue-light);
}

.dv-org-row {
    flex-wrap: nowrap;
}

.dv-org-wrap {
    position: relative;
    display: flex;
    justify-content: center;
    flex: 1 1 0;
    min-width: 0;
    max-width: 260px;
    padding: 16px 6px 0;
}

.dv-org-wrap::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    height: 16px;
    border-left: 2px solid var(--dv-blue-light);
}

.dv-org-wrap::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    border-top: 2px solid var(--dv-blue-light);
}

.dv-org-wrap:first-child::after {
    left: 50%;
}

.dv-org-wrap:last-child::after {
    right: 50%;
}

.dv-org-wrap:only-child::after {
    display: none;
}

.dv-org-node {
    display: flex;
    align-items: center;
    gap: var(--dv-space-3);
    width: 100%;
    padding: var(--dv-space-3);
    border: 1px solid var(--dv-card-line);
    border-radius: var(--dv-radius);
    background: var(--dv-cat-blue-tint);
    color: var(--dv-text);
    text-align: left;
    cursor: pointer;
    transition: box-shadow 0.15s ease;
}

.dv-org-node:hover,
.dv-org-node:focus-visible {
    box-shadow: var(--dv-shadow-hover);
}

.dv-org-wide {
    max-width: 340px;
}

.dv-org-tall {
    flex-direction: column;
    justify-content: flex-start;
    text-align: center;
    background: var(--dv-surface);
}

.dv-org-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow-wrap: break-word;
}

.dv-org-text span {
    font-size: 0.8125rem;
    color: var(--dv-text-muted);
}

.dv-org-labour {
    display: flex;
    align-items: center;
    gap: var(--dv-space-3);
    padding: var(--dv-space-3) var(--dv-space-4);
    border: 1px solid var(--dv-card-line);
    border-radius: var(--dv-radius);
    background: var(--dv-cat-rrm-tint);
}

/* The short lists of the four small cards. */
.dv-overview-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dv-overview-list li + li {
    border-top: 1px solid var(--dv-line-soft);
}

.dv-overview-item {
    display: flex;
    align-items: center;
    gap: var(--dv-space-3);
    padding: var(--dv-space-2) 0;
    color: var(--dv-text);
    text-decoration: none;
}

a.dv-overview-item:hover {
    color: var(--dv-blue);
}

.dv-overview-item-main {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
}

.dv-overview-figure {
    font-family: var(--dv-font-head);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dv-navy);
}

/* A table whose rows open a record. */
.dv-row-open tbody tr {
    cursor: pointer;
}

.dv-person-head {
    display: flex;
    align-items: center;
    gap: var(--dv-space-3);
    margin-bottom: var(--dv-space-3);
}

@media (max-width: 1199.98px) {
    .dv-overview-facts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .dv-org-row {
        flex-direction: column;
        align-items: center;
    }

    .dv-org-wrap {
        max-width: none;
        width: 100%;
        padding: 0 0 var(--dv-space-2);
    }

    .dv-org-wrap::before,
    .dv-org-wrap::after {
        display: none;
    }

    .dv-org-tall {
        flex-direction: row;
        text-align: left;
    }

    .dv-org-wide {
        max-width: none;
    }

    .dv-seg {
        width: 100%;
    }

    .dv-seg button {
        flex: 1 1 0;
        min-height: 38px;
        white-space: normal;
    }
}

/* ===========================================================================
   Sprint 8, Task 8.5. The Projects Overview: the Province dropdown and search
   on top, the tiles, the South Africa Project Map, and the panel on the right
   that follows the drill down. On a phone: tiles two to a line, the map under
   them, the panel under the map.
   =========================================================================== */
.dv-po-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--dv-space-2);
    margin-bottom: var(--dv-space-3);
}

.dv-po-province {
    width: auto;
    min-width: 180px;
    border-radius: var(--dv-radius-pill);
    background-color: var(--dv-cat-blue-tint);
    color: var(--dv-navy);
    font-weight: 600;
}

.dv-po-search {
    position: relative;
    margin-left: auto;
    min-width: 240px;
}

.dv-po-search svg {
    position: absolute;
    top: 50%;
    left: 10px;
    width: 16px;
    height: 16px;
    transform: translateY(-50%);
    color: var(--dv-text-muted);
    pointer-events: none;
}

.dv-po-search input {
    padding-left: 32px;
    border-radius: var(--dv-radius-pill);
}

.dv-map-tall {
    height: 460px;
}

.dv-po-panel {
    display: flex;
    flex-direction: column;
}

.dv-po-crumbs {
    margin: calc(-1 * var(--dv-space-2)) 0 var(--dv-space-3);
    color: var(--dv-text-muted);
    font-size: 0.8125rem;
}

.dv-po-person {
    display: flex;
    align-items: center;
    gap: var(--dv-space-3);
    width: 100%;
    padding: var(--dv-space-3);
    margin-bottom: var(--dv-space-2);
    border: 1px solid var(--dv-card-line);
    border-radius: var(--dv-radius);
    background: var(--dv-surface);
    color: var(--dv-text);
    text-align: left;
    cursor: pointer;
    transition: box-shadow 0.15s ease;
}

.dv-po-person:hover,
.dv-po-person:focus-visible {
    box-shadow: var(--dv-shadow-hover);
}

.dv-po-person-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.dv-po-person-text strong {
    color: var(--dv-navy);
    font-size: 1rem;
}

.dv-po-person-text > span {
    color: var(--dv-text-muted);
    font-size: 0.8125rem;
}

.dv-po-person-text .dv-po-line {
    margin-top: 4px;
    color: var(--dv-text);
}

.dv-po-cm-head {
    display: flex;
    align-items: center;
    gap: var(--dv-space-3);
    margin-bottom: var(--dv-space-3);
}

.dv-po-cm-head strong {
    color: var(--dv-navy);
    font-size: 1rem;
}

.dv-po-seg {
    display: flex;
    margin-bottom: var(--dv-space-3);
}

.dv-po-seg button {
    flex: 1 1 0;
}

.dv-po-cats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--dv-space-2);
    margin-bottom: var(--dv-space-3);
}

.dv-po-cat {
    display: flex;
    align-items: center;
    gap: var(--dv-space-2);
    padding: var(--dv-space-2);
    border: 1px solid var(--dv-card-line);
    border-radius: var(--dv-radius-sm);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--dv-navy);
}

.dv-po-cat > span:nth-child(2) {
    flex: 1 1 auto;
    min-width: 0;
}

.dv-po-project {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

@media (max-width: 767.98px) {
    .dv-po-top {
        flex-direction: column;
        align-items: stretch;
    }

    .dv-po-search {
        margin-left: 0;
        min-width: 0;
    }

    .dv-po-province,
    .dv-po-search input {
        width: 100%;
        min-height: 38px;
        font-size: 16px;
    }

    .dv-map-tall {
        height: 260px;
    }

    .dv-po-cats {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Task 8.5. A tile keeps its label's words whole: a slimmer icon tile and padding give the label room. */
.dv-tile {
    gap: 10px;
    padding: var(--dv-space-3) 14px;
}

.dv-tile .dv-ic-tile {
    width: 48px;
    height: 48px;
    padding: 9px;
}

.dv-tile-label {
    font-size: 0.8125rem;
    overflow-wrap: normal;
    word-break: normal;
}

@media (max-width: 767.98px) {
    /* Task 8.5. On a phone a tile keeps its icon beside its number and label. */
    .dv-tile {
        flex-wrap: nowrap;
        align-items: center;
        padding: var(--dv-space-2) var(--dv-space-3);
    }

    .dv-tile .dv-ic-tile {
        width: 36px;
        height: 36px;
        padding: 6px;
    }
}

/* Snag 116. The project's four facts take as many columns as the card has room
   for, and a long category wraps inside its pill, so nothing runs into the next fact. */
.dv-overview-facts {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
}

.dv-overview-facts .dv-cat-pill {
    white-space: normal;
    text-align: left;
}

/* ===========================================================================
   Sprint 8, Task 8.6. The Contract Manager Dashboard: the Project types
   buttons over the map, and the Construction Managers' cards with their
   category pills and project count.
   =========================================================================== */
.dv-cmd-types {
    display: flex;
    flex-wrap: wrap;
    gap: var(--dv-space-2);
    margin-bottom: var(--dv-space-3);
}

.dv-cmd-types .dv-po-cat {
    background: var(--dv-surface);
    cursor: pointer;
}

.dv-cmd-types .dv-po-cat.is-on {
    background: var(--dv-cat-pale);
    box-shadow: 0 0 0 2px var(--dv-cat);
}

.dv-cmd-km .dv-po-person {
    margin-bottom: 0;
}

.dv-cmd-km + .dv-cmd-km {
    margin-top: var(--dv-space-2);
}

.dv-cmd-assigned {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    color: var(--dv-text);
    font-size: 0.8125rem;
}

.dv-cmd-count {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-left: auto;
    padding-left: var(--dv-space-3);
    border-left: 1px solid var(--dv-line-soft);
    color: var(--dv-text-muted);
    font-size: 0.75rem;
}

.dv-cmd-count strong {
    font-family: var(--dv-font-head);
    font-size: 1.5rem;
    color: var(--dv-navy);
}

.dv-cmd-projects {
    padding: var(--dv-space-2) var(--dv-space-3) 0;
}

/* Task 8.8. A shortcut tile, with its name in place of a number. */
.dv-tile-name {
    font-family: var(--dv-font-head);
    font-size: 1rem;
    font-weight: 700;
    color: var(--dv-navy);
}

/* Task 8.8. Tiles keep their own width when there are few of them, as the wireframes show. */
.dv-tiles {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

@media (max-width: 767.98px) {
    .dv-tiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    /* Snag 120. A smaller initials circle on a phone's person cards, so their words have room. */
    .dv-po-person .dv-initials-lg {
        width: 40px;
        height: 40px;
        font-size: 0.875rem;
    }

    /* Snag 118. The landing pages' search keeps its row; its Filters button sits beside it. */
    .dv-po-top.dv-has-phone-filters .dv-po-search {
        display: flex;
        gap: var(--dv-space-2);
        align-items: center;
    }

    .dv-po-top.dv-has-phone-filters .dv-po-search input {
        flex: 1 1 auto;
    }
}

@media (max-width: 767.98px) {
    .dv-po-top.dv-has-phone-filters .dv-filters-toggle {
        display: inline-flex;
        align-items: center;
        flex: 0 0 auto;
        min-height: 38px;
    }

    .dv-po-top.dv-has-phone-filters .dv-filters-toggle.active {
        background: var(--dv-navy);
        border-color: var(--dv-navy);
        color: var(--dv-surface);
    }

    .dv-po-top.dv-has-phone-filters .dv-filters-panel {
        display: none;
    }

    .dv-po-top.dv-has-phone-filters .dv-filters-panel.open {
        display: flex;
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }

    .dv-po-top.dv-has-phone-filters .dv-filters-panel.open > * {
        width: 100%;
        max-width: 100%;
    }
}

/* Snag 118. From 768 pixels the dropdowns stay first on the landing pages' top row, the search on the right. */
@media (min-width: 768px) {
    .dv-po-top .dv-po-province {
        order: -1;
    }
}

/* Snag 124. On a phone a card heading row with a switch beside its title
   wraps to two lines, so it grows with its words and keeps its usual space
   above and below, in place of the fixed strip height. */
@media (max-width: 767.98px) {
    .dv-card > div.dv-card-heading-row:first-child:has(> .dv-card-heading),
    .dv-compact .dv-card > div.dv-card-heading-row:first-child:has(> .dv-card-heading) {
        height: auto;
        min-height: 50px;
        padding-top: 10px;
        padding-bottom: 10px;
        row-gap: 8px;
    }
}

/* ===========================================================================
   Sprint 8, Task 8.10. A material's icon beside its name in a table row, and
   in a small tile on a list card, coloured by its category.
   =========================================================================== */
.dv-ic-tile-xs {
    width: 28px;
    height: 28px;
    padding: 5px;
    border-radius: 9px;
}

.dv-name-with-icon {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.dv-list-card-main.has-icon {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dv-list-card-main.has-icon .dv-list-card-titles {
    min-width: 0;
}

/* Task 8.10. On a phone the Materials card keeps the Material on its own
   first line now that Group is the second column, Group and Category side by
   side, then Use and Unit, then Active and Edit. The On hand card ends with
   the Minimum and Set minimum side by side. */
@media (max-width: 767.98px) {
    .table-wrapper .dv-materials-table > tbody > tr > td:nth-child(2) {
        grid-column: auto;
        order: 0;
    }

    .table-wrapper .dv-materials-table > tbody > tr > td:nth-child(3) {
        grid-column: 1 / -1;
        order: -1;
    }

    .table-wrapper .dv-materials-table > tbody > tr > td:nth-child(6) {
        grid-column: auto;
    }

    .table-wrapper .dv-materials-table > tbody > tr > td:nth-child(7) {
        grid-column: 1 / -1;
    }

    .table-wrapper .dv-onhand-table > tbody > tr > td:nth-child(7),
    .table-wrapper .dv-onhand-table > tbody > tr > td:nth-child(8) {
        grid-column: span 3;
    }

    .table-wrapper .dv-onhand-table > tbody > tr > td:nth-child(8) {
        align-self: end;
    }
}

/* Snag 142, QA Ninja. A Programme item's description is read in full or
   nearly: two lines on a desktop and a tablet, with dots only after the
   second, and on a phone a wider name column with three lines for the
   description and the team line free to wrap. The dates window still shows
   the whole description at its top. */
.dv-gantt-item .dv-gantt-desc {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    white-space: normal;
    overflow: hidden;
    text-overflow: clip;
    line-height: 1.3;
}

@media (max-width: 767.98px) {
    .dv-gantt .dv-gantt-lab {
        min-width: 210px;
        max-width: 210px;
        padding-right: 2.6rem;
    }

    .dv-gantt-item .dv-gantt-desc {
        -webkit-line-clamp: 3;
        line-clamp: 3;
    }

    .dv-gantt-item .dv-gantt-meta {
        white-space: normal;
        overflow: visible;
    }
}

/* Snag 128, QA Ninja. The Construction Manager's Project dropdown is wide
   enough for a project's number and name in bold, with the arrow clear of
   the words. */
.dv-po-project-select {
    min-width: min(22rem, 100%);
    padding-right: 2.5rem;
    text-overflow: ellipsis;
}

/* Snag 130, QA Ninja. On a phone the Filters button on a landing page is the
   small button of the lists, its word in the middle, on the right of its line
   when the page has no search box. */
@media (max-width: 767.98px) {
    .dv-po-top.dv-has-phone-filters > .dv-filters-toggle {
        width: auto;
        margin-left: auto;
        justify-content: center;
        padding: 0 14px;
    }

    .dv-po-project-select {
        min-width: 0;
    }
}

/* Snag 140, QA Ninja. The four facts sit two by two, so Start date and End
   date share a line, or all four on one line when the card is wide enough
   for each to have 130 pixels. Never three and one. */
.dv-overview-details {
    container-type: inline-size;
}

.dv-overview-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@container (min-width: 600px) {
    .dv-overview-facts {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Snag 133, QA Ninja. The staff level of the organogram: one bar under the
   single connector, and an equal-width grid of cards that wraps into rows
   with no line between them. On a phone the cards stack, still with no
   connector between them. */
.dv-org-level {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--dv-space-2);
    width: 100%;
    padding-top: var(--dv-space-3);
    border-top: 2px solid var(--dv-blue-light);
}

.dv-org-level .dv-org-node {
    height: 100%;
}

@media (max-width: 767.98px) {
    .dv-org-level {
        grid-template-columns: 1fr;
        border-top: 0;
        padding-top: 0;
    }
}

/* Snag 132, QA Ninja. The Key staff list: no dots, the values wrap whole,
   and the headings keep room for their sort arrows. */
.dv-keystaff td {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
}

.dv-keystaff td:first-child,
.dv-keystaff td .dv-nowrap {
    overflow-wrap: normal;
}

.dv-keystaff thead th {
    padding-right: 22px;
    white-space: nowrap;
}

/* Snag 135, QA Ninja. A tile's value, such as 0.0 km, stays on one line. */
.dv-tile-value {
    white-space: nowrap;
}

/* Snag 138, QA Ninja. On a phone the map's legend is one short line that
   scrolls sideways, so it keeps the foot of the map clear for the pins. */
@media (max-width: 767.98px) {
    .dv-map-legend {
        flex-wrap: nowrap;
        max-width: calc(100vw - 72px);
        overflow-x: auto;
        padding: 4px 8px;
        gap: 10px;
        font-size: 0.6875rem;
        scrollbar-width: none;
    }

    .dv-map-legend span {
        white-space: nowrap;
    }

    .dv-map-legend .dv-ic-tile {
        width: 18px;
        height: 18px;
        padding: 2px;
    }
}

/* ===========================================================================
   Sprint 8, Task 8.18. Every list card in the dashboard's look (Leon,
   18 November 2026): a white card with a thin cool grey border and a
   coloured left edge as the dashboard tiles have, a soft shadow that lifts on
   hover, an icon tile or a person's initials beside the number, the name in
   navy, and the facts as small uppercase labels over their values, two to a
   line, with a long value across the card. One block, so every list matches.
   =========================================================================== */
.dv-item-card.dv-list-card {
    border: 1px solid var(--dv-card-line);
    border-left: 4px solid var(--dv-cat, var(--dv-cat-blue));
    border-radius: var(--dv-radius);
    background: var(--dv-surface);
    box-shadow: var(--dv-card-shadow, var(--dv-shadow));
    transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.dv-item-card.dv-list-card.is-overdue {
    border-left-color: var(--dv-danger);
}

.dv-item-card.dv-list-card:hover,
.dv-item-card.dv-list-card:focus-within {
    box-shadow: var(--dv-shadow-hover);
    transform: translateY(-2px);
}

.dv-item-card.dv-list-card .dv-item-card-head {
    align-items: center;
    gap: 10px;
    padding: 14px 16px 12px;
}

.dv-item-card.dv-list-card .dv-list-card-main.has-icon {
    gap: 12px;
}

.dv-item-card.dv-list-card .dv-list-card-main .dv-ic-tile-sm {
    width: 42px;
    height: 42px;
    padding: 8px;
}

.dv-item-card.dv-list-card .dv-list-card-main .dv-initials {
    flex: 0 0 auto;
}

.dv-item-card.dv-list-card .dv-item-card-number,
.dv-item-card.dv-list-card a.dv-card-number-link {
    color: var(--dv-navy);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.25;
}

.dv-item-card.dv-list-card:hover a.dv-card-number-link {
    color: var(--dv-blue-bright, var(--dv-navy));
}

.dv-item-card.dv-list-card .dv-item-card-sub {
    margin-top: 2px;
    font-size: 0.8125rem;
    color: var(--dv-text-muted);
}

.dv-item-card.dv-list-card .dv-item-card-body.dv-list-card-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 16px;
    padding: 12px 16px 14px;
    border-top: 1px solid var(--dv-line-soft);
}

.dv-list-card-fact {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.dv-list-card-fact.is-wide {
    grid-column: 1 / -1;
}

.dv-list-card-label {
    margin-bottom: 2px;
    font-size: 0.625rem;
    font-weight: 800;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--dv-text-muted);
}

.dv-list-card-value {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--dv-text);
    overflow-wrap: anywhere;
}

.dv-item-card.dv-list-card .dv-item-card-foot {
    padding: 10px 16px;
    border-top: 1px solid var(--dv-line-soft);
    background: #FAFAFA;
}

@media (max-width: 767.98px) {
    .dv-item-card.dv-list-card .dv-item-card-head {
        padding: 12px 14px 10px;
    }

    .dv-item-card.dv-list-card .dv-item-card-body.dv-list-card-facts {
        gap: 8px 12px;
        padding: 10px 14px 12px;
    }

    .dv-item-card.dv-list-card:hover {
        transform: none;
    }
}

/* Snag 148. The client across the whole line of facts. */
.dv-overview-facts > .dv-overview-fact-wide {
    grid-column: 1 / -1;
}

/* Snag 152, QA Ninja. A right aligned heading on a sortable table keeps the
   same gap before its arrow as a left aligned one: the arrow sits 9 pixels
   from the edge and is about 8 wide, so the words stop 28 pixels in. */
.table.sortable > thead > tr > th.text-end:not(.no-sort) {
    padding-right: 28px !important;
}

/* ===========================================================================
   Sprint 8, Task 8.11. Material Management, as the wireframe's Material
   Management half: the heading card with its Material | Plant switch, the
   Inventory Snapshot with its bars, the category tiles, and the key under
   the map. Tiles, map and cards are the shared ones of Task 8.4.
   =========================================================================== */
.dv-module-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--dv-space-3);
    background: linear-gradient(100deg, var(--dv-cat-blue-tint), var(--dv-surface) 70%);
}

.dv-module-head-text {
    flex: 1 1 14rem;
    min-width: 0;
}

.dv-module-head-title {
    font-family: var(--dv-font-head);
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--dv-navy);
    line-height: 1.2;
}

.dv-seg a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: var(--dv-radius-pill);
    color: var(--dv-navy);
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.dv-seg a svg {
    width: 18px;
    height: 18px;
}

.dv-seg a.active {
    background: var(--dv-navy);
    color: var(--dv-surface);
}

.dv-link-more {
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.dv-stock-key {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--dv-text-muted);
}

.dv-stock-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--dv-cat);
}

.dv-snapshot {
    display: flex;
    flex-direction: column;
    gap: var(--dv-space-3);
    margin: 0;
    padding: 0;
    list-style: none;
}

.dv-snapshot li {
    display: flex;
    align-items: center;
    gap: var(--dv-space-3);
}

.dv-snapshot-main {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.dv-snapshot-line {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--dv-space-2);
}

.dv-snapshot-line strong {
    color: var(--dv-navy);
    overflow-wrap: anywhere;
}

.dv-snapshot-amount {
    font-weight: 700;
    color: var(--dv-navy);
    white-space: nowrap;
}

.dv-snapshot-min {
    font-size: 0.75rem;
    color: var(--dv-text-muted);
}

.dv-bar {
    display: block;
    height: 6px;
    border-radius: 3px;
    background: var(--dv-line-soft);
    overflow: hidden;
}

.dv-bar > span {
    display: block;
    height: 100%;
    border-radius: 3px;
}

.dv-bar.is-ok > span {
    background: var(--dv-cat-rrm);
}

.dv-bar.is-low > span {
    background: var(--dv-cat-amber);
}

.dv-cat-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: var(--dv-space-2);
}

.dv-cat-tile {
    display: flex;
    align-items: center;
    gap: var(--dv-space-2);
    padding: 10px 12px;
    border: 1px solid var(--dv-card-line);
    border-left: 4px solid var(--dv-cat, var(--dv-cat-blue));
    border-radius: var(--dv-radius-sm);
    background: var(--dv-surface);
    color: var(--dv-navy);
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.dv-cat-tile:hover,
.dv-cat-tile:focus-visible {
    box-shadow: var(--dv-shadow-hover);
    color: var(--dv-navy);
    transform: translateY(-1px);
}

.dv-cat-tile.is-on {
    background: var(--dv-cat-pale, var(--dv-cat-blue-tint));
}

.dv-cat-tile-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
}

#dvStockTabs,
#dvPlantTabs {
    scroll-margin-top: 80px;
}

/* Snag 184. The filter in use, in words, beside a card heading. */
.dv-filter-pill {
    font-weight: 600;
    white-space: normal;
    text-align: left;
}

@media (max-width: 767.98px) {
    .dv-cat-tiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dv-module-head-title {
        font-size: 1.1rem;
    }

    .dv-module-switch {
        width: 100%;
    }

    .dv-module-switch a {
        flex: 1 1 0;
        justify-content: center;
    }
}

/* Task 8.11. On a phone the All projects On hand card starts with the
   project and the material on their own line. */
@media (max-width: 767.98px) {
    .table-wrapper .dv-onhand-all > tbody > tr > td:nth-child(1) {
        grid-column: span 3;
        order: -2;
    }

    .table-wrapper .dv-onhand-all > tbody > tr > td:nth-child(2) {
        grid-column: span 3;
        order: 0;
    }

    .table-wrapper .dv-onhand-all > tbody > tr > td:nth-child(3) {
        grid-column: 1 / -1;
        order: -1;
    }

    .table-wrapper .dv-onhand-all > tbody > tr > td:nth-child(4),
    .table-wrapper .dv-onhand-all > tbody > tr > td:nth-child(5),
    .table-wrapper .dv-onhand-all > tbody > tr > td:nth-child(6),
    .table-wrapper .dv-onhand-all > tbody > tr > td:nth-child(7) {
        grid-column: span 2;
    }

    .table-wrapper .dv-onhand-all > tbody > tr > td:nth-child(8),
    .table-wrapper .dv-onhand-all > tbody > tr > td:nth-child(9) {
        grid-column: span 3;
    }
}

/* Task 8.11. On a phone a category tile stacks its icon over its name, the
   name breaks only between words, and the count sits in the corner. */
.dv-cat-tile {
    position: relative;
}

.dv-cat-tile-name {
    overflow-wrap: normal;
    word-break: normal;
}

@media (max-width: 767.98px) {
    .dv-cat-tile {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 10px 40px 10px 10px;
    }

    .dv-cat-tile .dv-count-pill {
        position: absolute;
        top: 8px;
        right: 8px;
    }
}

/* Snag 158, QA Ninja. On a phone Travel Logs' project choice takes its own
   full line, so "All projects" and a project's number read clear of the arrow. */
@media (max-width: 767.98px) {
    .dv-staff-project {
        flex: 1 1 100%;
        order: 10;
        width: 100%;
    }

    .dv-staff-project .form-select {
        width: 100%;
        max-width: none;
    }
}

/* Snag 156, QA Ninja. A row of tiles shares its width evenly: five across on a
   wide screen and three and two below it, three or four across where there
   are that many; and every tile's number sits at the top of its words, so
   numbers line up along a row whatever the label's length. */
@media (min-width: 768px) {
    .dv-tiles:has(> :nth-child(3):last-child) {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .dv-tiles:has(> :nth-child(5):last-child) {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .dv-tiles:has(> :nth-child(4):last-child) {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Leon, 5 December 2026: five across only from 1440 pixels. Below it a tile's words had
   41 to 52 pixels beside its icon and arrow, so three and two. */
@media (min-width: 1440px) {
    .dv-tiles:has(> :nth-child(5):last-child) {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

/* Snag 198. Six tiles, as the Projects Overview has with Not compliant: three
   across on a tablet, all six on one line from 1700 pixels. Leon, 5 December 2026: below 1700
   a tile's words had 20 pixels beside its icon and arrow, so three across. */
@media (min-width: 768px) {
    .dv-tiles:has(> :nth-child(6):last-child) {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1700px) {
    .dv-tiles:has(> :nth-child(6):last-child) {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

.dv-tile .dv-tile-body {
    align-self: flex-start;
    padding-top: 4px;
}

/* Snag 158. The phone toolbar rules give each item a small share; the project
   choice on Travel Logs takes the whole line, above them. */
@media (max-width: 767.98px) {
    .dv-toolbar .dv-toolbar-group > form.dv-staff-project {
        flex: 1 1 100% !important;
        max-width: none !important;
    }

    .dv-toolbar .dv-toolbar-group > form.dv-staff-project > .form-select {
        width: 100% !important;
        max-width: none !important;
    }
}

/* Snag 154, QA Ninja. Every road stretch's Items and prices table has the same
   column widths, so the columns line up down the page. From 768 pixels; on a
   phone each row is a card. */
@media (min-width: 768px) {
    .table.dv-items-table {
        table-layout: fixed;
        width: 100%;
    }

    .table.dv-items-table > thead > tr > th:nth-child(1) { width: 130px; }
    .table.dv-items-table > thead > tr > th:nth-child(3) { width: 70px; }
    .table.dv-items-table > thead > tr > th:nth-child(4) { width: 105px; }
    .table.dv-items-table > thead > tr > th:nth-child(5) { width: 130px; }
    .table.dv-items-table > thead > tr > th:nth-child(6) { width: 140px; }

    .table.dv-items-table > tbody > tr > td.dv-item-desc {
        white-space: normal;
        overflow-wrap: anywhere;
    }
}

/* ===========================================================================
   Sprint 8, Task 8.12. Stock orders on Material Management: the Need more
   material? card as the wireframe draws it, the line naming an order's status
   and history at the top of its window, and Recent orders' numbers.
   =========================================================================== */
.dv-need-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--dv-space-2);
    text-align: center;
    background: linear-gradient(180deg, var(--dv-cat-blue-tint), var(--dv-surface) 75%);
}

.dv-need-title {
    font-family: var(--dv-font-head);
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--dv-navy);
}

.dv-need-card p {
    max-width: 22rem;
    margin-bottom: var(--dv-space-2);
}

.dv-need-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--dv-space-2);
}

.dv-order-status {
    padding: 8px 12px;
    border: 1px solid var(--dv-card-line);
    border-radius: var(--dv-radius-sm);
    background: var(--dv-canvas);
    font-size: 0.8125rem;
    color: var(--dv-text);
}

.dv-strong-link {
    font-weight: 700;
    text-decoration: none;
}

.dv-orders-table > tbody > tr[data-dv-order-open] {
    cursor: pointer;
}

/* Sprint 8, Task 8.13. A transfer's row opens its window. */
.dv-transfers-table > tbody > tr[data-dv-transfer-open] {
    cursor: pointer;
}

/* Snag 160, QA Ninja. A control for a phone only, or for a desktop only. */
@media (min-width: 768px) {
    .dv-phone-only {
        display: none !important;
    }
}

@media (max-width: 767.98px) {
    .dv-desktop-only {
        display: none !important;
    }
}

/* Snag 161, QA Ninja. Material Management's heading card holds its short line, not the page's name again. */
.dv-module-head-line {
    font-weight: 600;
    color: var(--dv-navy);
}

/* Snag 163, QA Ninja. The map's key, side by side on the left. */
.dv-stock-keys {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px 16px;
}

/* Snag 165, QA Ninja. A chosen tile keeps its white card and its circles,
   marked by a border all round in its colour and a pale wash behind the
   words only. */
.dv-tile.is-on {
    background: var(--dv-surface);
    border-color: var(--dv-cat, var(--dv-cat-blue));
    box-shadow: 0 0 0 1px var(--dv-cat, var(--dv-cat-blue)), var(--dv-shadow-hover);
}

/* Snag 166, QA Ninja. Subtotal starts in line with the item numbers. */
.table.dv-items-table > tfoot > tr.dv-items-subtotal > td:first-child {
    padding-left: 14px;
}

/* Snag 162, QA Ninja. On a phone each All projects On hand card opens with the
   material, then the project and the figures. */
@media (max-width: 767.98px) {
    .table-wrapper .dv-onhand-all > tbody > tr > td:nth-child(3) {
        order: -3;
    }

    .table-wrapper .dv-onhand-all > tbody > tr > td:nth-child(1) {
        order: -2;
        grid-column: span 3;
    }

    .table-wrapper .dv-onhand-all > tbody > tr > td:nth-child(2) {
        order: -1;
        grid-column: span 3;
    }
}

/* Snag 171, QA Ninja. An order's and a transfer's number reads as the way in,
   in the link blue Recent orders uses, on both tabs. */
.table > tbody > tr > td strong.dv-record-number,
.dv-record-number,
a.dv-strong-link {
    color: var(--dv-blue-bright, #0B9D80);
}


/* ==========================================================================
   Task 8.15. Request plant: each plant item in the list with its type icon,
   its number and type over its project, and its status on the right.
   ========================================================================== */
.dv-plant-pick .dv-pick-row {
    align-items: center;
}

.dv-plant-pick .dv-plant-pick-text {
    flex: 1 1 auto;
    min-width: 0;
}

.dv-plant-pick .dv-plant-pick-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px;
    flex: 0 0 auto;
    max-width: 45%;
}

@media (max-width: 575.98px) {
    .dv-plant-pick .dv-pick-row {
        flex-wrap: wrap;
    }

    .dv-plant-pick .dv-plant-pick-badges {
        max-width: none;
        padding-left: calc(1.25rem + 36px);
        justify-content: flex-start;
        flex-basis: 100%;
    }
}


/* Snag 172, QA Ninja. A plant's description wraps in full in the table,
   with room for a few words a line. */
.dv-pg-plant td.dv-plant-desc {
    min-width: 11rem;
}

/* Snag 174, QA Ninja. A plant card with two badges (its status and a booking
   or a service warning) puts them on a line of their own under the number and
   type, so the type reads on one line however narrow the card. */
.dv-plant-cards .dv-item-card.dv-list-card .dv-item-card-head:has(.dv-list-card-badges .dv-badge + .dv-badge) {
    flex-wrap: wrap;
    row-gap: 8px;
}

.dv-plant-cards .dv-item-card-head:has(.dv-list-card-badges .dv-badge + .dv-badge) .dv-list-card-badges {
    flex: 1 1 100%;
    justify-content: flex-start;
    padding-left: 54px;
}


/* ==========================================================================
   Task 8.16. Plant Management: Plant Availability shows each plant item's
   status (and Booked) at the right of its name, as the wireframe.
   ========================================================================== */
.dv-plant-availability-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px;
    flex: 0 0 auto;
}

.dv-plant-availability .dv-snapshot-line strong {
    min-width: 0;
}

/* Snag 177, QA Ninja. The Plant table at a desktop width: a badge never
   breaks inside itself, a figure such as "230 of 250 hrs" stays on one line,
   the type has room for "TLB / Backhoe Loader", and below 1600 pixels
   Registration and Service interval step aside (they are on the plant item,
   its card and the exports). */
.table-wrapper .dv-pg-plant .dv-badge,
.table-wrapper .dv-plant-mgmt-table .dv-badge,
.table-wrapper .dv-pg-plant .dv-nowrap,
.table-wrapper .dv-plant-mgmt-table .dv-nowrap {
    white-space: nowrap;
}

.dv-pg-plant td.dv-plant-type {
    min-width: 11.5rem;
}

.dv-pg-plant td.dv-plant-type .dv-name-with-icon {
    flex-wrap: nowrap;
}

@media (min-width: 576px) and (max-width: 1599.98px) {
    .dv-pg-plant .dv-plant-wide-hide {
        display: none;
    }
}

/* Leon, 19 November 2026. The small space between the side menu's groups:
   Projects, Material and Plant Management; Job Instructions and Travel Logs;
   then the registers. */
.dv-nav-gap {
    height: 10px;
    flex: 0 0 10px;
}

/* Leon, 19 November 2026. The side menu's items closer together, so the whole
   menu sits comfortably on a smaller screen. A phone, and field mode, keep the
   larger tap size set above. */
.dv-nav-item {
    padding-top: 7px;
    padding-bottom: 7px;
    margin-bottom: 1px;
}

@media (min-width: 1200px) {
    .dv-nav-item {
        padding-top: 0.45rem;
        padding-bottom: 0.45rem;
    }
}

/* Leon, 19 November 2026. Plant Management's Plant card carries the plant
   register's tools on its heading row; on a narrow screen they drop below. */
.dv-plant-tools-row {
    flex-wrap: wrap;
    row-gap: var(--dv-space-2);
}

/* Snag 191. The Work Plan's team choice and buttons in the Captured work card's heading row. */
.dv-toolbar.dv-toolbar-in-heading {
    flex: 1 1 auto;
    justify-content: flex-end;
    margin-bottom: 0;
}

.dv-toolbar.dv-toolbar-in-heading .dv-toolbar-group:empty {
    display: none;
}

/* Task 9.3. A person's photo, cropped to the same circle as their initials. */
.dv-initials-photo,
.dv-avatar-photo {
    overflow: hidden;
    background: var(--dv-line-soft);
    padding: 0;
}

.dv-initials-photo img,
.dv-avatar-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Task 9.3. The photo on a person's own page, with Change photo and Remove photo. */
.dv-photo-field {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--dv-space-3);
}

.dv-photo-field .dv-initials {
    width: 72px;
    height: 72px;
    font-size: 1.5rem;
}

.dv-photo-name {
    flex-basis: 100%;
    color: var(--dv-text-muted);
    font-size: 0.8125rem;
    overflow-wrap: anywhere;
}

.dv-photo-field .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 767.98px) {
    .dv-photo-field .btn {
        min-height: 44px;
    }
}

/* Task 9.4. A contractor's own logo on its login page: kept to a sensible height. */
.dv-login-brand-logo {
    max-height: 96px;
    width: auto;
    object-fit: contain;
}

.dv-login-product-name.dv-login-brand-name {
    display: block;
    letter-spacing: 0.02em;
    text-indent: 0;
    font-size: 1.25rem;
    line-height: 1.3;
    text-align: center;
    overflow-wrap: anywhere;
}

/* Task 9.5. A payment certificate's work, one block per job instruction. */
.dv-cert-group + .dv-cert-group {
    margin-top: var(--dv-space-4);
}

.dv-cert-group-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--dv-space-2);
    margin-bottom: var(--dv-space-2);
    overflow-wrap: anywhere;
}

.dv-cert-group-total {
    margin-left: auto;
    font-weight: 700;
    white-space: nowrap;
}

@media (max-width: 767.98px) {
    .table-wrapper .dv-pg-certwork > tbody > tr > td:nth-child(2),
    .table-wrapper .dv-pg-certdocs > tbody > tr > td:nth-child(1),
    .table-wrapper .dv-pg-certdocs > tbody > tr > td:nth-child(2) {
        grid-column: 1 / -1;
    }
}

/* Task 9.8. Phone first: every button and the Filters button at least 38
   pixels tall on a phone, and the menu's close button easy to hit. Nothing
   changes from 768 pixels up. */
@media (max-width: 767.98px) {
    .btn.btn-sm,
    .dv-toolbar.dv-has-phone-filters .dv-filters-toggle {
        min-height: 38px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .dv-drawer-close {
        min-width: 44px;
        min-height: 44px;
    }

    .table-action-link,
    .btn.table-action-link {
        min-height: 38px;
    }
}

/* Snag 202. Status words in one row under a card's name, so a long name
   keeps the width of the card and every card puts its badges the same way. */
.dv-list-card-badges-below {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

/* Snag 203. Every dropdown keeps room for its arrow. The shared field rule
   above gives text boxes and dropdowns the same padding, which left a
   dropdown's words running under its arrow. A filter dropdown on the one
   line toolbar then grows to its longest choice where there is room. */
select.form-select {
    padding-right: 2.25rem;
}

/* Snag 208. A certificate's work: each job instruction is one line that opens
   to show its lines. The arrow turns when it is open. */
details.dv-cert-group {
    border-top: 1px solid var(--dv-line-soft);
}

details.dv-cert-group + details.dv-cert-group {
    margin-top: 0;
}

details.dv-cert-group > summary.dv-cert-group-head {
    list-style: none;
    cursor: pointer;
    margin: 0;
    padding: 10px 4px 10px 26px;
    position: relative;
    min-height: 44px;
    align-items: center;
}

details.dv-cert-group > summary.dv-cert-group-head::-webkit-details-marker {
    display: none;
}

details.dv-cert-group > summary.dv-cert-group-head::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 17px;
    width: 7px;
    height: 7px;
    border-right: 2px solid var(--dv-text-muted);
    border-bottom: 2px solid var(--dv-text-muted);
    transform: rotate(-45deg);
    transition: transform 0.15s;
}

details.dv-cert-group[open] > summary.dv-cert-group-head::before {
    transform: rotate(45deg);
}

details.dv-cert-group > summary.dv-cert-group-head:hover {
    background-color: var(--dv-row-hover);
}

.dv-cert-group-number {
    font-weight: 700;
}

details.dv-cert-group[open] > .table-wrapper {
    margin-bottom: var(--dv-space-3);
}

/* Snag 210. A certificate's work tables share one set of column widths, so
   Unit, Rate, Quantity and Amount line up from one job instruction to the
   next. Description takes the rest. A phone shows each line as a card. */
@media (min-width: 768px) {
    .table-wrapper table.dv-pg-certwork {
        table-layout: fixed;
        width: 100%;
    }

    .dv-pg-certwork col.dv-cw-item { width: 112px; }
    .dv-pg-certwork col.dv-cw-unit { width: 64px; }
    .dv-pg-certwork col.dv-cw-rate { width: 112px; }
    .dv-pg-certwork col.dv-cw-qty { width: 96px; }
    .dv-pg-certwork col.dv-cw-amount { width: 124px; }

    .dv-pg-certwork td.dv-nowrap {
        white-space: normal;
        overflow-wrap: anywhere;
    }
}

@media (min-width: 1200px) {
    .dv-pg-certwork col.dv-cw-item { width: 130px; }
    .dv-pg-certwork col.dv-cw-unit { width: 80px; }
    .dv-pg-certwork col.dv-cw-rate { width: 130px; }
    .dv-pg-certwork col.dv-cw-qty { width: 110px; }
    .dv-pg-certwork col.dv-cw-amount { width: 140px; }
}

/* Snag 214. The note beside the page heading, such as a project's name, takes
   the width that is free in the app bar and wraps onto a second line where it
   must, never cut short with dots. A phone and a tablet leave it off. */
.dv-appbar .dv-appbar-subtitle {
    max-width: none;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
    line-height: 1.3;
    border-radius: 12px;
    min-width: 0;
}

/* Snag 215. A short line under a figure only tile's label, such as a plant's
   service warning under Since service. A tile marked dv-tile-wrap may break
   its figure between words, so "230 of 250 hrs" stays inside its tile on a
   phone. Money figures never break. */
.dv-tile-static.dv-tile-wrap .dv-tile-value {
    white-space: normal;
    overflow-wrap: anywhere;
}

.dv-tile-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--dv-text-muted);
    margin-top: 2px;
}

/* Snag 217. A right aligned figure heading on a sortable table (dv-num, such
   as Quantity, Rate and Amount) keeps its arrow clear of its words. Snag 223:
   wider padding pushed a crowded table past its box at 768 pixels, so the
   heading keeps its width and the arrow moves closer to the cell's edge. */
.table.sortable > thead > tr > th.dv-num:not(.no-sort)::after {
    right: 2px;
}

/* Snag 220. The odometer's typed reading is large and bold, but its grey hint
   is in the same weight and size as every other hint. */
.dv-trip-odometer::placeholder {
    font-weight: 400;
    font-size: 0.92rem;
}

@media (max-width: 767.98px) {
    .dv-trip-odometer::placeholder {
        font-size: 16px;
    }
}

/* Task 10.1. Text kept line by line as it was typed, such as a project's
   Notes, wrapping where a line is long. */
.dv-pre-line {
    white-space: pre-line;
    overflow-wrap: anywhere;
}

/* Task 10.3. A job instruction's critical issue stands out on its Details tab. */
.dv-row-value.dv-critical-issue {
    color: var(--dv-danger);
    font-weight: 600;
    white-space: pre-line;
}

/* Task 10.4. A project's progress report: the critical issue in red, as on a
   job instruction's Details tab. On a phone each row is a card, the job
   instruction, delays and critical issue across its whole width. */
.dv-pg-progress td.dv-critical-cell {
    color: var(--dv-danger);
    font-weight: 600;
}

/* The number stays whole; the title beside it wraps, so the report fits its box. */
.table-wrapper .dv-pg-progress > tbody > tr > td:first-child {
    white-space: normal;
    min-width: 11rem;
}

@media (max-width: 767.98px) {
    .table-wrapper .dv-pg-progress > tbody > tr > td:nth-child(1),
    .table-wrapper .dv-pg-progress > tbody > tr > td:nth-child(4),
    .table-wrapper .dv-pg-progress > tbody > tr > td:nth-child(7) {
        grid-column: 1 / -1;
    }
}

/* Task 10.5. The weather: three days side by side on a project's Overview,
   one under the other on a phone; and one short line under a project's name
   on the landing pages. */
.dv-weather-days {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--dv-space-3);
}

.dv-weather-day {
    border: 1px solid var(--dv-line-soft);
    border-radius: var(--dv-radius-sm);
    padding: 10px 12px;
    background: var(--dv-surface);
}

.dv-weather-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--dv-text-muted);
}

.dv-weather-word {
    font-weight: 600;
    color: var(--dv-navy);
    margin-top: 2px;
}

.dv-weather-rain {
    font-size: 0.85rem;
    color: var(--dv-text-muted);
}

.dv-weather-line {
    display: block;
    font-size: 0.8rem;
    color: var(--dv-text-muted);
}

@media (max-width: 575.98px) {
    .dv-weather-days {
        grid-template-columns: 1fr;
        gap: var(--dv-space-2);
    }
}

/* Snag 225. A job instruction's document names are long ("JI 7015 - Pavement
   Repairs (revised).pdf"): every word shows and the name wraps, breaking a
   long word with no spaces rather than pushing the table past its box. */
.table td.dv-doc-name {
    overflow-wrap: anywhere;
    min-width: 10rem;
}

/* Snag 227. The Progress tab's Delays and Critical issue show every line in
   full, one under the other, with a little room between reasons. They take
   the width that is left, so the table stays inside its box at 768. */
.dv-pg-progress td.dv-pg-lines > span + span {
    margin-top: 2px;
}

/* Snag 230, QA Ninja. A long email address in a table shows in full and
   breaks onto a second line where it must, never cut short with dots. */
.table td.dv-wrap-any {
    overflow-wrap: anywhere;
}

/* Snag 232, QA Ninja. A long value, such as a job instruction's Notes, sits
   under its label, left aligned, across the card's width. */
.dv-row.dv-row-block {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
}

.dv-row.dv-row-block > .dv-row-value {
    text-align: left;
    font-weight: 400;
}

/* Snag 234, QA Ninja. The critical issue on the Details tab reads like Notes:
   the label on one line, the issue under it, left aligned, in red. */
.dv-row.dv-row-block > .dv-row-value.dv-critical-issue {
    font-weight: 600;
}

/* Snag 236, QA Ninja. The Progress table's date headings stay on one line.
   Below 992 pixels, where seven columns squeeze the delays and the critical
   issue, each row is a card, as on a phone: the job instruction, the delays
   and the critical issue across it, the dates and the value three to a line. */
/* Snag 236 reopened: written to outrank ".table-wrapper .table th", which
   lets every heading wrap. */
.table-wrapper .table.dv-pg-progress > thead > tr > th {
    white-space: nowrap;
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .dv-pg-progress-wrap {
        background: transparent;
        box-shadow: none;
        border: 0;
        overflow: visible;
    }

    .dv-pg-progress-wrap > .table {
        min-width: 0;
    }

    .dv-pg-progress-wrap thead {
        display: none;
    }

    .dv-pg-progress-wrap table,
    .dv-pg-progress-wrap tbody {
        display: block;
        width: 100%;
    }

    .dv-pg-progress-wrap tbody > tr {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        column-gap: var(--dv-space-3);
        background: var(--dv-surface);
        border: 1px solid var(--dv-line-soft);
        border-radius: var(--dv-radius);
        margin-bottom: var(--dv-space-2);
        padding: var(--dv-space-2) var(--dv-space-3);
    }

    .dv-pg-progress-wrap > .table > tbody > tr > td {
        display: block;
        width: auto;
        min-width: 0;
        border: 0;
        padding: 3px 0;
        white-space: normal;
        text-align: left;
        background: transparent;
        overflow-wrap: anywhere;
    }

    .dv-pg-progress-wrap > .table > tbody > tr > td:nth-child(1),
    .dv-pg-progress-wrap > .table > tbody > tr > td:nth-child(4),
    .dv-pg-progress-wrap > .table > tbody > tr > td:nth-child(7) {
        grid-column: 1 / -1;
    }

    .dv-pg-progress-wrap td[data-label]::before {
        content: attr(data-label);
        display: block;
        font-size: 0.66rem;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        color: var(--dv-text-muted);
    }

    /* Snag 236 reopened: as specific as the cell rule above, so an empty
       cell (a job instruction not started) is left out with its heading. */
    .dv-pg-progress-wrap > .table > tbody > tr > td:empty {
        display: none;
    }
}

/* Snag 236. As cards, a job instruction with no delays or no critical issue
   leaves that heading out rather than showing it with nothing under it. */
@media (max-width: 991.98px) {
    .table-wrapper .dv-pg-progress > tbody > tr > td.dv-pg-lines:not(:has(> span)) {
        display: none;
    }
}

/* Snag 245, QA Ninja. On a phone every job instruction line on a certificate's
   Work card reads the same way, whatever the length of its title: the number
   and title on the first line, the line count and the amount on the second,
   the amounts lined up on the right. */
@media (max-width: 575.98px) {
    details.dv-cert-group > summary.dv-cert-group-head {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        column-gap: var(--dv-space-2);
        row-gap: 4px;
        align-items: baseline;
    }

    details.dv-cert-group > summary.dv-cert-group-head > .dv-cert-group-number { grid-column: 1; grid-row: 1; }
    details.dv-cert-group > summary.dv-cert-group-head > .dv-cert-group-title { grid-column: 2; grid-row: 1; }
    details.dv-cert-group > summary.dv-cert-group-head > .dv-count-pill { grid-column: 1; grid-row: 2; justify-self: start; }
    details.dv-cert-group > summary.dv-cert-group-head > .dv-cert-group-total { grid-column: 2; grid-row: 2; justify-self: end; margin-left: 0; }
}

/* Snag 238, QA Ninja. From 1280 pixels a list's toolbar keeps its button group
   (PDF, Excel, the views and the main button) together on the far right. When
   a filter adds Clear filters and the row is full, the search and filters wrap
   within their own group; the main button never moves. */
@media (min-width: 1280px) {
    .dv-toolbar.dv-toolbar-oneline {
        flex-wrap: nowrap;
        align-items: flex-start;
    }

    .dv-toolbar.dv-toolbar-oneline > .dv-toolbar-group:first-child {
        flex: 1 1 0;
        min-width: 0;
        flex-wrap: wrap;
    }

    .dv-toolbar.dv-toolbar-oneline > .dv-toolbar-group:last-child {
        flex: 0 0 auto;
        flex-wrap: nowrap;
        margin-left: auto;
    }

    /* Snag 238 reopened. Inside that group nothing shrinks: each filter is as
       wide as its longest choice and the search is 200 pixels, so when the
       row is full whole controls wrap to a second line, Filter and Clear with
       them, and no choice runs under its arrow. */
    .dv-toolbar.dv-toolbar-oneline > .dv-toolbar-group:first-child .dv-search {
        flex: 0 0 200px;
        width: 200px;
        min-width: 200px;
        max-width: 200px;
    }

    .dv-toolbar.dv-toolbar-oneline > .dv-toolbar-group:first-child .dv-filter-select {
        flex: 0 0 auto;
        width: auto;
        min-width: 0;
        max-width: none;
    }

    .dv-toolbar.dv-toolbar-oneline > .dv-toolbar-group:first-child > *,
    .dv-toolbar.dv-toolbar-oneline > .dv-toolbar-group:first-child > .dv-filters-panel > * {
        flex-shrink: 0;
    }

    /* Put in by initToolbarTail in site.js, so Filter and Clear never sit on a
       line of their own: the last filter goes down with them. */
    .dv-toolbar.dv-toolbar-oneline > .dv-toolbar-group:first-child .dv-toolbar-break {
        flex: 0 0 100%;
        height: 0;
        margin: 0;
    }
}

/* --------------------------------------------------------------------------
   Leon, 28 November 2026. The Daveng Administrator's landing page: the
   contractors and their contracts. Each contractor keeps one colour on every
   chart, by its place in the list (the brand's charcoal, then
   teal, amber, purple). The stages run light to dark in their own order.
   -------------------------------------------------------------------------- */
:root {
    --dv-sc-1: #2D2A2A;
    --dv-sc-1-tint: #F1F0F0;
    --dv-sc-2: #14A99A;
    --dv-sc-2-tint: #E0F6F3;
    --dv-sc-3: #E8930C;
    --dv-sc-3-tint: #FEF4E2;
    --dv-sc-4: #8B5CF6;
    --dv-sc-4-tint: #F1EBFE;
    --dv-stage-1: #D5EFE7;
    --dv-stage-2: #ABE0D0;
    --dv-stage-3: #7FCDB6;
    --dv-stage-4: #3ABB9C;
    --dv-stage-5: #0B9D80;
    --dv-stage-6: #088A70;
    --dv-stage-7: #066B57;
}

.dv-sc-1 { --dv-sc: var(--dv-sc-1); --dv-sc-tint: var(--dv-sc-1-tint); }
.dv-sc-2 { --dv-sc: var(--dv-sc-2); --dv-sc-tint: var(--dv-sc-2-tint); }
.dv-sc-3 { --dv-sc: var(--dv-sc-3); --dv-sc-tint: var(--dv-sc-3-tint); }
.dv-sc-4 { --dv-sc: var(--dv-sc-4); --dv-sc-tint: var(--dv-sc-4-tint); }
.dv-stage-1 { background: var(--dv-stage-1); }
.dv-stage-2 { background: var(--dv-stage-2); }
.dv-stage-3 { background: var(--dv-stage-3); }
.dv-stage-4 { background: var(--dv-stage-4); }
.dv-stage-5 { background: var(--dv-stage-5); }
.dv-stage-6 { background: var(--dv-stage-6); }
.dv-stage-7 { background: var(--dv-stage-7); }

/* Three tiles to a line from 992 pixels, two below, so a rand figure such as
   R 138 350 412 reads whole. On a phone the counts sit two to a line and
   each rand figure takes the whole line.
   Written to outrank the six tile rule of Snag 198. */
.dv-tiles.dv-dv-tiles:has(> :nth-child(6):last-child) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: var(--dv-space-3);
}

@media (max-width: 991.98px) {
    .dv-tiles.dv-dv-tiles:has(> :nth-child(6):last-child) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .dv-tiles.dv-dv-tiles:has(> :nth-child(6):last-child) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dv-tiles.dv-dv-tiles > :nth-child(5),
    .dv-tiles.dv-dv-tiles > :nth-child(6) {
        grid-column: 1 / -1;
    }
}

/* The contractors, one small card each, in its colour. */
.dv-dv-contractors {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: var(--dv-space-3);
}

a.dv-dv-contractor {
    display: flex;
    flex-direction: column;
    gap: var(--dv-space-2);
    padding: var(--dv-space-3);
    border: 1px solid var(--dv-card-line);
    border-top: 4px solid var(--dv-sc);
    border-radius: var(--dv-radius);
    background: linear-gradient(180deg, var(--dv-sc-tint) 0, var(--dv-surface) 72px);
    color: var(--dv-text);
    text-decoration: none;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

a.dv-dv-contractor:hover,
a.dv-dv-contractor:focus-visible {
    box-shadow: var(--dv-shadow-lg);
    transform: translateY(-1px);
    color: var(--dv-text);
}

a.dv-dv-contractor.is-off {
    opacity: 0.72;
}

.dv-dv-contractor-head {
    display: flex;
    align-items: center;
    gap: var(--dv-space-2);
}

.dv-dv-initials {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--dv-sc);
    color: var(--dv-surface);
    font-weight: 800;
    font-size: 0.85rem;
}

.dv-dv-contractor-name {
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 700;
    line-height: 1.25;
}

.dv-dv-facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px var(--dv-space-3);
    font-size: 0.8rem;
    color: var(--dv-text-muted);
}

.dv-dv-facts b {
    display: block;
    font-size: 0.95rem;
    color: var(--dv-text);
}

.dv-dv-lastused {
    font-size: 0.75rem;
    color: var(--dv-text-muted);
    border-top: 1px solid var(--dv-line-soft);
    padding-top: var(--dv-space-2);
}

/* Two charts side by side from 992 pixels, one under the other below. */
.dv-dv-charts {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0 var(--dv-space-3);
}

@media (min-width: 992px) {
    .dv-dv-charts {
        grid-template-columns: 1fr 1fr;
    }
}

.dv-dv-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 4px var(--dv-space-3);
    font-size: 0.78rem;
    color: var(--dv-text-muted);
    margin-bottom: var(--dv-space-3);
}

.dv-dv-legend > span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.dv-dv-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.dv-dv-swatch-track { background: var(--dv-tint-navy); border: 1px solid var(--dv-card-line); }
.dv-dv-swatch-fill { background: var(--dv-text-muted); }
.dv-dv-swatch-line { height: 3px; border-radius: 2px; background: var(--dv-sc); }

.dv-dv-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--dv-sc);
    margin-right: 6px;
    flex: 0 0 auto;
}

.dv-dv-bars {
    display: flex;
    flex-direction: column;
    gap: var(--dv-space-3);
}

.dv-dv-bar-label {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.dv-dv-bar-figure {
    margin-left: auto;
    padding-left: var(--dv-space-2);
    font-weight: 700;
    white-space: nowrap;
}

.dv-dv-bar-track {
    min-width: 6px;
    height: 14px;
    border-radius: 4px;
    background: var(--dv-sc-tint);
    border: 1px solid var(--dv-sc);
    overflow: hidden;
}

.dv-dv-bar-fill {
    height: 100%;
    background: var(--dv-sc);
}

.dv-dv-bar-note {
    font-size: 0.75rem;
    color: var(--dv-text-muted);
    margin-top: 3px;
}

.dv-dv-stack {
    display: flex;
    min-width: 6px;
    height: 16px;
    gap: 2px;
}

.dv-dv-stack > span {
    flex-basis: 0;
    min-width: 3px;
}

.dv-dv-stack > span:first-child { border-radius: 4px 0 0 4px; }
.dv-dv-stack > span:last-child { border-radius: 0 4px 4px 0; }
.dv-dv-stack > span:only-child { border-radius: 4px; }

/* The activity chart. */
svg.dv-dv-line {
    display: block;
    width: 100%;
    height: auto;
}

.dv-dv-grid { stroke: var(--dv-line-soft); stroke-width: 1; }
.dv-dv-axis { fill: var(--dv-text-muted); font-size: 11px; }
.dv-dv-series { fill: none; stroke: var(--dv-sc); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.dv-dv-end { fill: var(--dv-sc); stroke: var(--dv-surface); stroke-width: 2; }
.dv-dv-hit { fill: transparent; }
.dv-dv-hit:hover { fill: var(--dv-tint-blue); fill-opacity: 0.5; }

.dv-dv-note {
    font-size: 0.75rem;
    color: var(--dv-text-muted);
    margin: var(--dv-space-2) 0 0;
}

/* On a phone the activity chart is drawn at a third of its size, so its words and
   lines are drawn larger to read the same. */
@media (max-width: 575.98px) {
    .dv-dv-axis { font-size: 30px; }
    .dv-dv-series { stroke-width: 5; }
    .dv-dv-end { r: 10px; stroke-width: 4; }
}

/* The contracts table on the Daveng Administrator's page: a status badge
   keeps its tick and its word on one line. */
.table-wrapper .table.dv-dv-contracts .dv-badge {
    white-space: nowrap;
}

/* On a phone each contract is a short card: the contractor and the contract
   across it, then Client and Province, Status and Value, Job instructions and
   Certified, two to a line. */
@media (max-width: 767.98px) {
    .table-wrapper .dv-dv-contracts > tbody > tr {
        display: grid;
        grid-template-columns: 1fr 1fr;
        column-gap: var(--dv-space-3);
    }

    .table-wrapper .table.dv-dv-contracts > tbody > tr > td {
        width: auto;
        min-width: 0;
        padding: 3px 0;
        text-align: left;
    }

    .table-wrapper .table.dv-dv-contracts > tbody > tr > td:nth-child(1),
    .table-wrapper .table.dv-dv-contracts > tbody > tr > td:nth-child(2) {
        grid-column: 1 / -1;
    }
}

/* Snag 256, QA Ninja. A project's Resources tab: the key staff and the folded
   general workers are two tables with one set of column widths, set on the
   heading cells so Phone and Email can still step aside below 1200 pixels.
   The fold's button carries the certificate groups' arrow, turning when open. */
@media (min-width: 768px) {
    .table-wrapper table.dv-people-table {
        table-layout: fixed;
        width: 100%;
    }

    /* Name takes what is left, so it stays the widest column (Snag 256, second reopen). */
    .dv-people-table th.dv-pp-role { width: 22%; }
    .dv-people-table th.dv-pp-team { width: 10%; }
    .dv-people-table th.dv-pp-phone { width: 130px; }
    .dv-people-table th.dv-pp-email { width: 20%; }
    .dv-people-table th.dv-actions-col { width: 140px; }

    .dv-people-table td.dv-nowrap {
        white-space: normal;
        overflow-wrap: anywhere;
    }
}

.dv-labour-fold > .dv-fold-toggle {
    position: relative;
    padding-left: 28px;
}

.dv-labour-fold > .dv-fold-toggle::before {
    content: "";
    position: absolute;
    left: 11px;
    top: 50%;
    width: 7px;
    height: 7px;
    margin-top: -5px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    transition: transform 0.15s;
}

.dv-labour-fold > .dv-fold-toggle[aria-expanded="true"]::before {
    transform: rotate(45deg);
}

/* Snag 259, QA Ninja. A certificate's work line names its road stretch, small
   and muted under the description. */
.dv-cw-stretch {
    font-size: 0.8em;
    margin-top: 2px;
    overflow-wrap: anywhere;
}

/* Snag 260, QA Ninja. A long job instruction's stretches fold under one line
   each, in the look of a certificate's work groups. */
details.dv-stretch-fold {
    margin-top: var(--dv-space-2);
}

details.dv-stretch-fold[open] > .table-wrapper {
    margin-bottom: 0;
}

/* Snag 260 reopened. On a phone the fold line keeps its count and value on one
   line, where a certificate's group puts them on its second. */
@media (max-width: 575.98px) {
    details.dv-stretch-fold > summary.dv-cert-group-head > .dv-count-pill { grid-column: 1; grid-row: 1; align-self: center; }
    details.dv-stretch-fold > summary.dv-cert-group-head > .dv-cert-group-total { grid-column: 2; grid-row: 1; justify-self: end; }
}

/* ===========================================================================
   Sprint 11, Task 11.2. The capture window, bigger and clearer. modal-xl from
   1200 pixels; full width less a margin from 768 to 1199, so a tablet held
   sideways uses the whole width; full screen on a phone (modal-fullscreen-md-down).
   =========================================================================== */
@media (min-width: 768px) and (max-width: 1199.98px) {
    .modal-dialog.dv-cap-dialog {
        max-width: calc(100% - 2rem);
        margin-left: auto;
        margin-right: auto;
    }
}

/* The item's context: the instruction, the stretch, the item, and three figures side by side. */
.dv-cap-context {
    padding: var(--dv-space-3);
    border: 1px solid var(--dv-card-line);
    border-radius: 10px;
    background: var(--dv-tint-blue);
}

.dv-cap-context-title {
    font-weight: 700;
    color: var(--dv-navy);
}

.dv-cap-context-item {
    margin-top: 2px;
    overflow-wrap: anywhere;
}

.dv-cap-figures {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--dv-space-2);
    margin-top: var(--dv-space-2);
}

.dv-cap-figure {
    display: flex;
    flex-direction: column;
    padding: 6px var(--dv-space-2);
    border-radius: 8px;
    background: #FFFFFF;
    border: 1px solid var(--dv-line-soft);
}

.dv-cap-figure-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--dv-text-muted, #6B6B6B);
}

.dv-cap-figure-value {
    font-weight: 700;
    color: var(--dv-navy);
    overflow-wrap: anywhere;
}

/* Over the instructed quantity. */
.dv-over-warning {
    padding: 6px var(--dv-space-2);
    border-radius: 8px;
    background: var(--dv-tint-amber);
    color: #8A5300;
    font-weight: 600;
}

.dv-over-warning:empty {
    display: none;
}

.dv-badge.dv-badge-over {
    margin-left: 4px;
    background: var(--dv-tint-amber);
    color: #8A5300;
}

.dv-over-reason {
    font-size: 0.8rem;
    text-align: left;
}

/* Every way into the capture window is the same bright button. */
.btn.dv-capture-btn {
    background: var(--dv-tint-blue);
    border: 1px solid var(--dv-blue-bright);
    color: var(--dv-blue-deep);
    font-weight: 600;
}

.btn.dv-capture-btn:hover,
.btn.dv-capture-btn:focus-visible {
    background: var(--dv-blue-bright);
    border-color: var(--dv-blue-bright);
    color: #FFFFFF;
}

/* A day in the week: Captured is green with a tick, Not captured is red, Planned is plain. */
.dv-week-mark {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.55);
}

.dv-week-btn.is-missed .dv-week-mark {
    width: 16px;
    height: 16px;
    border-color: #FFFFFF;
    background: var(--dv-danger);
}

.dv-week-btn.is-missed {
    box-shadow: inset 0 0 0 2px var(--dv-danger);
}

.dv-week-btn.is-captured .dv-week-qty {
    background: var(--dv-tint-green);
    color: var(--dv-green-deep);
}

.dv-week-btn.is-captured .dv-week-qty::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 3px;
    vertical-align: -1px;
    border-radius: 50%;
    background: #2F9E58 url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3e%3cpath d='M3.2 6.2l1.8 1.8L8.8 4.2' fill='none' stroke='%23fff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e") center / 10px 10px no-repeat;
}

.dv-week-btn.is-captured .dv-week-mark {
    background: #2F9E58;
}

.dv-week-btn.is-planned {
    cursor: default;
}

.dv-week-btn.is-planned:hover {
    box-shadow: none;
}

@media (max-width: 767.98px) {
    .btn.dv-capture-btn {
        min-height: 38px;
    }

    .dv-cap-figures {
        gap: 6px;
    }
}

/* Snag 262. An instruction's word (Task Order, Service Instruction, Instruction)
   beside its title in the app bar, in the subtitle's blue, at every width. */
.dv-badge.dv-badge-word {
    background: var(--dv-tint-blue);
    color: var(--dv-blue-deep);
}

/* ===========================================================================
   Sprint 11, Task 11.3. The signed in person at the top of the side menu, under
   the brand and above Projects. Its menu opens downward. Folded, the photo or
   initials stay at the top.
   =========================================================================== */
.dv-sidebar-person {
    flex-shrink: 0;
    padding: 0 10px var(--dv-space-2);
}

.dv-sidebar-person .dv-sidebar-user {
    border-top: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--dv-radius-sm);
}

.dv-sidebar-person .dv-foot-menu {
    margin-top: var(--dv-space-1) !important;
    margin-bottom: 0 !important;
    max-height: calc(100vh - 150px);
}

.dv-shell.dv-rail .dv-sidebar-person {
    padding-left: var(--dv-space-2);
    padding-right: var(--dv-space-2);
}

@media (max-width: 991.98px) {
    .dv-shell.dv-rail .dv-sidebar-person {
        padding-left: 10px;
        padding-right: 10px;
    }
}

/* Task 11.3. A project's name zooms the map; the arrow beside it opens the project. */
.dv-overview-row {
    display: flex;
    align-items: stretch;
    gap: var(--dv-space-1);
}

.dv-overview-row > .dv-overview-item {
    flex: 1 1 auto;
    min-width: 0;
}

button.dv-overview-item {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

button.dv-overview-item:hover,
button.dv-overview-item:focus-visible {
    color: var(--dv-blue);
}

.dv-overview-open {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 38px;
    border-radius: var(--dv-radius-sm);
    color: var(--dv-blue);
}

.dv-overview-open:hover,
.dv-overview-open:focus-visible {
    background: var(--dv-tint-blue);
}

.dv-overview-open svg {
    width: 18px;
    height: 18px;
}

/* A pin's box: the project, then Open project and Directions. */
.dv-map-pop {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 170px;
    font-family: var(--dv-font-body, inherit);
}

.dv-map-pop-links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--dv-space-3);
    margin-top: var(--dv-space-1);
}

.dv-map-pop-links a {
    font-weight: 600;
    color: var(--dv-blue);
}

.dv-map-nopin {
    color: var(--dv-text-muted);
}

/* ===========================================================================
   Sprint 11, Task 11.4. The price list in Parts and Sections: a section row
   over its items, a total row per section and for the Part, the Summary's
   Part totals. The two way switch Items and Summary uses links.
   =========================================================================== */
.dv-seg a {
    padding: 5px 14px;
    border-radius: var(--dv-radius-pill);
    color: var(--dv-navy);
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
}

.dv-seg a.active {
    background: var(--dv-navy);
    color: var(--dv-surface);
}

.table-wrapper .table tr.dv-pl-section > td {
    background: var(--dv-tint-blue);
    color: var(--dv-blue-deep);
    font-weight: 700;
}

.table-wrapper .table tr.dv-pl-total > td {
    font-weight: 700;
    border-top: 1px solid var(--dv-card-line);
}

.table-wrapper .table tr.dv-pl-grand > td {
    background: var(--dv-canvas);
    color: var(--dv-navy);
}

.dv-pl-desc {
    overflow-wrap: anywhere;
}

/* On a phone each item is a short card: item and description, then unit, rate,
   quantity and amount on one line. Section and total rows stay one line. */
@media (max-width: 767.98px) {
    .table-wrapper .dv-pl-items > thead,
    .table-wrapper .dv-pl-summary > thead {
        display: none;
    }

    .table-wrapper .dv-pl-items > tbody > tr.dv-pl-item {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        column-gap: var(--dv-space-2);
        padding: var(--dv-space-2) 0;
    }

    .table-wrapper .dv-pl-items > tbody > tr.dv-pl-item > td {
        padding: 1px 0;
        border: 0;
        text-align: left;
    }

    .table-wrapper .dv-pl-items > tbody > tr.dv-pl-item > td:nth-child(1) {
        grid-column: 1 / -1;
    }

    .table-wrapper .dv-pl-items > tbody > tr.dv-pl-item > td:nth-child(2) {
        grid-column: 1 / -1;
        order: 0;
    }

    .table-wrapper .dv-pl-items > tbody > tr.dv-pl-item > td:nth-child(n+3):not(:last-child)::before,
    .table-wrapper .dv-pl-summary > tbody > tr:not(.dv-pl-total) > td::before {
        content: attr(data-label);
        display: block;
        font-size: 0.68rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--dv-text-muted);
    }

    .table-wrapper .dv-pl-items > tbody > tr.dv-pl-item > td.dv-pl-actions {
        grid-column: 1 / -1;
    }

    .table-wrapper .dv-pl-summary > tbody > tr:not(.dv-pl-total) {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        column-gap: var(--dv-space-2);
        padding: var(--dv-space-2) 0;
    }

    .table-wrapper .dv-pl-summary > tbody > tr:not(.dv-pl-total) > td {
        border: 0;
        padding: 1px 0;
        text-align: left;
    }

    .table-wrapper .dv-pl-summary > tbody > tr:not(.dv-pl-total) > td:nth-child(1),
    .table-wrapper .dv-pl-summary > tbody > tr:not(.dv-pl-total) > td:nth-child(2) {
        grid-column: 1 / -1;
    }
}

/* Snag 266. On a phone or tablet the menu is a drawer, always shown open, so
   Field mode keeps its words beside the switch even when the menu is folded. */
@media (max-width: 991.98px) {
    .dv-shell.dv-rail .dv-field-toggle {
        justify-content: flex-start;
    }

    .dv-shell.dv-rail .dv-field-toggle span {
        display: inline;
    }
}

/* ===========================================================================
   Sprint 11, Task 11.5. The payment certificate, as RADAR's: the top with the
   period and the steps, the document cards, a document's head with its tools,
   the Price List's lines with typed boxes, the Summary and the FMSS.
   =========================================================================== */
.dv-cert-top-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--dv-space-3);
}

.dv-cert-top-period {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px var(--dv-space-3);
}

.dv-cert-top-steps {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--dv-space-2);
}

.dv-cert-certify {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--dv-space-2);
}

.dv-cert-certify .form-control {
    width: auto;
    min-width: 150px;
}

.dv-doc-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--dv-space-3);
}

.dv-doc-card {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--dv-space-3) var(--dv-space-4);
    border: 1px solid var(--dv-card-line);
    border-radius: 10px;
    background: var(--dv-surface);
    color: var(--dv-text);
    text-decoration: none;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.dv-doc-card:hover,
.dv-doc-card:focus-visible {
    border-color: var(--dv-blue-bright);
    box-shadow: var(--dv-shadow-lg);
}

.dv-doc-card-number {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--dv-blue);
}

.dv-doc-card-name {
    font-weight: 700;
    color: var(--dv-navy);
    font-size: 1.02rem;
}

.dv-doc-card-line {
    font-size: 0.82rem;
    color: var(--dv-text-muted);
}

.dv-cert-back {
    margin: 0 0 var(--dv-space-2);
}

.dv-cert-doc-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--dv-space-3);
    margin-bottom: var(--dv-space-2);
}

.dv-cert-doc-name {
    font-family: var(--dv-font-head);
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--dv-navy);
}

.dv-cert-doc-tools {
    display: flex;
    align-items: center;
    gap: var(--dv-space-2);
}

/* Claimed only, a switch that is a link. */
.dv-switch-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--dv-navy);
    text-decoration: none;
    margin-right: var(--dv-space-2);
}

.dv-switch-track {
    position: relative;
    width: 34px;
    height: 20px;
    border-radius: 999px;
    background: var(--dv-line-soft);
    border: 1px solid var(--dv-card-line);
}

.dv-switch-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #FFFFFF;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.dv-switch-link.is-on .dv-switch-track {
    background: var(--dv-blue);
    border-color: var(--dv-blue);
}

.dv-switch-link.is-on .dv-switch-track::after {
    left: 16px;
}

.dv-cert-lines .dv-cert-desc {
    min-width: 130px;
    overflow-wrap: anywhere;
}

.dv-cert-lines tr.dv-cert-line.dv-clickable {
    cursor: pointer;
}

.dv-cert-lines tr.dv-cert-line.dv-clickable:hover > td {
    background: var(--dv-tint-blue);
}

.dv-cert-qty {
    width: 100px;
    margin-left: auto;
    text-align: right;
}

.dv-cert-amount {
    width: 150px;
    margin-left: auto;
    text-align: right;
}

.dv-cert-hint {
    font-size: 0.72rem;
    text-align: right;
    white-space: normal;
}

.dv-cert-summary tr.dv-cert-sum-section > td:first-child {
    padding-left: var(--dv-space-5, 24px);
}

.dv-cert-fmss tr.dv-cert-fmss-section > td {
    font-weight: 600;
    color: var(--dv-navy);
}

/* On a phone a line is a short card: item and description, then the figures two to a line. */
@media (max-width: 767.98px) {
    .table-wrapper .dv-cert-lines > thead,
    .table-wrapper .dv-cert-fmss > thead,
    .table-wrapper .dv-cert-summary > thead {
        display: none;
    }

    .table-wrapper .dv-cert-lines > tbody > tr.dv-cert-line,
    .table-wrapper .dv-cert-fmss > tbody > tr:not(.dv-pl-section):not(.dv-pl-total):not(.dv-cert-fmss-section) {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: var(--dv-space-3);
        padding: var(--dv-space-2) 0;
    }

    .table-wrapper .dv-cert-lines > tbody > tr.dv-cert-line > td,
    .table-wrapper .dv-cert-fmss > tbody > tr > td {
        border: 0;
        padding: 1px 0;
        text-align: left;
    }

    .table-wrapper .dv-cert-lines > tbody > tr.dv-cert-line > td:nth-child(-n+2),
    .table-wrapper .dv-cert-fmss > tbody > tr > td:nth-child(-n+2) {
        grid-column: 1 / -1;
    }

    .table-wrapper .dv-cert-lines > tbody > tr.dv-cert-line > td:nth-child(n+3)::before,
    .table-wrapper .dv-cert-fmss > tbody > tr > td:nth-child(n+3)[data-label]:not([data-label=""])::before,
    .table-wrapper .dv-cert-summary > tbody > tr > td:nth-child(n+2)::before {
        content: attr(data-label);
        display: block;
        font-size: 0.66rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--dv-text-muted);
    }

    .dv-cert-qty,
    .dv-cert-amount {
        width: 100%;
        margin-left: 0;
        text-align: left;
    }

    .table-wrapper .dv-cert-summary > tbody > tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: var(--dv-space-3);
        padding: var(--dv-space-2) 0;
    }

    .table-wrapper .dv-cert-summary > tbody > tr > td {
        border: 0;
        padding: 1px 0;
        text-align: left;
    }

    .table-wrapper .dv-cert-summary > tbody > tr > td:first-child {
        grid-column: 1 / -1;
    }

    .dv-cert-doc-tools {
        flex-wrap: wrap;
    }
}

/* Task 11.5. On a phone each certificate line is a card with room for every figure,
   so the columns a tablet leaves out come back. */
@media (max-width: 767.98px) {
    .table-wrapper .dv-cert-lines > tbody > tr.dv-cert-line > td.dv-col-tablet-hide,
    .table-wrapper .dv-cert-lines > tbody > tr.dv-cert-line > td.dv-col-hide {
        display: block;
    }
}

/* Task 11.5. The certificate's long headings wrap, so the table fits its box at 1024. */
.table-wrapper .dv-cert-lines > thead > tr > th {
    white-space: normal;
    vertical-align: bottom;
}

/* Snag 267. On a phone a Summary total is a card like the rows above it, its
   figures under their own labels. Snag 268. An item card keeps Edit and Remove
   together on one line, inside the card's padding. */
@media (max-width: 767.98px) {
    .table-wrapper .dv-pl-summary > tbody > tr.dv-pl-total {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        column-gap: var(--dv-space-2);
        padding: var(--dv-space-2) 0;
    }

    .table-wrapper .dv-pl-summary > tbody > tr.dv-pl-total > td {
        border: 0;
        padding: 1px 0;
        text-align: left;
    }

    .table-wrapper .dv-pl-summary > tbody > tr.dv-pl-total > td:first-child {
        grid-column: 1 / -1;
    }

    .table-wrapper .dv-pl-summary > tbody > tr.dv-pl-total > td:not(:first-child)::before {
        content: attr(data-label);
        display: block;
        font-size: 0.68rem;
        font-weight: 400;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--dv-text-muted);
    }

    .table-wrapper .dv-pl-items > tbody > tr.dv-pl-item {
        padding: var(--dv-space-2) var(--dv-space-3);
    }

    .table-wrapper .dv-pl-items > tbody > tr.dv-pl-item > td.dv-pl-actions {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        gap: 6px;
        padding-top: var(--dv-space-1);
    }

    .table-wrapper .dv-pl-items > tbody > tr.dv-pl-item > td.dv-pl-actions form {
        display: inline-flex;
        margin: 0;
    }
}

/* ===========================================================================
   Sprint 11, Task 11.6. Charts drawn on the server (Data/Charts.cs, copied
   from RADAR) and the certificate's Insights, in this app's blues. The report
   palette and the heat ramp are for Task 11.15's Reports.
   =========================================================================== */
:root {
    --dv-insight-now:   #088A70;
    --dv-insight-past:  #A9B4C4;
    --dv-rpt-1:         #088A70;
    --dv-rpt-2:         #2F9E58;
    --dv-rpt-3:         #E8930C;
    --dv-rpt-4:         #6250D6;
    --dv-rpt-5:         #D9534F;
    --dv-rpt-other:     #A2A4A8;
    --dv-heat-0:        #EEF7F4;
    --dv-heat-1:        #BFE6DA;
    --dv-heat-2:        #7FCDB6;
    --dv-heat-3:        #3ABB9C;
    --dv-heat-4:        #088A70;
    --dv-heat-5:        #066B57;
}

.dv-chart {
    display: block;
    max-width: 100%;
    max-height: 280px;
    margin-inline: auto;
}

.dv-chart.dv-chart-rows {
    max-height: none;
    max-width: min(100%, 720px);
}

.dv-chart-label {
    font-size: 13px;
    fill: var(--dv-text-muted);
}

.dv-chart-value {
    font-size: 13px;
    font-weight: 700;
    fill: var(--dv-text);
}

.dv-chart-value-sm {
    font-size: 11px;
}

.dv-chart-tick {
    font-size: 11px;
    fill: var(--dv-text-muted);
}

.dv-chart-axis {
    stroke: var(--dv-card-line);
    stroke-width: 1;
}

.dv-chart-grid {
    stroke: var(--dv-line-soft);
    stroke-width: 1;
    stroke-dasharray: 3 4;
}

.dv-chart-centre-value {
    font-family: var(--dv-font-head);
    font-size: 26px;
    font-weight: 800;
    fill: var(--dv-navy);
}

.dv-chart-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 140px;
    padding: var(--dv-space-4);
    border: 1px dashed var(--dv-card-line);
    border-radius: var(--dv-radius-sm);
    background: var(--dv-canvas);
    color: var(--dv-text-muted);
    font-size: 0.85rem;
}

.dv-chart-figure {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    margin: 0;
    min-width: 0;
}

.dv-chart-figure > .dv-chart {
    flex: 0 0 auto;
    margin-block: auto;
}

.dv-chart-note {
    margin: var(--dv-space-3) 0 0;
    padding-top: var(--dv-space-3);
    border-top: 1px solid var(--dv-line-soft);
    font-size: 0.78rem;
    line-height: 1.45;
    color: var(--dv-text-muted);
}

.dv-chart-figure > .dv-chart-note {
    margin-top: auto;
}

.dv-chart-narrow {
    display: none;
}

.dv-chart-wide {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
}

@media (max-width: 575.98px) {
    .dv-chart-wide {
        display: none;
    }

    .dv-chart-narrow {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        min-width: 0;
    }
}

.dv-chart .dv-chart-dot {
    cursor: default;
}

.dv-chart .dv-heat-cell:hover,
.dv-chart .dv-chart-seg:hover {
    stroke: var(--dv-text);
    stroke-width: 1.5;
}

.dv-legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--dv-space-2) var(--dv-space-3);
    margin-top: var(--dv-space-3);
    font-size: 0.78rem;
    color: var(--dv-text-muted);
}

.dv-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dv-legend-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dv-legend-label,
.dv-legend-share {
    color: var(--dv-text-muted);
}

.dv-legend-value {
    font-weight: 700;
    color: var(--dv-navy);
}

.dv-slice-opens {
    cursor: pointer;
}

.dv-slice-opens:hover,
.dv-slice-opens:focus-visible {
    opacity: 0.8;
    outline: none;
}

.dv-legend-item.dv-legend-opens {
    cursor: pointer;
    border-radius: var(--dv-radius-sm);
}

.dv-legend-item.dv-legend-opens:hover,
.dv-legend-item.dv-legend-opens:focus-visible {
    background: var(--dv-tint-blue);
    outline: none;
}

.dv-legend-item.dv-legend-opens .dv-legend-label {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.dv-heat-key {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 3px;
    font-size: 0.75rem;
    color: var(--dv-text-muted);
    margin-top: var(--dv-space-2);
}

.dv-heat-swatch {
    width: 16px;
    height: 12px;
    border-radius: 2px;
}

/* The certificate's Insights: four figures, then the graphs two to a row. */
.dv-insights-figures {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--dv-space-3);
    margin-bottom: var(--dv-space-4);
}

.dv-insight-figure {
    border-left: 4px solid var(--dv-insight-now);
    padding: 0.35rem 0 0.35rem 0.75rem;
    min-width: 0;
}

.dv-insight-value {
    font-family: var(--dv-font-head);
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--dv-navy);
    overflow-wrap: anywhere;
}

.dv-insight-label {
    font-size: 0.8rem;
    color: var(--dv-text-muted);
}

.dv-insights-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--dv-space-4) var(--dv-space-5, 24px);
}

.dv-insight-chart {
    min-width: 0;
}

.dv-insight-title {
    font-size: 0.9rem;
    font-weight: 700;
    margin: 0 0 var(--dv-space-2);
    color: var(--dv-navy);
}

.dv-insight-note {
    font-size: 0.8rem;
    color: var(--dv-text-muted);
    margin: var(--dv-space-3) 0 0;
}

.dv-insight-items {
    list-style: none;
    margin: var(--dv-space-2) 0 0;
    padding: 0;
    font-size: 0.8rem;
    color: var(--dv-text-muted);
}

.dv-insight-items li + li {
    margin-top: 2px;
}

@media (max-width: 991.98px) {
    .dv-insights-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .dv-insights-figures {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Snag 269. On a phone a certificate's section and Part totals are short cards, each
   figure under its own label, as the lines above them. */
@media (max-width: 767.98px) {
    .table-wrapper .dv-cert-lines > tbody > tr.dv-pl-total {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .table-wrapper .dv-cert-lines > tbody > tr.dv-pl-total > td {
        border: 0;
        padding: 2px var(--dv-space-3) 2px 0;
        text-align: left;
    }

    .table-wrapper .dv-cert-lines > tbody > tr.dv-pl-total > td:first-child {
        grid-column: 1 / -1;
    }

    .table-wrapper .dv-cert-lines > tbody > tr.dv-pl-total > td[data-label]:not([data-label=""])::before {
        content: attr(data-label);
        display: block;
        font-size: 0.66rem;
        font-weight: 400;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--dv-text-muted);
    }
}

/* ---------------------------------------------------------------------------
   Task 11.8. The person's own dot on every map, with Where I am at the bottom
   right; a landing page's People pins (the photo or initials, then the name
   and the time); Projects, People and Both above the map; and the Where am I
   window, which fills the screen on a phone.
   --------------------------------------------------------------------------- */
.dv-map path.dv-map-me {
    fill: var(--dv-blue);
    stroke: #fff;
}

.dv-map path.dv-map-me-ring {
    fill: var(--dv-blue);
    fill-opacity: 0.12;
    stroke: var(--dv-blue);
    stroke-opacity: 0.4;
}

.dv-map-whereiam button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 6px 12px;
    border: 0;
    border-radius: var(--dv-radius-pill);
    background: var(--dv-surface);
    color: var(--dv-navy);
    font-size: 0.8125rem;
    font-weight: 600;
    box-shadow: var(--dv-shadow-hover);
    cursor: pointer;
}

.dv-map-whereiam button svg {
    width: 15px;
    height: 15px;
}

.dv-map-whereiam button[hidden] {
    display: none;
}

.dv-map-show {
    margin-bottom: var(--dv-space-2);
}

.dv-map-person-wrap {
    background: transparent;
    border: 0;
}

.dv-map-person {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px 2px 2px;
    border-radius: var(--dv-radius-pill);
    background: var(--dv-surface);
    box-shadow: var(--dv-shadow-hover);
    white-space: nowrap;
}

.dv-map-face {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    overflow: hidden;
    border-radius: 50%;
    background: var(--dv-navy);
    color: var(--dv-surface);
    font-size: 0.75rem;
    font-weight: 700;
}

.dv-map-face img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dv-map-person.is-many .dv-map-face {
    background: var(--dv-blue);
}

.dv-map-person-label {
    color: var(--dv-navy);
    font-size: 0.75rem;
    font-weight: 600;
}

.dv-map-people-pop .dv-map-pop-person + .dv-map-pop-person {
    margin-top: var(--dv-space-2);
    padding-top: var(--dv-space-2);
    border-top: 1px solid var(--dv-card-line);
}

.dv-map-pop-person {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dv-map-people-count {
    font-size: 0.8125rem;
}

.dv-where-map {
    height: 320px;
    border-radius: var(--dv-radius-sm);
}

.dv-where-line {
    margin: var(--dv-space-2) 0 var(--dv-space-3);
    font-weight: 600;
    color: var(--dv-navy);
}

.dv-where-near-title {
    margin-bottom: 4px;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--dv-navy);
}

.dv-where-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.dv-where-item {
    display: flex;
    align-items: center;
    gap: var(--dv-space-2);
    min-height: 44px;
    padding: 4px 0;
    border-bottom: 1px solid var(--dv-card-line);
}

.dv-where-name {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--dv-navy);
    text-align: left;
    overflow-wrap: anywhere;
}

button.dv-where-name {
    cursor: pointer;
}

button.dv-where-name:hover {
    text-decoration: underline;
}

.dv-where-km {
    flex: 0 0 auto;
    color: var(--dv-text-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

@media (max-width: 767.98px) {
    .dv-where-map {
        height: 42vh;
    }
}

/* ---------------------------------------------------------------------------
   Task 11.11. The subcontractor form's sections inside the form card, the four
   ownership boxes in a row, and each ticked project's four fields under it.
   --------------------------------------------------------------------------- */
.dv-form-section {
    margin-top: var(--dv-space-4);
    padding-top: var(--dv-space-4);
    border-top: 1px solid var(--dv-card-line);
}

.dv-form-section > .dv-card-heading {
    margin-bottom: var(--dv-space-3);
}

.dv-ownership-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--dv-space-2);
}

.dv-subproject {
    padding: var(--dv-space-2) 0;
    border-bottom: 1px solid var(--dv-card-line);
}

.dv-subproject-fields {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--dv-space-2);
    margin: var(--dv-space-2) 0 var(--dv-space-1) 1.5rem;
}

.dv-subproject-fields[hidden] {
    display: none;
}

@media (max-width: 767.98px) {
    .dv-ownership-grid,
    .dv-subproject-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dv-subproject-fields {
        margin-left: 0;
    }
}

/* Snag 279. The Instructions table's title link wraps, so the longest title no
   longer sets the column and the table fits its box on an upright tablet, with
   Open and Edit in view. Snag 280: each stage badge stays on one line in its pill,
   a second badge going under it. */
.table-wrapper .dv-pg-jobcards > tbody > tr > td:first-child .table-action-link {
    display: inline;
    white-space: normal;
}

.table-wrapper .dv-pg-jobcards .dv-badge {
    white-space: nowrap;
}

/* Snag 281. When a toolbar's buttons drop to a second line they stay on the right,
   as every list keeps them, so the primary Add is never left in the middle. */
.dv-toolbar > .dv-toolbar-group:last-child:not(:first-child) {
    margin-left: auto;
    justify-content: flex-end;
}

/* Snag 282. On a phone the Part tabs of a price list and of a certificate's Price
   List scroll on one line, as a record's own tabs do, with the same fade. Snag 333:
   on an upright tablet too, so FMSS never drops to a line of its own. */
@media (max-width: 991.98px) {
    .dv-part-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        scroll-snap-type: x proximity;
    }

    .dv-part-tabs::-webkit-scrollbar {
        display: none;
    }

    .dv-part-tabs .dv-tab {
        flex: 0 0 auto;
        white-space: nowrap;
        scroll-snap-align: start;
    }
}

/* Snag 283. On a phone a certificate's line cards and FMSS rows are set in from
   the box's edge, as the section rows and totals around them are. */
@media (max-width: 767.98px) {
    .table-wrapper .dv-cert-lines > tbody > tr.dv-cert-line,
    .table-wrapper .dv-cert-fmss > tbody > tr:not(.dv-pl-section):not(.dv-pl-total):not(.dv-cert-fmss-section) {
        padding-left: var(--dv-space-3);
        padding-right: var(--dv-space-3);
    }
}

/* Snag 286. In Insights a donut's key is one line per slice: the name takes the room
   and wraps, the amount and share stay whole at the end. */
.dv-pay-insights .dv-legend {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 4px;
}

.dv-pay-insights .dv-legend-item {
    width: 100%;
}

.dv-pay-insights .dv-legend-label {
    flex: 1 1 auto;
    min-width: 0;
}

.dv-legend-value,
.dv-legend-share {
    white-space: nowrap;
}

/* Snag 289. The eight count tiles sit four and four from 1024 pixels up, so their rows
   end evenly under the category tiles at any width. */
@media (min-width: 1024px) {
    .dv-tiles.dv-count-tiles {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Snag 290. General Definitions' List dropdown is as wide as its longest list name,
   so no choice runs under the arrow (Keep in Mind, 18 November 2026). */
#keyID.dv-filter-select {
    width: auto;
    max-width: 100%;
    min-width: 16rem;
}

/* Snag 295. The people's rows close with a line, as they open with one, so the link
   down to Labour leaves a line and not the empty space under a short last row. */
@media (min-width: 768px) {
    .dv-org-level.dv-org-level-joined {
        padding-bottom: var(--dv-space-3);
        border-bottom: 2px solid var(--dv-blue-light);
    }
}

/* Snag 301. A subcontractor's project ticks sit in the same rounded box as a person's
   and a team's; a ticked one's four fields open under it, two to a line. */
.dv-project-ticks .dv-subproject {
    padding: 2px 0;
    border-bottom: 0;
}

.dv-project-ticks .dv-subproject-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: var(--dv-space-1) 0 var(--dv-space-2) 1.5rem;
}

/* Snag 302. On a phone a person on a project's Resources tab is a short card: the name
   with the photo on top, Role and Team side by side, Phone and Email side by side, then
   Open and Remove. */
@media (max-width: 767.98px) {
    .table-wrapper .dv-people-table > tbody > tr,
    .table-wrapper .dv-res-cards > tbody > tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: var(--dv-space-3);
        padding: var(--dv-space-2) var(--dv-space-3);
        border-bottom: 1px solid var(--dv-card-line);
    }

    .table-wrapper .dv-people-table > tbody > tr > td,
    .table-wrapper .dv-res-cards > tbody > tr > td {
        border: 0;
        padding: 2px 0;
    }

    .table-wrapper .dv-people-table > tbody > tr > td:first-child,
    .table-wrapper .dv-people-table > tbody > tr > td:last-child,
    .table-wrapper .dv-res-cards > tbody > tr > td:first-child,
    .table-wrapper .dv-res-cards > tbody > tr > td:last-child:has(.table-action-link) {
        grid-column: 1 / -1;
    }

    /* Snag 306. No ruled line between the facts of an instruction's team, person or
       plant item, whatever card the table sits in. */
    .dv-card .table-wrapper .table.dv-res-cards > tbody > tr > td {
        border: 0;
        padding: 2px 0;
    }

    /* Snag 302, again. Email takes the card's whole width, so an address breaks only
       when it is longer than the card; Phone sits on its own line above it. */
    .table-wrapper .dv-people-table > tbody > tr > td:nth-child(5) {
        grid-column: 1 / -1;
    }
}

/* Snag 312. Upload in the Supporting documents table is a link in the app's blue,
   though it is the first link in its cell. */
.table td a.table-action-link.dv-upload-link {
    color: var(--dv-blue);
}

/* Task 11.12. A supplier's or subcontractor's logo in the initials circle: the whole logo
   on white, with a thin line round it, never cropped to the circle's edge. */
.dv-initials-photo.dv-initials-logo {
    background: #FFFFFF;
    border: 1px solid var(--dv-card-line);
}

.dv-initials-photo.dv-initials-logo img {
    object-fit: contain;
    border-radius: 0;
    padding: 12%;
}

/* Task 11.12. Dewlann's supplier card: the figures side by side under the facts, each
   value large over its name, with a thin line between them. */
.dv-list-card-figures {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    margin: 0 12px 12px;
    background: var(--dv-surface-soft, #F6F6F6);
    border-radius: 8px;
}

.dv-list-card-figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 8px 6px;
    min-width: 0;
}

.dv-list-card-figure + .dv-list-card-figure {
    border-left: 1px solid var(--dv-card-line);
}

.dv-list-card-figure-value {
    font-weight: 700;
    font-size: 1rem;
    color: var(--dv-navy);
    white-space: nowrap;
}

.dv-list-card-figure-label {
    font-size: 0.75rem;
    color: var(--dv-text-muted);
}

/* Task 11.12. A supplier's page: the head with the logo, the name and badges, the
   contact line, and the project choice on the right. */
.dv-supplier-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--dv-space-3);
    margin-bottom: var(--dv-space-4);
}

.dv-supplier-head-main {
    display: flex;
    align-items: center;
    gap: var(--dv-space-3);
    min-width: 0;
    flex: 1 1 420px;
}

.dv-supplier-head-titles {
    min-width: 0;
}

.dv-supplier-head-name {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dv-navy);
}

.dv-supplier-head-sub {
    color: var(--dv-text-muted);
    margin-top: 2px;
}

.dv-supplier-head-contact {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 18px;
    margin-top: 6px;
    font-size: 0.875rem;
}

.dv-supplier-head-contact > span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    overflow-wrap: anywhere;
}

.dv-supplier-head-contact svg {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    color: var(--dv-text-muted);
}

.dv-supplier-head-project {
    flex: 0 1 260px;
    min-width: 200px;
}

.dv-supplier-tiles {
    margin-bottom: var(--dv-space-4);
}

/* The Overview: Recent activity beside the balance graph, then three short tables. */
.dv-supplier-overview {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--dv-space-4);
    margin-bottom: var(--dv-space-4);
}

.dv-supplier-short {
    display: grid;
    /* Snag 319. Each short table only as narrow as its amounts allow: two to a row, then one. */
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: var(--dv-space-4);
}

.dv-supplier-mini .dv-badge {
    white-space: nowrap;
}

.dv-supplier-mini td.text-end {
    white-space: nowrap;
}

.dv-supplier-overview > .dv-card,
.dv-supplier-short > .dv-card {
    margin-bottom: 0;
    min-width: 0;
}

.dv-activity-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dv-activity-list > li + li {
    border-top: 1px solid var(--dv-line-soft);
}

.dv-activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 2px;
    color: inherit;
    text-decoration: none;
}

.dv-activity-item:hover,
.dv-activity-item:focus-visible {
    background: var(--dv-row-hover, #EEF8F5);
}

.dv-activity-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1 1 auto;
}

.dv-activity-title {
    font-weight: 600;
    color: var(--dv-navy);
}

.dv-activity-detail {
    font-size: 0.8125rem;
    color: var(--dv-text-muted);
    overflow-wrap: anywhere;
}

.dv-activity-date {
    font-size: 0.8125rem;
    color: var(--dv-text-muted);
    white-space: nowrap;
}

.dv-supplier-details .dv-row-value {
    overflow-wrap: anywhere;
}

/* Task 11.12. Material Management: what is on order under the material's name. */
.dv-on-order {
    display: block;
    font-size: 0.8125rem;
    margin-top: 2px;
    margin-left: 34px;
}

@media (max-width: 1199.98px) {
    .dv-supplier-short {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Four figures to a row leave a narrow tile at 1024: the amount is a size smaller and,
   if it is still too long, goes on two lines rather than past the tile's edge. */
@media (max-width: 1279.98px) {
    .dv-supplier-tiles .dv-tile-value {
        font-size: 1.125rem;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .dv-supplier-tiles .dv-tile .dv-ic-tile {
        width: 38px;
        height: 38px;
        flex: 0 0 38px;
    }
}

@media (max-width: 991.98px) {
    .dv-supplier-overview {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 575.98px) {
    .dv-supplier-head-project {
        flex: 1 1 100%;
    }

    .dv-list-card-figure-value {
        font-size: 0.9375rem;
    }
}

/* Task 11.13. A project's contract participation goals on its Overview: each goal's
   name and Target / Achieved on one line, and a bar of what is achieved. */
.dv-goal + .dv-goal {
    margin-top: var(--dv-space-3);
}

.dv-goal-line {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 2px 12px;
    margin-bottom: 6px;
}

.dv-goal-name {
    font-weight: 600;
    color: var(--dv-navy);
}

.dv-goal-figure {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.dv-goal-track {
    height: 10px;
    border-radius: 5px;
    background: var(--dv-line-soft);
    overflow: hidden;
}

.dv-goal-fill {
    height: 100%;
    border-radius: 5px;
    background: linear-gradient(90deg, var(--dv-blue), var(--dv-teal, #14A99A));
}

/* Task 11.14. Meetings: a card per meeting with its date in a small block, its
   title, type and time, and the attendees' initials; the same rows on a landing
   page's Upcoming meetings; and the Overview's Upcoming meeting line. */
.dv-meeting-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--dv-space-3);
}

.dv-meeting-card {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px;
    text-align: left;
    background: #FFFFFF;
    border: 1px solid var(--dv-card-line);
    border-radius: 10px;
    color: inherit;
    min-width: 0;
}

.dv-meeting-card:hover,
.dv-meeting-card:focus-visible {
    border-color: var(--dv-blue);
    background: var(--dv-row-hover, #EEF8F5);
}

.dv-meeting-card.is-past {
    opacity: 0.8;
}

.dv-meeting-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    border-radius: 10px;
    background: var(--dv-cat-blue-tint, #E6F4F0);
    color: var(--dv-navy);
    line-height: 1.1;
}

.dv-meeting-day {
    font-size: 1.25rem;
    font-weight: 700;
}

.dv-meeting-month {
    font-size: 0.6875rem;
    text-transform: uppercase;
    white-space: nowrap;
}

.dv-meeting-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1 1 auto;
}

.dv-meeting-title {
    font-weight: 600;
    color: var(--dv-navy);
    overflow-wrap: anywhere;
}

.dv-meeting-type,
.dv-meeting-when {
    font-size: 0.8125rem;
    color: var(--dv-text-muted);
    overflow-wrap: anywhere;
}

.dv-meeting-people {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
}

.dv-meeting-people .dv-initials + .dv-initials {
    margin-left: -8px;
    box-shadow: 0 0 0 2px #FFFFFF;
}

.dv-meeting-people-pick {
    border: 1px solid var(--dv-card-line);
    border-radius: 8px;
    padding: 8px 12px;
}

.dv-upcoming-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dv-upcoming-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.dv-upcoming-item + .dv-upcoming-item {
    border-top: 1px solid var(--dv-line-soft);
}

.dv-next-meeting {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    margin-bottom: var(--dv-space-3);
    background: #FFFFFF;
    border: 1px solid var(--dv-card-line);
    border-left: 4px solid var(--dv-blue);
    border-radius: 10px;
    color: inherit;
    text-decoration: none;
}

.dv-next-meeting:hover {
    background: var(--dv-row-hover, #EEF8F5);
}

@media (max-width: 575.98px) {
    .dv-meeting-list {
        grid-template-columns: minmax(0, 1fr);
    }

    .dv-meeting-people {
        display: none;
    }
}

/* Task 11.15. Reports, after RADAR's: the project choice, the tab row and PDF on one
   line (the tabs scroll on a phone), the headline figures, and the graph cards two to
   a row, one under the other on a tablet and a phone. In the app's light colours. */
.dv-rpt-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--dv-space-2);
    margin-bottom: var(--dv-space-3);
}

/* The project choice on a line of its own, so the six tabs have the width. */
.dv-rpt-head > .dv-rpt-project {
    flex: 1 1 100%;
}

.dv-rpt-head > .dv-rpt-tabs {
    flex: 1 1 auto;
    min-width: 0;
    margin-bottom: 0;
    overflow-x: auto;
    flex-wrap: nowrap;
}

.dv-rpt-head > .dv-rpt-tabs .dv-tab {
    white-space: nowrap;
}

.dv-rpt-head > .dv-rpt-pdf {
    flex: 0 0 auto;
}

.dv-rpt-project .form-select {
    max-width: 320px;
}

.dv-rpt-block {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--dv-navy);
    margin: var(--dv-space-4) 0 var(--dv-space-2) 0;
}

.dv-rpt-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--dv-space-3);
    margin-bottom: var(--dv-space-4);
}

.dv-rpt-kpi {
    background: var(--dv-surface);
    border: 1px solid var(--dv-line);
    border-left: 4px solid var(--dv-rpt-1);
    border-radius: 10px;
    padding: var(--dv-space-3) var(--dv-space-4);
    min-width: 0;
}

.dv-rpt-kpi-alert {
    border-left-color: var(--dv-rpt-5);
}

.dv-rpt-kpi-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--dv-text);
    overflow-wrap: anywhere;
    text-decoration: none;
}

a.dv-rpt-kpi-value:hover {
    color: var(--dv-blue);
}

.dv-rpt-kpi-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--dv-text);
    margin-top: var(--dv-space-1);
}

.dv-rpt-kpi-note {
    font-size: 0.8rem;
    color: var(--dv-text-muted);
    margin-top: var(--dv-space-1);
}

/* Snag 325. The daily line inside the Screens opened figure. */
.dv-rpt-kpi-spark {
    margin-top: var(--dv-space-2);
}

.dv-rpt-kpi-spark .dv-sparkline {
    width: 100%;
    max-width: 160px;
}

.dv-rpt-grid,
.dv-rpt-cpg {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--dv-space-4);
    margin-bottom: var(--dv-space-4);
}

.dv-rpt-card {
    min-width: 0;
    margin-bottom: 0;
}

.dv-rpt-wide {
    grid-column: 1 / -1;
}

@media (max-width: 991.98px) {
    .dv-rpt-grid,
    .dv-rpt-cpg {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 767.98px) {
    .dv-rpt-project .form-select {
        max-width: none;
    }

    .dv-rpt-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dv-rpt-kpi {
        padding: var(--dv-space-2) var(--dv-space-3);
    }

    .dv-rpt-kpi-value {
        font-size: 1.15rem;
    }
}

/* Snag 324. On a phone or tablet each attendee in the meeting window is a full width
   line about 44 pixels tall with a 22 pixel tick, and a tap anywhere on the line ticks
   it, as the capture window's ticks (Rules learned, 8 November 2026). */
@media (max-width: 1199.98px) {
    .dv-meeting-people-pick .form-check {
        display: flex;
        align-items: center;
        gap: var(--dv-space-3);
        min-height: 44px;
        padding-left: 0;
        margin: 0;
    }

    .dv-meeting-people-pick .form-check + .form-check {
        border-top: 1px solid var(--dv-line-soft);
    }

    .dv-meeting-people-pick .form-check-input {
        float: none;
        width: 22px;
        height: 22px;
        margin: 0;
        flex: 0 0 22px;
    }

    .dv-meeting-people-pick .form-check-label {
        flex: 1 1 auto;
        align-self: stretch;
        display: flex;
        align-items: center;
        min-height: 44px;
        cursor: pointer;
    }
}

/* Snag 329. A column that waits on an upright tablet only: back on a phone, where
   each row is a card, and from 1024 up. */
@media (min-width: 576px) and (max-width: 1023.98px) {
    .table .dv-col-upright-hide {
        display: none;
    }
}

/* Task 11.19. A capture's reason for going over wraps under its quantity, so a
   long reason never stretches the Work tab's table past its box. */
.dv-over-reason {
    white-space: normal;
}

/* Task 11.19. On a phone the Instructions list's Stage cell takes the whole width
   of its card, so a long stage ("Submitted for Certification") and Overdue stay
   whole, each on one line, inside the card (Snag 329's rule). */
@media (max-width: 767.98px) {
    .table-wrapper .dv-pg-jobcards > tbody > tr > td:has(> .dv-badge) {
        grid-column: 1 / -1;
    }
}

/* Task 11.19. On a phone the map's Map and Satellite buttons are 36 pixels tall,
   an easy tap on site, where they were 28. */
@media (max-width: 767.98px) {
    .dv-map-switch button {
        min-height: 36px;
    }
}

/* Task 11.19. On an upright tablet a certificate's lines drop the Total to Date
   quantity, so a Draft's typed This Cert boxes fit the box. Cum. Amount to Date
   stays; the quantity is on the line's window, the PDF and the Excel. A phone's
   line cards keep it. */
@media (min-width: 768px) and (max-width: 1023.98px) {
    .table-wrapper .dv-cert-lines .dv-cert-upright-hide {
        display: none;
    }
}

/* Snag 332. A capture's reason for going over is a line of its own under the
   capture, across the table, read as part of the same capture. */
.dv-repairs-table > tbody > tr:has(+ tr.dv-over-row) > td {
    border-bottom-color: transparent;
}

.dv-repairs-table > tbody > tr.dv-over-row > td {
    padding-top: 0;
    white-space: normal;
}

/* Leon, 5 December 2026. An instruction's title in the Instructions table is in normal
   weight, not bold; it still opens the instruction. */
.table-wrapper .dv-pg-jobcards .table-action-link.dv-jc-title {
    font-weight: 400;
}

/* Leon, 5 December 2026. On the Work Plan the figures and the days behind pill sit on
   the middle line of the row, so the pill keeps its own height, its words centred,
   instead of stretching to the Capture work button's height. */
.dv-work-figures,
.dv-week-figures {
    align-items: center;
}

.dv-work-figures > .dv-badge,
.dv-week-figures > .dv-badge {
    align-self: center;
    line-height: 1.45;
}

/* Leon, 5 December 2026. The Daveng Dashboard's contractor cards share the whole
   width of their card on a big screen, all the same width, instead of leaving an
   empty column at the end. */
.dv-dv-contractors {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

/* Leon, 5 December 2026. A row of tiles fills the width of the page on a big screen,
   as the contractor cards do, so two tiles (Damians' Active projects and Not compliant)
   do not leave the rest of the row empty. This replaces Task 8.8's own width rule. */
.dv-tiles {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* ===========================================================================
   Leon, 5 December 2026. The Meetings page: an Agenda and a Calendar. Each
   category has its own colour: Contractual teal, In house charcoal, Local labour amber.
   =========================================================================== */
.dv-mtg-contractual { --dv-mtg: var(--dv-cat-blue); --dv-mtg-tint: #E6F4F0; }
.dv-mtg-inhouse     { --dv-mtg: var(--dv-cat-linemarking); --dv-mtg-tint: #E6F6F4; }
.dv-mtg-labour      { --dv-mtg: var(--dv-cat-amber); --dv-mtg-tint: var(--dv-tint-amber); }
.dv-mtg-other       { --dv-mtg: var(--dv-cat-other); --dv-mtg-tint: var(--dv-tint-navy); }

.dv-check-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    color: var(--dv-text);
    white-space: nowrap;
    cursor: pointer;
}

.dv-check-inline .form-check-input {
    margin: 0;
}

.dv-mtg-key {
    display: flex;
    flex-wrap: wrap;
    gap: 6px var(--dv-space-4);
    margin: 0 0 var(--dv-space-3);
    font-size: 0.8125rem;
    color: var(--dv-text-muted);
}

.dv-mtg-key-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.dv-mtg-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--dv-mtg, var(--dv-cat-other));
    flex: 0 0 10px;
}

.dv-mtg-period,
.dv-mtg-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* --- Agenda --- */
.dv-mtg-month {
    font-family: var(--dv-font-head);
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--dv-text-muted);
    margin: var(--dv-space-4) 0 var(--dv-space-2);
}

.dv-mtg-day {
    display: flex;
    gap: var(--dv-space-3);
    padding: var(--dv-space-2) 0;
    border-top: 1px solid var(--dv-line-soft);
}

.dv-mtg-date {
    flex: 0 0 52px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 4px;
}

.dv-mtg-date-day {
    font-family: var(--dv-font-head);
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--dv-navy);
}

.dv-mtg-date-week {
    font-size: 0.75rem;
    color: var(--dv-text-muted);
}

.dv-mtg-day.is-today .dv-mtg-date-day {
    color: var(--dv-blue-bright);
}

.dv-mtg-items {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dv-mtg-item {
    display: flex;
    align-items: center;
    gap: var(--dv-space-3);
    width: 100%;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid var(--dv-card-line);
    border-left: 4px solid var(--dv-mtg);
    border-radius: 8px;
    background: var(--dv-surface);
    text-align: left;
    color: var(--dv-text);
    cursor: pointer;
}

.dv-mtg-item:hover,
.dv-mtg-item:focus-visible {
    background: var(--dv-mtg-tint);
}

.dv-mtg-time {
    flex: 0 0 64px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--dv-navy);
    font-variant-numeric: tabular-nums;
}

.dv-mtg-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.dv-mtg-title {
    font-weight: 600;
    color: var(--dv-navy);
}

.dv-mtg-sub {
    font-size: 0.8125rem;
    color: var(--dv-text-muted);
}

.dv-mtg-item .dv-badge {
    align-self: center;
}

/* --- Calendar --- */
.dv-cal {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    border-top: 1px solid var(--dv-card-line);
    border-left: 1px solid var(--dv-card-line);
}

.dv-cal-head {
    padding: 6px 8px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--dv-text-muted);
    background: #F6F6F6;
    border-right: 1px solid var(--dv-card-line);
    border-bottom: 1px solid var(--dv-card-line);
}

.dv-cal-cell {
    min-height: 112px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    border-right: 1px solid var(--dv-card-line);
    border-bottom: 1px solid var(--dv-card-line);
    background: var(--dv-surface);
}

.dv-cal-cell.is-other {
    background: #FAFAFA;
}

.dv-cal-cell.is-other .dv-cal-day {
    color: #A6ADBA;
}

.dv-cal-day {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--dv-text);
    align-self: flex-start;
    min-width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    border-radius: 12px;
}

.dv-cal-cell.is-today .dv-cal-day {
    background: var(--dv-blue-bright);
    color: #FFFFFF;
}

.dv-cal-chip {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    padding: 3px 6px;
    border: 0;
    border-left: 3px solid var(--dv-mtg);
    border-radius: 4px;
    background: var(--dv-mtg-tint);
    text-align: left;
    font-size: 0.75rem;
    line-height: 1.3;
    color: var(--dv-text);
    cursor: pointer;
    min-width: 0;
}

.dv-cal-chip:hover,
.dv-cal-chip:focus-visible {
    filter: brightness(0.96);
}

.dv-cal-chip-time {
    font-weight: 700;
    color: var(--dv-navy);
    font-variant-numeric: tabular-nums;
}

.dv-cal-chip-title {
    overflow-wrap: anywhere;
}

.dv-cal-dots {
    display: none;
    gap: 3px;
    flex-wrap: wrap;
}

.dv-cal-dots .dv-mtg-dot {
    width: 7px;
    height: 7px;
    flex-basis: 7px;
}

/* The month's list under the calendar is for a phone only. */
.dv-cal-list {
    display: none;
}

.dv-mtg-view-cat {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--dv-navy);
}

@media (max-width: 767.98px) {
    .dv-cal-head {
        padding: 4px 2px;
        text-align: center;
        font-size: 0.6875rem;
        letter-spacing: 0;
    }

    .dv-cal-cell {
        min-height: 48px;
        padding: 4px 2px;
        align-items: center;
    }

    .dv-cal-day {
        align-self: center;
    }

    .dv-cal-chip {
        display: none;
    }

    .dv-cal-dots {
        display: flex;
        justify-content: center;
    }

    .dv-cal-list {
        display: flex;
        flex-direction: column;
        gap: 6px;
        margin-top: var(--dv-space-3);
    }

    .dv-mtg-date {
        flex-basis: 40px;
    }

    .dv-mtg-item {
        gap: var(--dv-space-2);
    }

    .dv-mtg-time {
        flex-basis: 52px;
    }

    .dv-mtg-item .dv-meeting-people {
        display: none;
    }
}

/* Leon, 5 December 2026. All meetings, on the right of the Upcoming meetings heading. */
.dv-card-heading-link {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--dv-blue-bright);
    text-decoration: none;
    white-space: nowrap;
}

.dv-card-heading-link:hover {
    text-decoration: underline;
}

/* ==========================================================================
   RADAR APP, DAMIAN'S CONTRACTORS BRAND
   Leon, 5 December 2026, Sprint 11: the brand guide from Lemoen Marketing
   that Peter sent ("Contractor App: Logo revision 2"). The whole app takes it.
   Colour palette, in the proportion the guide shows:
     #E9C93F yellow     the accent: the radar arc, the open menu item
     #2D2A2A charcoal   the side menu and headings
     #0B9D80 teal       action: buttons, tabs, links
     #FFFFFF white      cards and the page
     #3ABB9C light teal on charcoal, and hover
     #BCBDBE grey       quiet lines and muted marks
   The navy and blue colours above were swapped for these where they were
   written out; this block holds what is new.
   ========================================================================== */
:root {
    --dv-accent:        #E9C93F;
    --dv-accent-deep:   #C7A622;
    --dv-tint-accent:   #FCF6DC;
    --dv-teal:          #0B9D80;
    --dv-teal-light:    #3ABB9C;
    --dv-silver:        #BCBDBE;

    --dv-tint-blue:     #E3F4EF;
    --dv-tint-navy:     #F3F2F2;
    --dv-row-hover:     #EEF8F5;
    --dv-info:          #0B9D80;

    --bs-link-color:        #077A63;
    --bs-link-hover-color:  #055C4A;
    --bs-link-color-rgb:    7, 122, 99;
    --dv-cat-blue:      #0B9D80;
    --dv-cat-blue-tint: #E6F4F0;
    --bs-primary-text-emphasis: #055C4A;
}

a { color: #077A63; }
a:hover { color: #055C4A; }

/* --- The side menu: charcoal, with the yellow of the radar arc as its accent --- */
.dv-sidebar {
    background: linear-gradient(180deg, #332F2F 0%, #2D2A2A 45%, #252222 100%);
}

.dv-sidebar::after {
    background: linear-gradient(180deg, rgba(233, 201, 63, 0.45), rgba(11, 157, 128, 0.35) 55%, transparent);
}

.dv-brand-row {
    padding: 22px 12px 16px 16px;
}

.dv-brand-row::after {
    left: 16px;
    right: 16px;
    background: linear-gradient(90deg, var(--dv-accent), var(--dv-teal-light) 55%, transparent);
    opacity: 0.55;
}

/* The full logo in the open menu; the R alone when the menu is folded. */
.dv-brand-logo {
    display: block;
    width: 100%;
    max-width: 172px;
    height: auto;
}

.dv-brand-logo-mark {
    display: none;
    width: 34px;
    height: auto;
}

.dv-shell.dv-rail .dv-brand-logo,
.dv-pre-collapsed .dv-brand-logo { display: none; }
.dv-shell.dv-rail .dv-brand-logo-mark,
.dv-pre-collapsed .dv-brand-logo-mark { display: block; }

/* The rail is a desktop idea: on a phone or tablet the drawer shows the full logo. */
@media (max-width: 991.98px) {
    .dv-shell.dv-rail .dv-brand-logo,
    .dv-pre-collapsed .dv-brand-logo { display: block; }
    .dv-shell.dv-rail .dv-brand-logo-mark,
    .dv-pre-collapsed .dv-brand-logo-mark { display: none; }
}

.dv-brand:hover .dv-brand-logo,
.dv-brand:hover .dv-brand-logo-mark {
    opacity: 0.92;
}

.dv-nav-item:hover {
    background: rgba(255, 255, 255, 0.07);
}

.dv-nav-item.active,
.dv-nav-item.active:hover {
    background: rgba(255, 255, 255, 0.09);
    color: #FFFFFF;
    box-shadow: inset 3px 0 0 var(--dv-accent);
}

.dv-nav-item.active .dv-nav-icon {
    color: var(--dv-accent);
}

/* --- Headings on cards: a small yellow to teal mark --- */
.dv-card-heading::before {
    background: linear-gradient(180deg, var(--dv-accent), var(--dv-teal));
}

/* --- Buttons: teal is action. White words sit on the deeper teals (#077A63 to
       #066B57) so they read easily; the brand teal stays for marks and lines. --- */
.btn-primary {
    background: linear-gradient(135deg, #077A63, #066B57);
    box-shadow: 0 2px 8px rgba(11, 157, 128, 0.25);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background: linear-gradient(135deg, #066B57, #055C4A);
    box-shadow: 0 4px 14px rgba(11, 157, 128, 0.32);
}

.btn-secondary:hover,
.btn-secondary:focus,
.btn-secondary:active {
    color: #077A63;
}

/* --- Login: the full logo in colour on the white card --- */
.dv-login-canvas {
    background:
        radial-gradient(1200px 520px at 12% -12%, rgba(11, 157, 128, 0.12), transparent 62%),
        radial-gradient(900px 440px at 108% 112%, rgba(233, 201, 63, 0.16), transparent 62%),
        #F7F7F7;
}

.dv-login-card::before {
    background: linear-gradient(90deg, #2D2A2A, var(--dv-teal) 55%, var(--dv-accent));
}

.dv-login-logo.dv-login-radar {
    max-width: 250px;
    margin: var(--dv-space-2) auto var(--dv-space-5);
}

.dv-login-product::before {
    background: linear-gradient(90deg, transparent, var(--dv-teal-light), var(--dv-accent), transparent);
}

/* --- Meetings: Contractual teal (the default colour above), In house
       charcoal, Local labour amber. --- */
.dv-mtg-inhouse { --dv-mtg: #4A4545; --dv-mtg-tint: #F1F0F0; }

/* Leon, 5 December 2026. A row of five figures on Reports (Instructions, Payment
   certificates) keeps five across on a desktop and three and two on a tablet, so the
   rows line up and no block stands alone. A phone keeps two to a line. */
@media (min-width: 1200px) {
    .dv-rpt-kpis.dv-rpt-kpis-5 {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (min-width: 768px) and (max-width: 1199.98px) {
    .dv-rpt-kpis.dv-rpt-kpis-5 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* An amount stays on one line in a row of five: its size follows the width of the screen. */
@media (min-width: 768px) {
    .dv-rpt-kpis.dv-rpt-kpis-5 .dv-rpt-kpi-value {
        white-space: nowrap;
        font-size: 1.25rem;
    }
}

@media (min-width: 1200px) {
    .dv-rpt-kpis.dv-rpt-kpis-5 .dv-rpt-kpi-value {
        font-size: clamp(1.1rem, 1.3vw, 1.5rem);
    }
}

/* ===========================================================================
   QA Ninja's alignment check for Leon, 5 December 2026 (Snags 341 to 347):
   a row of boxes never ends with one or two alone. Each grid is sized by how
   many boxes it holds.
   =========================================================================== */

/* Snag 341. A row of exactly four tiles or figures sits two and two on an upright
   tablet, and four across from 1024 pixels (Plant Management, Material Management,
   Travel Logs, a supplier, Reports, the Storeman's landing page). */
@media (min-width: 576px) and (max-width: 1023.98px) {
    .dv-tiles:has(> :nth-child(4):last-child),
    .dv-rpt-kpis:has(> :nth-child(4):last-child) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .dv-tiles:has(> :nth-child(4):last-child),
    .dv-rpt-kpis:has(> :nth-child(4):last-child) {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Snag 342. The landing page's eight count tiles sit four and four on an upright
   tablet too, as they do from 1024 pixels (Snag 289). */
@media (min-width: 768px) {
    .dv-tiles.dv-count-tiles {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Snag 344. Material Management's categories: four to a row from 768 pixels, so
   seven sit four and three at every width. A phone keeps two to a row. */
@media (min-width: 768px) {
    .dv-cat-tiles {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Snag 345. The Daveng Dashboard's contractor cards: two and two below 1440 pixels,
   four across from 1440. A phone keeps one to a row. */
@media (min-width: 768px) and (max-width: 1439.98px) {
    .dv-dv-contractors:has(> :nth-child(4):last-child) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1440px) {
    .dv-dv-contractors:has(> :nth-child(4):last-child) {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Snag 347. A supplier's three short tables: side by side where they fit, and a
   table alone on its row takes the whole row rather than half of it. */
.dv-supplier-short {
    display: flex;
    flex-wrap: wrap;
}

.dv-supplier-short > * {
    flex: 1 1 420px;
    min-width: 0;
}

/* A certificate's Insights: an odd last figure takes the whole row, so five sit
   two, two and one across the full width rather than one in half a row. */
@media (min-width: 768px) {
    .dv-insights-grid > :last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }
}

/* Snag 343. The project team chart's people: site.js works out how many go on a row
   (--dv-org-per) so the rows are as even as the count allows, each row centred. */
.dv-org-level.dv-org-even {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.dv-org-level.dv-org-even > .dv-org-node {
    flex: 0 0 calc((100% - (var(--dv-org-per) - 1) * var(--dv-space-2)) / var(--dv-org-per));
    width: auto;
    height: auto;
    min-width: 0;
}
