@import url(../../admin/css/base.css);

/* Navigation and action controls must not inherit Django's focused-link underline. */
#dNDT-nav-sidebar a:focus,
.w3-button:focus,
.w3-btn:focus,
.dNDT-changeform-actions :is(button, a):focus {
    text-decoration: none;
}

/* Heading and label tracking must not offset the single Font Awesome glyph. */
:is(.fa, .fas, .far, .fab, .fa-solid, .fa-regular, .fa-brands, .fa-classic) {
    letter-spacing: normal;
}

@font-face {
    font-family: Exo2;
    font-weight: normal;
    src: url("/static/core/fonts/Exo2-Regular.woff2");
}
@font-face {
    font-family: Exo2;
    font-weight: bold;
    src: url("/static/core/fonts/Exo2-Bold.woff2");
}
@font-face {
    font-family: Exo2;
    font-style: italic;
    src: url("/static/core/fonts/Exo2-Italic.woff2");
}
@font-face {
    font-family: Exo2;
    font-weight: bold;
    font-style: italic;
    src: url("/static/core/fonts/Exo2-BoldItalic.woff2");
}
@font-face {
    font-family: Exo2Light;
    src: url("/static/core/fonts/Exo2-Light.woff2");
}
@font-face {
    font-family: Exo2Light;
    font-style: italic;
    src: url("/static/core/fonts/Exo2-LightItalic.woff2");
}

:root {
    --dNDT-bookmark-outline-color: #8a6d00;
    --header-height: 52px;
    --footer-height: 0px;
    --nav-bar-width: 54px;
    --nav-bar-width-extended: 220px;
    /* Palette background and its matching foreground for filled controls. */
    --dNDT-theme-bg: #417690;
    --dNDT-theme-fg: #fff;
    /* Theme color for icons, lines and links: readable on light backgrounds, lightened in dark mode. */
    --dNDT-theme-accent: var(--dNDT-theme-accent-light, var(--dNDT-theme-bg, var(--primary)));
    /* Use a light workspace theme shade without overriding header text colors. */
    --dNDT-header-bg: var(--dNDT-theme-l4-bg, #d5e5ec);
}

/* Embedded dialog documents derive prefers-color-scheme from their host's
   used color scheme, not directly from the operating system. */
html[data-theme="auto"] {
    color-scheme: light dark;
}

html[data-theme="dark"] {
    color-scheme: dark;
}

html[data-theme="light"] {
    color-scheme: light;
}

body {
    background: var(--body-bg);
}

#session_security_warning .session_security_modal {
    background: var(--body-bg);
    color: var(--body-fg);
}

.dNDT-release-notes-title {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 14px;
}

.dNDT-dialog .ui-dialog-title.dNDT-release-notes-dialog-title {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.dNDT-release-notes-version-badge {
    background: #edf7fb;
    border: 1px solid #d7ebf3;
    background: color-mix(in srgb, var(--primary) 14%, var(--body-bg));
    border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--body-bg));
    border-radius: 999px;
    color: var(--primary);
    display: inline-flex;
    font-size: 0.90rem;
    font-weight: 700;
    line-height: 1.2;
    padding: 4px 10px;
    text-transform: uppercase;
}

.dNDT-release-notes-title-suffix {
    color: var(--body-quiet-color);
    font-size: 0.95rem;
    font-weight: 600;
}

.dNDT-release-notes-page {
    max-width: 960px;
    margin: 16px 0;
}

.dNDT-release-notes-content {
    overflow: visible;
}

/* Keep the footer link styled as an action, including hover and keyboard focus. */
.ui-dialog.dNDT-release-notes-dialog .dNDT-help-changelog-link {
    text-decoration: none;
}

.dNDT-release-notes-content ul,
.dNDT-release-notes-content li {
    list-style-type: disc;
}

.dNDT-release-notes-content ul {
    padding-left: 24px;
}

.dNDT-release-notes-content h3 {
    font-size: 1.12rem;
    font-weight: 700;
    margin: 14px 0 8px;
}

ul,
ul li {
    list-style-type: none;
}

ul.dNDT-link-list li a {
    font-weight: bold;
}

ul.dNDT-link-list li a:hover {
    text-decoration: underline;
}

#content-main-change-form {
    padding-right: 25px;
}

.object-tools a {
    border-radius: 5px;
}

.aligned label + p,
.aligned label + div.help,
.aligned label + div.readonly {
    margin-left: 0;
    padding: 0;
}

.aligned label + div.readonly {
    margin-left: 0;
}

.help::before {
    font-family: "Font Awesome 7 Free";
    font-weight: 900;
    content: "\f05a";
    display: inline-block;
    margin-right: 0.5em;
}

.selector .help-icon {
    background: none;
}

.selector .selector-chosen .help-icon {
    background: none;
    color: #fff;
}

.aligned .form-row:has(.selector) > div {
    align-items: flex-start;
    display: flex;
    flex-wrap: wrap;
}

.aligned .form-row:has(.selector) > div > label {
    flex: 0 0 100%;
    margin: 0 0 6px;
    order: 0;
    width: auto;
}

.aligned .form-row:has(.selector) > div > .selector,
.aligned .form-row:has(.selector) > div > .related-widget-wrapper {
    flex: 0 0 auto;
    margin-left: 0;
    max-width: 1000px;
    order: 1;
    width: min(100%, 1000px);
}

.aligned .form-row:has(.selector) .selector {
    display: inline-flex;
    width: 100% !important;
}

.aligned .form-row:has(.selector) .related-widget-wrapper-link {
    margin-left: 8px;
    vertical-align: top;
}

.aligned .form-row:has(.selector) > div > .help {
    flex: 0 0 100%;
    margin: 6px 0 0;
    order: 2;
    padding: 0;
}

.selector-available,
.selector-chosen {
    flex: 1 1 0 !important;
    min-width: 0;
}

.selector-chosen-title,
.selector-chosen .list-footer-display {
    background-color: var(--dNDT-theme-bg) !important;
    color: var(--dNDT-theme-fg) !important;
}

.selector-chosen-title label,
.selector-chosen-title .helptext,
.selector-chosen .list-footer-display__clear {
    color: var(--dNDT-theme-fg) !important;
}

.required label::after,
label.required::after {
    content: "*" !important;
    color: red;
    vertical-align: baseline !important;
}

.aligned p.file-upload {
    margin-left: 0;
}

.login #container {
    width: 30em;
    min-width: 100px;
    margin: 100px auto;
}

#client-container {
    width: 30em;
    min-width: 100px;
    margin: 100px auto;
}

.client-select {
    width: 100%;
}

/* MODULES */

.module p,
.module ul,
.module h3,
.module h4,
.module dl,
.module pre {
    padding-left: 0;
}

.module h2,
.module caption {
    color: var(--body-fg);
    background-color: var(--body-bg);
    margin-top: 5px;
}

.calendarbox caption {
    text-align: center;
    background: #9e9e9e;
}

/* Modernized single- and multi-select related widgets. */
.related-widget-wrapper.dNDT-related-select-widget {
    display: inline-flex;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 0;
    min-width: 0;
    max-width: 100%;
    vertical-align: middle;
    white-space: nowrap;
}

.dNDT-related-select-widget > select,
.dNDT-related-select-widget > .select2-container {
    /* Keep the width declared by the widget (or DAL's 20em default).
       The action buttons extend the wrapper instead of reducing the input. */
    flex: 0 0 auto;
}

.dNDT-related-select-widget > .related-widget-wrapper-link {
    display: inline-flex;
    align-items: center;
    align-self: stretch;
    justify-content: center;
    box-sizing: border-box;
    flex: 0 0 30px;
    width: 30px;
    min-height: 28px;
    margin-left: 4px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background: var(--body-bg);
    color: var(--body-quiet-color);
    filter: none;
    font-size: 14px;
    opacity: 1;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.dNDT-related-select-widget > .related-widget-wrapper-link[href]:hover,
.dNDT-related-select-widget > .related-widget-wrapper-link[href]:focus {
    border-color: var(--dNDT-theme-bg, var(--primary));
    background: var(--darkened-bg);
    color: var(--dNDT-theme-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--dNDT-theme-bg, var(--primary)) 20%, transparent);
    text-decoration: none;
}

.dNDT-related-select-widget > .related-widget-wrapper-link[aria-disabled="true"] {
    color: var(--body-quiet-color);
    opacity: 0.35;
    pointer-events: none;
}

.dNDT-related-select-widget--multiple > .related-widget-wrapper-link {
    min-height: 32px;
}

/* Modernized Django admin date/time shortcuts. */
.split-datetime-input-widget {
    display: inline-grid;
    align-items: center;
    grid-template-columns: max-content auto;
    gap: 6px 8px;
    max-width: 100%;
    vertical-align: middle;
}

.split-datetime-input-widget-label {
    color: var(--body-quiet-color);
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
}

.split-datetime-input-widget > .datetime-input-widget {
    display: flex;
    box-sizing: border-box;
    width: 100%;
}

.datetime-input-widget {
    display: inline-flex;
    align-items: center;
    flex-wrap: nowrap;
    max-width: 100%;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background: var(--darkened-bg);
    vertical-align: middle;
    white-space: nowrap;
}

.datetime-input-widget:focus-within {
    border-color: var(--body-quiet-color);
}

.errors .datetime-input-widget {
    border-color: var(--error-fg);
}

.datetime-input-widget > input.vDateField,
.datetime-input-widget > input.vTimeField {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
}

.datetime-input-widget > .datetimeshortcuts {
    align-self: stretch;
    flex: 0 0 auto;
    gap: 0;
    margin-left: 0;
    min-height: 0;
    color: transparent;
    font-size: 0;
}

.datetime-input-widget > .datetimeshortcuts > a:first-child {
    display: inline-flex;
    align-items: center;
    align-self: stretch;
    padding: 0 8px;
    border-left: 1px solid var(--border-color);
    background: var(--body-bg);
    font-size: 0.78rem;
    line-height: 1;
}

.datetime-input-widget > .datetimeshortcuts > a:first-child:hover,
.datetime-input-widget > .datetimeshortcuts > a:first-child:focus {
    background: var(--darkened-bg);
    text-decoration: none;
}

.datetime-input-widget > .datetimeshortcuts > a:last-child {
    box-sizing: border-box;
    width: 34px;
    height: auto;
    border: 0;
    border-left: 1px solid var(--border-color);
    border-radius: 0;
    background: var(--body-bg);
}

.datetime-input-widget > .datetimeshortcuts > a:last-child:hover,
.datetime-input-widget > .datetimeshortcuts > a:last-child:focus {
    box-shadow: none;
}

.datetimeshortcuts {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: 6px;
    min-height: 28px;
    vertical-align: middle;
    white-space: nowrap;
}

.datetimeshortcuts a {
    color: var(--dNDT-theme-accent) !important;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
}

.datetimeshortcuts a:hover,
.datetimeshortcuts a:focus {
    color: var(--dNDT-theme-accent) !important;
    text-decoration: underline;
}

.datetimeshortcuts a:last-child {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid var(--dNDT-theme-bg, var(--primary));
    border-radius: 5px;
    background: var(--body-bg);
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.datetimeshortcuts a:last-child:hover,
.datetimeshortcuts a:last-child:focus {
    background: var(--darkened-bg);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--dNDT-theme-bg, var(--primary)) 20%, transparent);
}

.datetimeshortcuts .clock-icon,
.datetimeshortcuts .date-icon {
    top: 0;
    width: 18px;
    height: 18px;
    background-size: 18px auto;
}

.datetimeshortcuts a:focus .clock-icon,
.datetimeshortcuts a:hover .clock-icon,
.datetimeshortcuts a:focus .date-icon,
.datetimeshortcuts a:hover .date-icon {
    background-position: 0 -18px;
}

.date-input-widget .datetimeshortcuts .date-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    top: 0;
    width: 18px;
    height: 18px;
    overflow: visible;
    background: none;
}

.date-input-widget .date-icon::before {
    color: var(--dNDT-theme-accent);
    content: "\f073";
    font-family: "Font Awesome 7 Free";
    font-size: 16px;
    font-style: normal;
    font-weight: 900;
    line-height: 1;
}

.time-input-widget .clock-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    background: none;
}

.time-input-widget .clock-icon::before {
    color: var(--dNDT-theme-accent);
    content: "\f017";
    font-family: "Font Awesome 7 Free";
    font-size: 16px;
    font-style: normal;
    font-weight: 900;
    line-height: 1;
}

.calendarbox.module,
.clockbox.module {
    width: min(18.5rem, calc(100vw - 2rem));
    margin: 8px auto;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--body-bg);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
    color: var(--body-fg);
    font-size: 0.82rem;
    z-index: 1000 !important;
}

.clockbox.module {
    width: 14rem;
}

.clockbox.module.dNDT-time-picker {
    width: min(18rem, calc(100vw - 1rem));
    max-height: calc(100vh - 1rem);
    overflow-y: auto;
}

.clockbox.module.dNDT-time-picker > h2 {
    margin-right: 8px;
    margin-left: 8px;
}

.dNDT-time-picker-body {
    padding: 12px 14px;
    background: var(--body-bg);
}

.dNDT-time-picker-display {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.clockbox.module .dNDT-time-picker-display-value {
    min-width: 48px;
    padding: 3px 5px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--body-quiet-color);
    cursor: pointer;
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1.15;
}

.clockbox.module .dNDT-time-picker-display-value:hover,
.clockbox.module .dNDT-time-picker-display-value:focus,
.clockbox.module .dNDT-time-picker-display-value-active {
    border-bottom-color: var(--dNDT-theme-bg, var(--primary));
    color: var(--dNDT-theme-accent);
    outline: 0;
}

.dNDT-time-picker-display-separator {
    color: var(--body-fg);
    font-size: 1.35rem;
    font-weight: 800;
}

.dNDT-time-picker-period {
    display: grid;
    gap: 1px;
    margin-left: 7px;
}

.clockbox.module .dNDT-time-picker-period button {
    padding: 1px 4px;
    border: 0;
    border-radius: 3px;
    background: transparent;
    color: var(--body-quiet-color);
    cursor: pointer;
    font-size: 0.62rem;
    font-weight: 700;
}

.clockbox.module .dNDT-time-picker-period button.active {
    background: var(--dNDT-theme-bg, var(--primary));
    color: var(--dNDT-theme-fg, var(--button-fg));
}

.dNDT-time-picker-dial {
    position: relative;
    width: min(14rem, calc(100vw - 4rem));
    aspect-ratio: 1;
    margin: 0 auto;
    border: 1px solid var(--hairline-color);
    border-radius: 50%;
    background: var(--darkened-bg);
    cursor: crosshair;
    touch-action: none;
    user-select: none;
}

.dNDT-time-picker-dial:focus {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--dNDT-theme-bg, var(--primary)) 18%, transparent);
    outline: 0;
}

.dNDT-time-picker-number {
    position: absolute;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 27px;
    height: 27px;
    border-radius: 50%;
    color: var(--body-fg);
    font-size: 0.75rem;
    font-weight: 700;
    pointer-events: none;
    transform: translate(-50%, -50%);
}

.dNDT-time-picker-number-inner {
    width: 23px;
    height: 23px;
    color: var(--body-quiet-color);
    font-size: 0.62rem;
}

.dNDT-time-picker-number-selected {
    background: var(--dNDT-theme-bg, var(--primary));
    color: var(--dNDT-theme-fg, var(--button-fg));
}

.dNDT-time-picker-hand {
    position: absolute;
    bottom: 50%;
    left: calc(50% - 1px);
    z-index: 1;
    width: 2px;
    height: var(--dNDT-hand-length, 40%);
    border-radius: 2px;
    background: var(--dNDT-theme-bg, var(--primary));
    pointer-events: none;
    transform: rotate(var(--dNDT-hand-angle, 0deg));
    transform-origin: center bottom;
    transition: height 0.12s ease, transform 0.08s ease;
}

.dNDT-time-picker-dial-dragging .dNDT-time-picker-hand {
    transition: none;
}

.dNDT-time-picker-hand::before {
    position: absolute;
    top: -4px;
    left: -3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--dNDT-theme-bg, var(--primary));
    content: "";
}

.dNDT-time-picker-center {
    position: absolute;
    top: calc(50% - 4px);
    left: calc(50% - 4px);
    z-index: 3;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--dNDT-theme-bg, var(--primary));
    pointer-events: none;
}

.clockbox.module .dNDT-time-picker-now {
    width: 100%;
    margin-top: 10px;
    border-radius: 6px;
    color: var(--dNDT-theme-accent) !important;
    font-weight: 700;
}

.dNDT-time-picker-now .fa-clock {
    margin-right: 6px;
}

.dNDT-time-picker-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 10px 14px;
    border-top: 1px solid var(--border-color);
    background: var(--darkened-bg);
}

.clockbox.module .dNDT-time-picker-actions .w3-button {
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
}

.clockbox.module .dNDT-time-picker-cancel {
    border: 1px solid var(--border-color) !important;
    background: var(--body-bg) !important;
    color: var(--body-fg) !important;
}

.calendarbox.module .calendar,
.clockbox.module .timelist {
    background: var(--body-bg);
}

.calendarbox.module .calendar {
    padding: 4px 8px 8px;
}

.calendarbox.module .calendar table {
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 3px;
    background: var(--body-bg);
}

.calendarbox.module .calendar caption,
.calendarbox.module .calendarbox h2,
.calendarbox.module h2,
.clockbox.module h2 {
    padding: 12px 40px;
    border-bottom: 1px solid var(--hairline-color);
    background: color-mix(in srgb, var(--dNDT-theme-bg, var(--primary)) 9%, var(--body-bg));
    color: var(--body-fg);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-align: center;
    text-transform: uppercase;
}

.calendarbox.module .calendar th {
    padding: 7px 3px 5px;
    border-bottom: 0;
    background: var(--body-bg);
    color: var(--body-quiet-color);
    font-size: 0.78rem;
    font-weight: 700;
}

.calendarbox.module .calendar td {
    height: 30px;
    border: 0;
    background: var(--body-bg);
    color: var(--body-fg);
    font-size: 0.82rem;
}

.calendarbox.module .calendar td.nonday {
    background: transparent;
}

.calendarbox.module .calendar td a,
.clockbox.module .timelist a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0;
    border-radius: 6px;
    color: var(--body-fg) !important;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.clockbox.module .timelist a {
    min-height: 34px;
    justify-content: flex-start;
    padding: 0 14px;
}

.calendarbox.module .calendar td a:hover,
.calendarbox.module .calendar td a:focus,
.clockbox.module .timelist a:hover,
.clockbox.module .timelist a:focus {
    background: var(--darkened-bg);
    color: var(--dNDT-theme-accent) !important;
}

.calendarbox.module .calendar td.selected a,
.calendarbox.module .calendar td.selected a:hover,
.calendarbox.module .calendar td.selected a:focus {
    background: var(--dNDT-theme-bg, var(--primary));
    color: var(--dNDT-theme-fg, var(--button-fg)) !important;
}

.calendarbox.module .calendar td.today a {
    box-shadow: inset 0 0 0 1px var(--dNDT-theme-bg, var(--primary));
    color: var(--dNDT-theme-accent) !important;
    font-weight: 800;
}

.calendarbox.module .calendar td.today.selected a {
    color: var(--dNDT-theme-fg, var(--button-fg)) !important;
}

.calendarbox.module .calendarnav-previous,
.calendarbox.module .calendarnav-next {
    top: 20px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: var(--dNDT-theme-bg, var(--primary));
    background-image: none;
    color: transparent !important;
    display: block;
    text-indent: 0;
}

.calendarbox.module .calendarnav-previous {
    left: 16px;
}

.calendarbox.module .calendarnav-next {
    right: 16px;
}

.calendarbox.module .calendarnav-previous::before,
.calendarbox.module .calendarnav-next::before {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 7px;
    height: 7px;
    border-color: var(--dNDT-theme-fg, var(--button-fg));
    border-style: solid;
    border-width: 0 3px 3px 0;
    content: "";
}

.calendarbox.module .calendarnav-previous::before {
    transform: translate(-35%, -50%) rotate(135deg);
}

.calendarbox.module .calendarnav-next::before {
    transform: translate(-65%, -50%) rotate(-45deg);
}

.calendarbox.module .calendarnav-previous:hover,
.calendarbox.module .calendarnav-previous:focus,
.calendarbox.module .calendarnav-next:hover,
.calendarbox.module .calendarnav-next:focus {
    background-color: color-mix(in srgb, var(--dNDT-theme-bg, var(--primary)) 84%, black);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--dNDT-theme-bg, var(--primary)) 18%, transparent);
}

.calendarbox.module .calendar-shortcuts {
    padding: 8px 10px;
    border-top: 1px solid var(--hairline-color);
    background: var(--darkened-bg);
    color: var(--body-quiet-color);
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.2;
}

.calendarbox.module .calendar-shortcuts a {
    color: var(--dNDT-theme-accent) !important;
    text-decoration: none;
}

.calendarbox.module .calendar-shortcuts a:hover,
.calendarbox.module .calendar-shortcuts a:focus {
    text-decoration: underline;
}

.calendarbox.module .calendar-cancel,
.clockbox.module .calendar-cancel {
    padding: 0;
    border-top: 1px solid var(--border-color);
    background: var(--darkened-bg);
    color: var(--body-quiet-color);
    font-size: 0.82rem;
}

.calendarbox.module .calendar-cancel a,
.clockbox.module .calendar-cancel a {
    padding: 9px 10px;
    color: var(--dNDT-theme-accent) !important;
    font-weight: 700;
    text-decoration: none;
}

.calendarbox.module .calendar-cancel:hover,
.calendarbox.module .calendar-cancel:focus,
.clockbox.module .calendar-cancel:hover,
.clockbox.module .calendar-cancel:focus {
    background: var(--body-bg);
}

#dNDT-scroll-to-top {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: transform 0.15s ease;
    text-decoration: none;
}

#dNDT-scroll-to-top:hover,
#dNDT-scroll-to-top:hover {
    transform: scale(1.25);
    border: 0 !important;
}

/*---      FontAwesome Enhancement       ---*/
/*--- CSS for changing fa-icons on hover ---*/

* > .fas.fa-hover-show,
*:hover > .fas.fa-hover-hidden {
    display: none;
}

*:hover > .fas.fa-hover-show {
    display: inline-block;
}

div.breadcrumbs {
    padding: 10px 20px;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="url"],
input[type="number"],
input[type="tel"],
textarea,
select,
.vTextField {
    background-color: var(--darkened-bg);
}

input[readonly],
textarea[readonly],
select[readonly] {
    background-color: #aaa;
    cursor: not-allowed;
}

fieldset {
    /* FIXED: reverted min-width of django3 base.css */
    min-width: revert !important;
}

/* Shared action panels on change forms and intermediate pages. */
body:not(.dNDT-action-modal-page) #driveMain > .w3-container:has(.dNDT-changeform-actions) {
    /* 60px panel plus 4px on each side. */
    padding-right: 68px;
}

#content-main-change-form:has(.dNDT-changeform-actions) {
    padding-right: 0;
}

.submit-iconbar.dNDT-changeform-actions {
    position: fixed;
    transform: translateY(-50%);
    z-index: 99;
    top: 50%;
    right: 4px;
    width: 60px;
    max-height: calc(100dvh - 160px);
    overflow: auto;
    overscroll-behavior: contain;
    padding: 7px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--body-bg);
    box-shadow: 0 4px 18px rgb(0 0 0 / 12%);
    transition: none;
}

.dNDT-changeform-actions .dNDT-changeform-actions-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dNDT-changeform-actions .dNDT-changeform-actions-group:not(:has(button, a)) {
    display: none;
}

.dNDT-changeform-actions-group:has(button, a) ~ .dNDT-changeform-actions-group:has(button, a) {
    margin-top: 7px;
    padding-top: 7px;
    border-top: 1px solid var(--border-color);
}

.dNDT-changeform-actions-group > br {
    display: none;
}

/* W3's rectangular dropdown hover must not show behind the rounded button. */
.dNDT-changeform-actions .w3-dropdown-click:hover {
    background-color: transparent;
}

.submit-iconbar.dNDT-changeform-actions button,
.submit-iconbar.dNDT-changeform-actions a[data-action-modal] {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 44px !important;
    height: 44px;
    min-height: 44px;
    padding: 0;
    border: 0 !important;
    border-radius: 7px;
    font-size: 0;
    line-height: 1.4;
    text-transform: none;
    white-space: normal;
    overflow-wrap: anywhere;
    box-shadow: none;
}

.submit-iconbar.dNDT-changeform-actions :is(button, a[data-action-modal]):not(.dNDT-changeform-actions-primary):not(.w3-pale-red):not(:hover) {
    background: var(--body-bg) !important;
    color: var(--body-fg) !important;
}

.dNDT-changeform-actions .w3-pale-red {
    margin-top: 8px;
}

.dNDT-changeform-actions .dNDT-changeform-actions-primary {
    font-weight: 700;
}

.dNDT-changeform-actions :is(button, a):focus-visible {
    outline: 2px solid var(--body-fg);
    outline-offset: -3px;
}

.submit-iconbar.dNDT-changeform-actions button i,
.submit-iconbar.dNDT-changeform-actions a[data-action-modal] i {
    width: 20px;
    margin: 0;
    font-size: 18px;
    text-align: center;
}

@media (max-width: 767px) {
    body:not(.dNDT-action-modal-page) #driveMain > .w3-container:has(.dNDT-changeform-actions) {
        padding-right: 16px;
    }

    .submit-iconbar.dNDT-changeform-actions {
        position: static;
        transform: none;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
        max-width: 100%;
        max-height: none;
        margin: 20px 0 calc(80px + env(safe-area-inset-bottom, 0px)) auto;
        padding: 10px;
    }

    .dNDT-changeform-actions .dNDT-changeform-actions-group {
        /* Keep DOM order and form semantics, without separate sparse rows. */
        display: contents;
    }

    .submit-iconbar.dNDT-changeform-actions button,
    .submit-iconbar.dNDT-changeform-actions a[data-action-modal] {
        flex: 0 0 48px;
        width: 48px !important;
        height: 48px;
    }

    /* The export trigger's legacy block wrapper must not occupy an entire row. */
    .dNDT-changeform-actions-group > .w3-dropdown-click {
        width: auto !important;
        flex: 0 0 48px;
    }

    .dNDT-changeform-actions .w3-pale-red {
        margin-top: 0;
        margin-left: 0;
    }
}

/* Text stays in the accessible name; only the leading icon is drawn. */
.dNDT-changeform-actions button i ~ i {
    display: none;
}

/* The export menu is mounted outside the narrow, scrollable action panel. */
.dNDT-changeform-export-menu {
    position: fixed;
    z-index: 1000;
    width: min(200px, calc(100vw - 88px));
    max-height: calc(100dvh - 16px) !important;
    overflow: auto;
    padding: 4px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--body-bg);
    box-shadow: 0 4px 18px rgb(0 0 0 / 16%);
}

.dNDT-changeform-export-menu button {
    display: block;
    width: 100%;
    min-height: 40px;
    padding: 8px 12px;
    border: 0;
    border-radius: 5px;
    text-align: left;
}

.dNDT-changeform-export-menu button:not(:hover) {
    color: var(--body-fg) !important;
    background: var(--body-bg) !important;
}

.dNDT-changeform-export-menu button:focus-visible {
    outline: 2px solid var(--body-fg);
    outline-offset: -2px;
}

.dNDT-changeform-action-tooltip {
    position: fixed;
    z-index: 1000;
    /* Keep measurement independent of the previous horizontal position. */
    width: max-content;
    max-width: min(280px, calc(100vw - 84px));
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 7px;
    background: var(--body-bg);
    color: var(--body-fg);
    box-shadow: 0 3px 12px rgb(0 0 0 / 15%);
    font-size: 14px;
    pointer-events: none;
}

.related-widget-wrapper {
    overflow: visible;
}

.aligned label {
    float: none;
    width: 250px;
}

.errors .select2-selection {
    border: 1px solid var(--error-fg) !important;
}

/* FORM ROWS */

input:disabled,
select:disabled,
textarea:disabled {
    color: var(--body-fg);
    background-color: #aaa;
    opacity: 60%;
    border: 1px solid var(--body-fg);
}

/* Keep checkbox text consistently to the right, including legacy labels
   whose text is rendered before the checkbox input. */
form label:has(> input[type="checkbox"]) {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: auto;
    min-width: 0;
    padding: 0;
    line-height: 22px;
    cursor: pointer;
}

form label:has(> input[type="checkbox"]) > input[type="checkbox"] {
    order: -1;
    margin: 0;
}

/* Django's default selected-row color is pale yellow. Use the active DRIVE
   theme for readable selections in every native multiple-select widget. */
form select[multiple] option:checked {
    color: var(--dNDT-theme-fg, #fff) !important;
    background-color: var(--dNDT-theme-bg, var(--primary)) !important;
}

/* Modern checkbox control with a distinct, framework-standard form shape. */
input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    box-sizing: border-box;
    display: inline-grid;
    place-content: center;
    flex: 0 0 22px;
    inline-size: 22px;
    block-size: 22px;
    min-inline-size: 22px;
    margin: 0 6px 0 0;
    padding: 0;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--body-bg);
    background-image: none;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 14px 14px;
    color: #fff;
    cursor: pointer;
    vertical-align: middle;
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="checkbox"]:hover {
    border-color: var(--dNDT-theme-bg, var(--primary));
    background-color: var(--darkened-bg);
}

input[type="checkbox"]:focus-visible {
    border-color: var(--dNDT-theme-bg, var(--primary));
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--dNDT-theme-bg, var(--primary)) 20%, transparent);
}

input[type="checkbox"]:checked,
input[type="checkbox"]:indeterminate {
    border-color: var(--dNDT-theme-bg, var(--primary));
    background-color: var(--dNDT-theme-bg, var(--primary));
}

input[type="checkbox"]:checked {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5 6.5 12 13 4' fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5'/%3E%3C/svg%3E");
}

input[type="checkbox"]:indeterminate {
    background-image: linear-gradient(#fff, #fff);
    background-size: 10px 2px;
}

input[type="checkbox"]:disabled {
    border-color: var(--border-color);
    background-color: var(--darkened-bg);
    color: var(--body-quiet-color);
    cursor: not-allowed;
    opacity: 0.5;
}

input[type="checkbox"]:disabled:checked,
input[type="checkbox"]:disabled:indeterminate {
    background-color: var(--body-quiet-color);
    color: var(--body-bg);
}

.errors input[type="checkbox"] {
    border-color: var(--error-fg);
}

@media (prefers-reduced-motion: reduce) {
    input[type="checkbox"] {
        transition: none;
    }
}

form fieldset legend {
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.5px;
    min-width: 500px;
    padding: 4px 8px;
    margin: 5px 0 5px 0;
    text-transform: uppercase;
}

form fieldset legend.w3-border {
    border-left-width: 4px !important;
}

.form-row {
    border-bottom: none;
}

.form-row label input[type="checkbox"] {
    vertical-align: middle;
}

.aligned .form-row:has(> .checkbox-row:only-child) {
    padding-top: 8px;
    padding-bottom: 8px;
}

.aligned .checkbox-row:not([hidden]),
.aligned .fieldBox.checkbox-row:not([hidden]),
.aligned .field-box.checkbox-row:not([hidden]) {
    align-items: center;
    column-gap: 5px;
    display: inline-grid !important;
    grid-template-columns: auto 1fr;
    row-gap: 4px;
    vertical-align: top;
}

.aligned .checkbox-row input[type="checkbox"] {
    grid-column: 1;
    margin: 0;
}

.aligned .checkbox-row .vCheckboxLabel {
    grid-column: 2;
    line-height: normal;
    margin: 0;
    padding: 0;
    vertical-align: middle;
    width: auto;
}

/* Override Django's negative margin after .vCheckboxLabel so the grid
   controls the distance between the checkbox and its help text. */
form .aligned .form-row .checkbox-row > .help {
    grid-column: 1 / -1;
    margin: 0;
    padding-top: 0;
}

.aligned .checkbox-row > .help::before {
    width: 22px;
    margin-right: 5px;
    text-align: center;
}

.aligned .form-row > div > .checkbox-row + .help {
    margin-top: 8px;
    padding-top: 0;
}

.aligned .form-row:has(.fieldBox + .fieldBox) .fieldBox:has(> input[type="checkbox"] + .vCheckboxLabel),
.aligned .form-row:has(.field-box + .field-box) .field-box:has(> input[type="checkbox"] + .vCheckboxLabel) {
    padding-top: 22px;
}

/* FORMS */

.dNDT-account-page > p,
.dNDT-account-page > h5 {
    padding-inline: 10px;
}

form .wide p,
form .wide ul.errorlist,
form .wide input + p.help,
form .wide input + div.help {
    margin-left: 0;
}

form .aligned p.help,
form .aligned div.help {
    margin-left: 2px;
    padding-left: 0;
}

form .aligned input + p.help,
form .aligned textarea + p.help,
form .aligned select + p.help,
form .aligned input + div.help,
form .aligned textarea + div.help,
form .aligned select + div.help {
    margin-left: 2px;
    padding-left: 0;
}

form .aligned ul {
    margin-left: 0;
    padding-left: 0;
}

/* Keep the first help paragraph beside its icon while allowing normal wrapping. */
.help:has(> p)::before {
    float: left;
}

.help > p:first-child {
    margin-top: 0;
}

/* Keep a help list beside its icon without changing inline text or links. */
.help:not(.hidden):not([hidden]):has(> ul:only-child) {
    display: flex;
    align-items: baseline;
}

.help:has(> ul:only-child)::before {
    flex-shrink: 0;
}

.help > ul:only-child {
    margin-top: 0;
    margin-bottom: 0;
    min-width: 0;
}

.aligned .vCheckboxLabel {
    margin-top: 0;
    vertical-align: -2px;
}

.aligned select[style*="width:425px"]:not([style*="-width"]) + .select2,
.aligned select[style*="width:425px"]:not([style*="-width"]) ~ .select2,
.aligned select[style*="width: 425px"]:not([style*="-width"]) + .select2,
.aligned select[style*="width: 425px"]:not([style*="-width"]) ~ .select2 {
    width: 425px !important;
}

.aligned select[style*="width:325px"]:not([style*="-width"]) + .select2,
.aligned select[style*="width:325px"]:not([style*="-width"]) ~ .select2,
.aligned select[style*="width: 325px"]:not([style*="-width"]) + .select2,
.aligned select[style*="width: 325px"]:not([style*="-width"]) ~ .select2 {
    width: 325px !important;
}

.aligned select[style*="min-width:325px"] + .select2,
.aligned select[style*="min-width:325px"] ~ .select2,
.aligned select[style*="min-width: 325px"] + .select2,
.aligned select[style*="min-width: 325px"] ~ .select2 {
    min-width: 325px !important;
}

fieldset.collapsed {
    border: 0;
    border-radius: 0;
}

fieldset .fieldBox {
    float: left;
}

form .aligned div.help {
    clear: left;
}

.dNDT-range-slider-wrapper{
  display:grid;
  grid-template-columns:minmax(0, 1fr) auto;
  align-items:center;
  column-gap:6px;
  row-gap:4px;
  width:100%;
}

.dNDT-range-slider-wrapper input[type="range"]{
  grid-column:1;
  width:100%;
}

.dNDT-range-slider-output{
  grid-column:2;
  min-width:45px;
  text-align:right;
  font-weight:500;
}

.dNDT-range-slider-quality-scale{
  grid-column:1 / -1;
  display:grid;
  grid-template-columns:repeat(5, minmax(0, 1fr));
  gap:2px;
  margin:0 2px;
}

.dNDT-range-slider-quality-scale-segment{
  --dpi-quality-color:var(--body-quiet-color);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  min-width:0;
  min-height:18px;
  padding:2px 1px;
  border:1px solid var(--border-color);
  border-top:2px solid var(--dpi-quality-color);
  border-radius:3px;
  background:var(--body-bg);
  background:color-mix(in srgb, var(--dpi-quality-color) 8%, var(--body-bg));
  color:var(--dpi-quality-color);
  color:color-mix(in srgb, var(--dpi-quality-color) 72%, var(--body-fg));
  font-size:9px;
  line-height:1.05;
  text-align:center;
  text-shadow:none;
}

.dNDT-range-slider-quality-scale-segment-excellent{
  --dpi-quality-color:#166534;
}

.dNDT-range-slider-quality-scale-segment-good{
  --dpi-quality-color:#65a30d;
}

.dNDT-range-slider-quality-scale-segment-caution{
  --dpi-quality-color:#a16207;
}

.dNDT-range-slider-quality-scale-segment-risky{
  --dpi-quality-color:#c2410c;
}

.dNDT-range-slider-quality-scale-segment-bad{
  --dpi-quality-color:#b91c1c;
}

.dNDT-range-slider-quality-scale-segment strong,
.dNDT-range-slider-quality-scale-segment small{
  display:block;
  max-width:100%;
  overflow:hidden;
  text-overflow:clip;
  white-space:nowrap;
}

.dNDT-range-slider-quality-scale-segment small{
  font-size:9px;
  font-weight:500;
}

.dNDT-range-slider-quality-excellent input[type="range"]{
  accent-color:#166534;
}

.dNDT-range-slider-quality-excellent .dNDT-range-slider-output{
  color:#166534;
  font-weight:700;
}

.dNDT-range-slider-quality-good input[type="range"]{
  accent-color:#65a30d;
}

.dNDT-range-slider-quality-good .dNDT-range-slider-output{
  color:#4d7c0f;
  font-weight:700;
}

.dNDT-range-slider-quality-caution input[type="range"]{
  accent-color:#eab308;
}

.dNDT-range-slider-quality-caution .dNDT-range-slider-output{
  color:#a16207;
  font-weight:700;
}

.dNDT-range-slider-quality-risky input[type="range"]{
  accent-color:#f97316;
}

.dNDT-range-slider-quality-risky .dNDT-range-slider-output{
  color:#c2410c;
  font-weight:700;
}

.dNDT-range-slider-quality-bad input[type="range"]{
  accent-color:#dc2626;
}

.dNDT-range-slider-quality-bad .dNDT-range-slider-output{
  color:#b91c1c;
  font-weight:700;
}

.dNDT-upload-field {
    display: inline-block;
    max-width: 100%;
    position: relative;
    width: 325px;
}

.dNDT-upload-control {
    align-items: stretch;
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    pointer-events: none;
    transition: transform 160ms ease;
    width: 100%;
}

.dNDT-upload-input {
    cursor: pointer !important;
    height: 100%;
    inset: 0;
    opacity: 0;
    position: absolute;
    width: 100%;
    z-index: 1;
}

.dNDT-upload-input::file-selector-button,
.dNDT-upload-input::-webkit-file-upload-button {
    cursor: pointer !important;
}

.dNDT-upload-control .dNDT-upload-button {
    align-items: center;
    border-radius: 5px;
    box-sizing: border-box;
    cursor: pointer;
    display: inline-flex;
    flex: 0 0 110px;
    gap: 4px;
    height: 28px;
    justify-content: center;
    min-height: 28px;
    min-width: 0;
    padding: 0 12px !important;
    text-transform: uppercase;
    transition: box-shadow 160ms ease, filter 160ms ease;
}

.dNDT-upload-control .dNDT-upload-filename {
    align-items: center;
    background-color: var(--body-bg);
    border-style: dashed !important;
    box-sizing: border-box;
    color: var(--body-quiet-color);
    display: inline-flex;
    flex: 1 1 auto;
    gap: 8px;
    height: 28px;
    max-width: none;
    min-width: 0;
    overflow: hidden;
    padding: 0 10px !important;
    transition: background-color 160ms ease, border-color 160ms ease,
                box-shadow 160ms ease, color 160ms ease;
    white-space: nowrap;
}

.dNDT-upload-filename-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dNDT-upload-drop-icon {
    opacity: .55;
    transition: opacity 160ms ease, transform 160ms ease;
}

.dNDT-upload-field:hover .dNDT-upload-filename {
    background-color: color-mix(in srgb, var(--dNDT-theme-bg) 5%, var(--body-bg));
    border-color: color-mix(in srgb, var(--dNDT-theme-bg) 55%, var(--hairline-color)) !important;
}

.dNDT-upload-field:hover .dNDT-upload-drop-icon {
    opacity: .8;
    transform: translateY(2px);
}

.dNDT-upload-input:focus-visible + .dNDT-upload-control .dNDT-upload-button {
    outline: 1px solid var(--body-quiet-color);
    outline-offset: 1px;
}

.dNDT-upload-field.dNDT-upload-is-dragover .dNDT-upload-control {
    transform: translateY(-2px);
}

.dNDT-upload-field.dNDT-upload-is-dragover .dNDT-upload-button {
    box-shadow: 0 4px 10px color-mix(in srgb, var(--dNDT-theme-bg) 25%, transparent);
    filter: brightness(1.05);
}

.dNDT-upload-field.dNDT-upload-is-dragover .dNDT-upload-filename {
    background-color: color-mix(in srgb, var(--dNDT-theme-bg) 12%, var(--body-bg));
    border-color: var(--dNDT-theme-bg) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--dNDT-theme-bg) 18%, transparent);
    color: var(--body-fg);
}

.dNDT-upload-field.dNDT-upload-is-dragover .dNDT-upload-drop-icon {
    animation: dNDT-upload-drop-bounce 500ms ease-in-out infinite alternate;
    color: var(--dNDT-theme-accent);
    opacity: 1;
}

@keyframes dNDT-upload-drop-bounce {
    from { transform: translateY(-2px); }
    to { transform: translateY(3px); }
}

@media (prefers-reduced-motion: reduce) {
    .dNDT-upload-control,
    .dNDT-upload-button,
    .dNDT-upload-filename,
    .dNDT-upload-drop-icon {
        animation: none !important;
        transition: none;
    }
}

.inline-column-title th {
    font-weight: normal;
    font-size: 11px;
    padding: 5px 10px;
    line-height: normal;
    text-transform: uppercase;
    color: var(--body-quiet-color);
    background: var(--body-bg);
    border: none;
    border-top: 1px solid var(--hairline-color);
    border-bottom: 1px solid var(--hairline-color);
}

.inline-column-title th.required {
    color: var(--body-loud-color);
    font-weight: 600;
}

.hidden {
    visibility: hidden; /* fix for safari browser */
}

.fieldBox p {
    font-family: Exo2;
}

#content {
    padding: 0;
}

#breadcrumb {
    z-index: 9999;
    display: flex;
    align-items: center;
    height: var(--header-height);
    color: var(--body-fg);
    background-color: var(--dNDT-header-bg);
    border-bottom: 1px solid color-mix(in srgb, var(--dNDT-theme-accent) 45%, transparent);
    overflow: visible !important;
}

html[data-theme="dark"] {
    --dNDT-bookmark-outline-color: #e5cf35;
    --dNDT-navigation-hover-bg: #2e2e2e;
    --dNDT-theme-accent: color-mix(in srgb, var(--dNDT-theme-bg, var(--primary)) 50%, #fff);
    --dNDT-header-bg: color-mix(in srgb, var(--dNDT-theme-bg, var(--primary)) 12%, var(--body-bg));
}

/* Customer themes color all links with a dark !important color. */
html[data-theme="dark"] #result_list tbody a {
    color: var(--dNDT-theme-accent) !important;
}

html[data-theme="dark"] #result_list tbody a:is(:hover, :focus-visible) {
    color: var(--body-fg) !important;
}

html[data-theme="dark"] #dNDT-nav-sidebar .w3-button:is(:hover, :focus-visible),
html[data-theme="dark"] .dNDT-bulk-actions .w3-dropdown-content .w3-button:is(:hover, :focus-visible) {
    background-color: var(--dNDT-navigation-hover-bg) !important;
    color: var(--body-fg) !important;
}

html[data-theme="dark"] #dNDT-nav-sidebar {
    border-right: 1px solid var(--hairline-color);
}

html[data-theme="dark"] #dNDT-nav-sidebar .dNDT-nav-dropdown {
    border: 1px solid var(--hairline-color);
}

html[data-theme="dark"] .dNDT-bulk-actions > .w3-dropdown-content {
    border: 1px solid #ccc;
}

@media (prefers-color-scheme: dark) {
    html[data-theme="auto"] {
        --dNDT-bookmark-outline-color: #e5cf35;
        --dNDT-navigation-hover-bg: #2e2e2e;
        --dNDT-theme-accent: color-mix(in srgb, var(--dNDT-theme-bg, var(--primary)) 50%, #fff);
        --dNDT-header-bg: color-mix(in srgb, var(--dNDT-theme-bg, var(--primary)) 12%, var(--body-bg));
    }

    html[data-theme="auto"] #result_list tbody a {
        color: var(--dNDT-theme-accent) !important;
    }

    html[data-theme="auto"] #result_list tbody a:is(:hover, :focus-visible) {
        color: var(--body-fg) !important;
    }

    html[data-theme="auto"] #dNDT-nav-sidebar .w3-button:is(:hover, :focus-visible),
    html[data-theme="auto"] .dNDT-bulk-actions .w3-dropdown-content .w3-button:is(:hover, :focus-visible) {
        background-color: var(--dNDT-navigation-hover-bg) !important;
        color: var(--body-fg) !important;
    }

    html[data-theme="auto"] #dNDT-nav-sidebar {
        border-right: 1px solid var(--hairline-color);
    }

    html[data-theme="auto"] #dNDT-nav-sidebar .dNDT-nav-dropdown {
        border: 1px solid var(--hairline-color);
    }

    html[data-theme="auto"] .dNDT-bulk-actions > .w3-dropdown-content {
        border: 1px solid #ccc;
    }
}

#breadcrumb > .w3-breadcrumb {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    white-space: nowrap;
}

#breadcrumb .w3-breadcrumb li {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    overflow: hidden;
}

#breadcrumb .w3-breadcrumb li:last-child {
    font-weight: 600;
}

/* Prefix every item, including the first visible one after responsive hidden items. */
#breadcrumb .w3-breadcrumb li::before {
    content: "/\00a0";
    margin-left: 4px;
    flex-shrink: 0;
}

#breadcrumb .w3-breadcrumb li > span,
#breadcrumb .w3-breadcrumb li > a {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Customer themes also style links globally with !important. */
#breadcrumb .w3-breadcrumb a {
    color: var(--body-quiet-color) !important;
}

#breadcrumb .w3-breadcrumb a:hover,
#breadcrumb .w3-breadcrumb a:focus-visible {
    color: var(--body-fg) !important;
}

#breadcrumb .w3-breadcrumb .dNDT-toggle-bookmark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-left: 4px;
    line-height: 1;
    flex-shrink: 0;
}

.dNDT-bookmark-star.fa-regular {
    color: var(--dNDT-bookmark-outline-color) !important;
}

#breadcrumb > .dNDT-user-settings-wrap {
    order: 2;
    margin-right: 8px;
}

#breadcrumb > #theme-toggle,
#breadcrumb > #dNDT-notify-topbar-target {
    order: 1;
}

#breadcrumb > .w3-bar-item:not(.w3-breadcrumb),
#breadcrumb > .w3-button {
    flex-shrink: 0;
}

#driveMain {
    padding-top: var(--header-height);
    padding-bottom: var(--footer-height);
    margin-left: var(--nav-bar-width);
}

#dNDT-nav-sidebar {
    background-color: var(--body-bg);
    z-index: 999;
    max-width: var(--nav-bar-width);
    margin-top: var(--header-height);
    padding-bottom: calc(var(--header-height) * 3);
}

#dNDT-nav-sidebar-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    text-align: center;
    max-width: var(--nav-bar-width-extended);
    background: var(--body-bg);
    opacity: 0.9;
}

#dNDT-nav-sidebar-button {
    max-width: var(--nav-bar-width);
}

@media (max-width: 992px) {
    /* Large screens always show the sidebar (W3 forces it despite jQuery's inline display).
       On small screens, show the toggles only while jQuery has opened the menu. */
    .dNDT-sidebar-toggles {
        display: none;
    }

    #dNDT-nav-sidebar[style*="display: block"] + .dNDT-sidebar-toggles {
        display: block;
    }
}

#dNDT-show-sidebar-button,
#dNDT-hide-sidebar-button {
    position: fixed;
    z-index: 1000;
    top: calc(var(--header-height) + 11px);
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: transform 0.15s ease;
    text-decoration: none;
}

#dNDT-show-sidebar-button {
    left: calc(var(--nav-bar-width) - 13px);
}

#dNDT-hide-sidebar-button {
    left: calc(var(--nav-bar-width-extended) - 13px);
}

#dNDT-show-sidebar-button:hover,
#dNDT-hide-sidebar-button:hover {
    transform: scale(1.15);
    border: 0 !important;
}

#dNDT-show-sidebar-button:hover i,
#dNDT-hide-sidebar-button:hover i {
    /* The hover background is the theme color, so use the label color of the same palette. */
    color: var(--dNDT-theme-fg, var(--button-fg));
}

.dNDT-sidebar-pinned #driveMain {
    margin-left: 220px;
}

/* Related-object popups retain the header but have no sidebar. */
body.popup #driveMain {
    margin-left: 0;
}

#breadcrumb.dNDT-popup-header {
    inset-inline: 0;
    width: auto;
    box-sizing: border-box;
    padding-inline: 16px;
    gap: 12px;
}

#breadcrumb.dNDT-popup-header::before,
#breadcrumb.dNDT-popup-header::after {
    content: none;
}

#breadcrumb.dNDT-popup-header #theme-toggle {
    order: 0;
    margin: 0;
}

.dNDT-popup-user-context {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    min-width: 0;
    color: var(--body-quiet-color);
}

.dNDT-popup-user-context > i {
    flex: 0 0 auto;
}

.dNDT-popup-user-context .dNDT-user-settings-name {
    min-width: 0;
    max-width: none;
}

@media (max-width: 600px) {
    .dNDT-popup-user-context {
        flex: 0 1 auto;
        max-width: 35%;
    }
}

#breadcrumb .dNDT-popup-title {
    flex: 1;
    min-width: 0;
    margin: 0;
    padding: 0;
    font-size: 1rem;
    font-weight: 600;
    color: inherit;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dNDT-user-settings-wrap {
    align-items: center;
    display: flex;
    height: var(--header-height);
}

.dNDT-user-settings-name {
    display: grid;
    line-height: 1.3;
    text-align: left;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 15px;
}

.dNDT-user-settings-name > span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.dNDT-user-settings-name > .dNDT-user-settings-badge {
    justify-self: start;
    max-width: 100%;
    margin-top: 2px;
}

#breadcrumb .dNDT-topbar-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    min-width: 44px;
    padding: 0 10px;
    color: var(--body-quiet-color) !important;
    background: transparent;
}

#breadcrumb .dNDT-topbar-button:hover,
#breadcrumb .dNDT-topbar-button:focus-visible,
#breadcrumb .dNDT-toggle-bookmark:hover,
#breadcrumb .dNDT-toggle-bookmark:focus-visible {
    color: var(--dNDT-theme-fg, var(--button-fg)) !important;
    background: var(--dNDT-theme-bg, var(--primary)) !important;
}

#breadcrumb .dNDT-toggle-bookmark:is(:hover, :focus-visible) .dNDT-bookmark-star {
    color: var(--dNDT-theme-fg, var(--button-fg)) !important;
}

#breadcrumb .dNDT-topbar-button:is(:hover, :focus-visible) .dNDT-user-settings-badge {
    color: inherit;
    border-color: currentColor;
    background: transparent;
    opacity: 1;
}

#breadcrumb .dNDT-topbar-button > i {
    color: inherit;
}

#breadcrumb a.dNDT-topbar-button,
#breadcrumb a.dNDT-topbar-button:hover,
#breadcrumb a.dNDT-topbar-button:focus,
#breadcrumb a.dNDT-topbar-button:active {
    text-decoration: none;
}

#dNDT-notify-topbar-target {
    display: flex;
    align-items: center;
}

/* Stretch to the header height so the dropdown opens below the header bar. */
#breadcrumb .dNDT-user-settings-menu {
    display: flex;
    align-self: stretch;
    align-items: center;
    float: none;
    position: relative;
    background: transparent;
    color: inherit;
    border-radius: 4px;
}

#breadcrumb .dNDT-user-settings-dropdown {
    max-width: calc(100vw - 16px);
    min-width: min(280px, calc(100vw - 16px));
    width: max-content;
    top: calc(100% + 4px);
    max-height: calc(100dvh - var(--header-height) - 8px);
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.4;
    border: 1px solid var(--hairline-color);
    padding: 0;
    right: 0;
    background: var(--body-bg);
    color: var(--body-fg);
}

.dNDT-user-settings-dropdown [data-profile-panel="main"] {
    padding-top: 8px;
}

#breadcrumb .dNDT-user-settings-dropdown a {
    color: inherit !important;
    text-decoration: none;
}

#breadcrumb .dNDT-user-settings-dropdown .w3-button:hover,
#breadcrumb .dNDT-user-settings-dropdown .w3-button:focus-visible {
    background: var(--darkened-bg) !important;
    background: var(--dNDT-navigation-hover-bg, color-mix(in srgb, var(--body-fg) 12%, var(--body-bg))) !important;
    color: var(--body-fg) !important;
}

#breadcrumb .dNDT-user-settings-dropdown .w3-bar-item,
#breadcrumb .dNDT-user-settings-dropdown .w3-button {
    align-items: center;
    display: flex;
    gap: 0.65rem;
    white-space: normal;
    overflow-wrap: anywhere;
    padding: 8px 16px;
}

.dNDT-user-settings-dropdown .w3-bar-item i,
.dNDT-user-settings-dropdown .w3-button i {
    min-width: 1rem;
    text-align: center;
}

.dNDT-user-settings-language-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 18px;
    flex-shrink: 0;
    border: 1px solid currentColor;
    border-radius: 999px;
    font-size: 0.64rem;
    font-weight: 600;
    line-height: 1;
    margin-left: 0.25rem;
    opacity: 0.65;
    padding: 0 6px;
}

.dNDT-user-settings-section-title {
    color: var(--body-quiet-color);
    font-size: 0.8rem;
    font-weight: 600;
    opacity: 0.72;
    padding: 8px 16px 5px;
}

.dNDT-user-settings-account {
    padding: 0 16px 10px;
}

.dNDT-user-settings-primary {
    font-weight: 700;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dNDT-user-settings-secondary,
.dNDT-user-settings-meta {
    font-size: 0.78rem;
    opacity: 0.72;
}

.dNDT-user-settings-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.dNDT-user-settings-badge {
    /* Shows the workspace in its theme color. */
    border: 1px solid var(--dNDT-theme-accent);
    background: color-mix(in srgb, var(--dNDT-theme-accent) 14%, transparent);
    color: var(--dNDT-theme-accent);
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.4;
    opacity: 0.8;
    padding: 0 8px;
    text-transform: uppercase;
}

.dNDT-user-settings-sso-badge {
    display: inline-block;
    position: static;
    vertical-align: super;
    font-size: 0.6rem;
    font-weight: 400;
    letter-spacing: normal;
    margin-left: 0.3em;
    opacity: 1;
    padding: 0 5px;
    text-transform: none;
    white-space: nowrap;
}

.dNDT-user-settings-meta {
    margin-top: 7px;
}

.dNDT-user-settings-version {
    display: block;
    padding: 12px 16px;
    text-align: center;
    font-size: 0.78rem;
    opacity: 0.68;
    white-space: nowrap;
}

.dNDT-nav-subtitle.is-hidden {
    visibility: hidden;
}

#content-overlay {
    cursor: pointer;
}

#spinner {
    display: none;
}

.dNDT-chart {
    height: 500px;
}

.dNDT-chart-heading {
    height: 38px;
}

.dNDT-chart-heading.w3-table th {
    height: 36px;
    padding: 2px 12px;
    vertical-align: middle;
}

.dNDT-chart-heading h6 {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
    text-transform: none;
}

.dNDT-chart-heading h6.w3-right {
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.dNDT-chart-heading a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    min-height: 32px;
    border-radius: 4px;
}

.dNDT-truncate {
    max-width: 30em;
}

.dNDT-truncate-content {
    display: block;
    /* Clip long content horizontally without cutting off inline tag padding. */
    overflow: clip visible;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 30em;
}

.dNDT-changelist-title {
    background-color: var(--darkened-bg) !important;
}

.dNDT-object-tools-items-dropdown {
    max-height: 500px !important;
    overflow: auto !important;
    overflow-x: hidden !important;
    border: 1px solid #ccc;
    border-radius: 6px;
    z-index: 1000 !important;
}

.dNDT-nav-dropdown {
    background-color: var(--body-bg);
    position: fixed !important;
    margin-left: 50px !important;
    min-width: 180px !important;
    overflow: auto !important;
}

.dNDT-action-dropdown.w3-dropdown-content {
    position: fixed;
    z-index: 999;
    max-width: calc(100vw - 20px);
    border-radius: 4px;
    outline: 1px solid var(--border-color);
    background-color: var(--body-bg) !important;
}

/* Keeps hover backgrounds off the menu edge so they never meet the arrow's fill. */
.dNDT-action-dropdown-scroll {
    box-sizing: border-box;
    padding: 4px 0;
    max-height: inherit;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: inherit;
}

@media (hover: hover) and (pointer: fine) {
    .dNDT-action-dropdown.w3-bar-block .w3-bar-item {
        padding-top: 7px;
        padding-bottom: 7px;
    }
}

.dNDT-action-dropdown-arrow {
    display: none;
    position: absolute;
    z-index: 1;
    width: 18px;
    height: 10px;
    pointer-events: none;
}

.dNDT-action-dropdown[data-arrow-side] .dNDT-action-dropdown-arrow {
    display: block;
}

.dNDT-action-dropdown-arrow-fill {
    fill: var(--body-bg);
}

/* The open path joins the 1px menu outline without drawing across the arrow's base. */
.dNDT-action-dropdown-arrow-outline {
    fill: none;
    stroke: var(--border-color);
    stroke-width: 1;
}

.dNDT-action-dropdown[data-arrow-side="top"] .dNDT-action-dropdown-arrow {
    left: calc(var(--arrow-x) - 9px);
    top: -10px;
}

.dNDT-action-dropdown[data-arrow-side="bottom"] .dNDT-action-dropdown-arrow {
    left: calc(var(--arrow-x) - 9px);
    bottom: -10px;
    transform: rotate(180deg);
}

.dNDT-action-dropdown[data-arrow-side="left"] .dNDT-action-dropdown-arrow {
    top: calc(var(--arrow-y) - 5px);
    left: -14px;
    transform: rotate(-90deg);
}

.dNDT-action-dropdown[data-arrow-side="right"] .dNDT-action-dropdown-arrow {
    top: calc(var(--arrow-y) - 5px);
    right: -14px;
    transform: rotate(90deg);
}

/* Shared native scrollbar styling for pages, tables and scrollable panels. */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track,
::-webkit-scrollbar-corner {
    background: var(--body-bg);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--body-quiet-color);
}
@supports not selector(::-webkit-scrollbar) {
    * {
        scrollbar-width: thin;
        scrollbar-color: var(--border-color) var(--body-bg);
    }
}
@media (forced-colors: active) {
    * {
        scrollbar-color: auto;
    }
    ::-webkit-scrollbar-track,
    ::-webkit-scrollbar-corner {
        background: Canvas;
    }
    ::-webkit-scrollbar-thumb,
    ::-webkit-scrollbar-thumb:hover {
        background: CanvasText;
    }
}

.w3-sidebar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.w3-sidebar::-webkit-scrollbar {
    display: none;
}

.dNDT-nav-item {
    padding-left: 10px;
    display: none;
}

.dNDT-object-hover:hover {
    cursor: pointer;
    background: var(--selected-bg);
}

.dNDT-list-object {
    height: 40px;
}

.dNDT-list-object-archived {
    font-style: italic;
}

.dNDT-without-original td,
th {
    vertical-align: middle;
}

.dNDT-toggle-bookmark {
    cursor: pointer;
}

.dNDT-footer {
    z-index: 9991 !important;
    position: fixed;
    width: 100%;
    bottom: 0;
    height: var(--footer-height);
}

.dNDT-toggle-content-collapse,
.dNDT-toggle-content-finished {
    cursor: pointer;
}

.dNDT-preview-iframe {
    width: 100%;
    max-height: 960px;
    overflow: hidden;
}

.dNDT-preview-iframe iframe {
    width: 100%;
    height: 960px;
    border: 1px solid #ccc;
}

.dNDT-btn-group-dropdown {
    position: relative;
    display: inline-block;
}

.dNDT-btn-group {
    display: flex;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    align-items: stretch;
    border: 1px solid #ccc;
    border-radius: 6px;
    margin: 6px 0;
    overflow: hidden;
}

.dNDT-btn-group .dNDT-btn-segment {
    flex: 1 1 auto;
    border: none;
    background: none;
    padding: 6px 10px;
    cursor: pointer;
    text-align: center;
    border-right: 1px solid #ccc;
    color: var(--body-fg);
}

/* Preserve word widths while allowing multi-word labels to wrap. */
.dNDT-btn-group > .dNDT-btn-segment {
    min-width: auto;
    white-space: normal;
    overflow-wrap: break-word;
}

.dNDT-btn-group .dNDT-btn-segment:last-of-type {
    border-right: none;
}

.dNDT-btn {
    border-radius: 6px;
    border: 1px solid #ccc;
    padding: 6px 10px;
    margin: 6px 0;
    cursor: pointer;
}

/* Dashboard and list toolbar actions share compact button spacing. */
.dNDT-dashboard-action,
.dNDT-toolbar-extras .dNDT-btn,
.dNDT-toolbar-buttons .dNDT-btn,
.dNDT-toolbar-buttons .dNDT-btn-group {
    margin: 0;
}

.dNDT-dashboard-action,
.dNDT-toolbar-extras .dNDT-btn,
.dNDT-toolbar-buttons .dNDT-btn,
.dNDT-toolbar-buttons .dNDT-btn-segment {
    line-height: 1.5;
}

.dNDT-legend-wide {
    width: 100%;
}

button[type=button]:hover {
    cursor: pointer;
}

button[type=button]:disabled,
button[type=button]:disabled:hover {
    cursor: not-allowed; /* oder default */
}

/* Avoid inline baseline gaps between the sidebar's hover targets. */
#dNDT-navigation-items-sidebar > .w3-dropdown-hover {
    display: block;
}

/* Keep sidebar menus reachable while moving the pointer into the submenu. */
#dNDT-navigation-items-sidebar .dNDT-nav-open > div > .w3-button {
    background-color: var(--dNDT-navigation-hover-bg, #ccc) !important;
    color: var(--body-fg) !important;
}

/* Mark the active app and whole model row, including the bookmark button. */
#dNDT-navigation-items-sidebar > .w3-dropdown-hover > div > .dNDT-nav-active,
#dNDT-navigation-items-sidebar .dNDT-nav-dropdown .dNDT-nav-model-active {
    background-color: color-mix(in srgb, var(--dNDT-theme-accent) 10%, var(--body-bg));
    box-shadow: inset 3px 0 0 var(--dNDT-theme-accent);
}

#dNDT-navigation-items-sidebar .dNDT-nav-dropdown .dNDT-nav-active {
    font-weight: 600;
}

/* Hovering the model link highlights the whole row; the bookmark button keeps its own hover. */
#dNDT-navigation-items-sidebar .dNDT-nav-dropdown .dNDT-nav-model:has(> a:is(:hover, :focus-visible)) {
    background-color: var(--dNDT-navigation-hover-bg, #ccc);
}

#dNDT-navigation-items-sidebar .dNDT-nav-dropdown .dNDT-nav-model > a.w3-button:is(:hover, :focus-visible) {
    background-color: transparent !important;
}

/* Customer themes also style links globally with !important; keep navigation text neutral. */
#dNDT-navigation-items-sidebar a {
    color: var(--body-fg) !important;
}

#dNDT-navigation-items-sidebar > a > i,
#dNDT-navigation-items-sidebar > .w3-dropdown-hover > div > a > i:not(.dNDT-bookmark-star) {
    color: var(--dNDT-theme-accent);
}

/* Override W3 hover opening; menus wait until the sidebar is expanded. */
#dNDT-navigation-items-sidebar .w3-dropdown-hover .dNDT-nav-dropdown {
    display: none;
}

#dNDT-navigation-items-sidebar .dNDT-nav-open .dNDT-nav-dropdown {
    display: block;
}
#dNDT-navigation-items-sidebar .dNDT-nav-closing .dNDT-nav-dropdown {
    opacity: 0;
    transition: opacity 400ms ease-out;
}
@media (prefers-reduced-motion: reduce) {
    #dNDT-navigation-items-sidebar .dNDT-nav-closing .dNDT-nav-dropdown {
        transition: none;
    }
}
.dNDT-nav-model {
    display: flex;
    align-items: center;
}
#dNDT-navigation-items-sidebar .dNDT-nav-model > .dNDT-toggle-bookmark {
    /* W3 dropdown buttons otherwise occupy the entire submenu width. */
    width: auto;
    flex: 0 0 auto;
    margin-left: 8px;
}
.dNDT-nav-model > a {
    flex: 1;
    min-width: 0;
}

.dNDT-import-export-dialog .dNDT-action-frame {
    background: var(--body-bg);
    display: block;
    width: 100%;
    border: 0;
}

.ui-dialog.dNDT-import-export-dialog {
    min-width: 0;
    max-width: calc(100vw - 32px);
}

/* Keep the template download beside the title, clear of the close control. */
.ui-dialog.dNDT-import-export-dialog .ui-dialog-titlebar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-right: 64px !important;
}
.dNDT-import-export-dialog .ui-dialog-title {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
    width: auto;
    margin: 0;
    float: none;
}
.dNDT-import-export-dialog .dNDT-import-template-button {
    flex: 0 0 auto;
    font-size: 14px;
    font-weight: normal;
    text-decoration: none !important;
}

/* Explains the scope of an action, e.g. which rows an export includes. */
.dNDT-action-info:not(.dNDT-dialog-notice) {
    margin: 0 0 12px;
    padding: 8px 12px;
    border-left: 3px solid var(--dNDT-theme-accent);
    background: color-mix(in srgb, var(--dNDT-theme-accent) 8%, var(--body-bg));
}
