﻿a.disabled {
    color: #495057;
    opacity: 0.65;
}

.edit-column,
.view-column,
.delete-column {
    width: 39px;
}

td.footer, div.footerTop {
    background-color: #000000;
}

td.footer {
    text-align: left;
    color: #ffffff;
}

div.footerTop {
    height: 82px;
}

td.footer div.copyright {
    padding-left: 270px;
    margin-bottom: 15px;
}

div.divider {
    background: url(../../Images/dot.gif) repeat-x top left;
}

header, footer, hgroup,
nav, section {
    display: block;
}

mark {
    background-color: #a6dbed;
    padding-left: 5px;
    padding-right: 5px;
}

hgroup.title {
    display: block;
    padding-top: 10px;
    margin-bottom: 50px;
}

h1, h2, h3,
h4, h5, h6 {
    color: #000;
    margin-bottom: 0;
    padding-bottom: 0;
}

h1 {
    font-size: 2em;
}

h2 {
    font-size: 1.75em;
}

h3 {
    font-size: 1.2em;
}

h4 {
    font-size: 1.1em;
}

h5, h6 {
    font-size: 1em;
}

    h5 a:link, h5 a:visited, h5 a:active {
        padding: 0;
        text-decoration: none;
    }


/* main layout
----------------------------------------------------------*/
.content-wrapper {
    margin: 0 auto;
    max-width: 960px;
}

.flex-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding-bottom: 50px;
}

.content-container {
    padding-bottom: 35px;
}

@media (max-width: 575.98px) {
    .content-container {
        padding-bottom: 60px;
    }
}

.full-height {
    height: 100%;
}

#body {
    background-color: #efeeef;
    clear: both;
    padding-bottom: 35px;
}

footer {
    clear: both;
    background-color: #e2e2e2;
    font-size: .8em;
    height: 100px;
}

/* forms */
fieldset {
    border: none;
    margin: 0;
    padding: 0;
}

    fieldset legend {
        display: none;
    }

    fieldset ol {
        padding: 0;
        list-style: none;
    }

        fieldset ol li {
            padding-bottom: 5px;
        }

label.checkbox {
    display: inline;
}

label.required {
    background: transparent url(../../images/icons/required.png) no-repeat 0px;
    padding-left: 14px;
    color: #b94a48;
    white-space: nowrap;
}

input[type="time"],
input[type="text"],
input[type="password"],
textarea,
select {
    border: 1px solid #e2e2e2;
    background: #fff;
    color: #333;
    margin: 0 0 0 0;
    padding: 4px 6px;
}

/* The DateTime editor template: a text box plus flatpickr's calendar trigger, kept on one line in
   a narrow dialog cell. */
.date-picker-group {
    display: inline-block;
    white-space: nowrap;
}

    .date-picker-group > .flatpickr {
        display: inline-flex;
        align-items: center;
        gap: 2px;
        margin-right: 4px;
    }

    .date-picker-group .flatpickr-trigger {
        line-height: 0;
        cursor: pointer;
    }

.datePickerInput {
    width: 100px !important;
}

textarea {
    font-family: inherit;
    width: 500px;
}

    input:focus, textarea:focus {
        border: 1px solid #7ac0da;
    }

/* Undoes the portal's generic text-input styling for native checkboxes.
   Bootstrap 5's .form-check-input is excluded because it is not a native
   checkbox any more - it paints its own border, its tick from a background
   image, and sizes itself to 1em. This selector's specificity (0,1,1)
   outranks .form-check-input (0,1,0), so without the :not() it strips all
   three: `border: inherit` and `background: transparent` erase the box and
   the tick, and `width: auto` collapses a floated appearance:none control
   to zero width, leaving the checkbox invisible. */
input[type="checkbox"]:not(.form-check-input) {
    background: transparent;
    border: inherit;
    width: auto;
}

/* info and errors */
.message-info {
    border: 1px solid;
    clear: both;
    padding: 10px 20px;
}

.message-error {
    clear: both;
    color: #e80c4d;
    font-size: 1.1em;
    font-weight: bold;
    margin: 20px 0 10px 0;
}

.alert-success {
    font-weight: bold;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
}

.alert-error {
    background-image: -webkit-linear-gradient(top,#f2dede 0%,#e7c3c3 100%);
    background-image: -o-linear-gradient(top,#f2dede 0%,#e7c3c3 100%);
    background-image: -webkit-gradient(linear,left top,left bottom,from(#f2dede),to(#e7c3c3));
    background-image: linear-gradient(to bottom,#f2dede 0%,#e7c3c3 100%);
    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede',endColorstr='#ffe7c3c3',GradientType=0);
    background-repeat: repeat-x;
    border-color: #dca7a7;
    color: #b94a48;
}

.alert-success span {
    background: url(../../Images/icons/tick.png) no-repeat 0 0;
    padding-left: 25px;
}

.alert-error h4,
.validation-summary-errors span {
    margin-top: 2px;
    color: #b94a48;
    font-size: 1em;
}

    .alert-error h4 .fa-exclamation-circle {
        margin-right: 3px;
    }

.alert-error ul li {
    word-wrap: break-word;
    max-width: 100%;
}

.message-success {
    color: #7ac0da;
    font-size: 1.3em;
    font-weight: bold;
    margin: 20px 0 10px 0;
}

.error {
    color: #e80c4d;
}

.field-validation-error {
    color: #e80c4d;
    font-weight: bold;
}

.field-validation-valid {
    display: none;
}

.field-input.input-validation-error,
div.input-validation-error,
span.input-validation-error,
input.input-validation-error,
select.input-validation-error,
textarea.input-validation-error {
    border: 1px solid #e80c4d !important;
}

input[type="checkbox"].input-validation-error {
    border: 0 none;
}

.validation-summary-errors {
    color: #b94a48;
}

    .validation-summary-errors span {
        font-size: 14px;
        font-weight: bold;
        display: block;
        margin-bottom: 10px;
        padding-bottom: 3px;
    }

.validation-summary-valid {
    display: none;
}

.dialogError {
    padding-bottom: 0 !important;
    padding-right: 30px !important;
}


/* tables
----------------------------------------------------------*/
table {
    border-collapse: collapse;
    border-spacing: 0;
    margin: 0 0 0 0;
    border: 0 none;
}

th {
    font-size: 1.2em;
    text-align: left;
    border: none 0px;
    padding-left: 0;
}

    th a {
        display: block;
        position: relative;
    }

        th a:link, th a:visited, th a:active, th a:hover {
            color: #333;
            font-weight: 600;
            text-decoration: none;
            padding: 0;
        }

        th a:hover {
            color: #000;
        }

    th.asc a, th.desc a {
        margin-right: .75em;
    }

        th.asc a:after, th.desc a:after {
            display: block;
            position: absolute;
            right: 0em;
            top: 0;
            font-size: 0.75em;
        }

        th.asc a:after {
            content: '▲';
        }

        th.desc a:after {
            content: '▼';
        }

table.contentTable tr td.contentPanel table tr td {
    padding: 3px 3px;
    margin: 0 0 0 0;
    border: 0 none;
}

div.buttonBar {
    margin-top: 25px;
    padding-top: 25px;
    text-align: center;
}

.table {
    border: 1px solid #e9ecef;
}

/* GRID STYLES */

/* Alternating row shading. Bootstrap's own default for --bs-table-striped-bg is
   rgba(0, 0, 0, 0.05), which is what v2 shipped and what the portal has always
   shown; Uplon v3 overrides it at :root with rgba(var(--bs-light-rgb), 0.45) -
   45% of #f8f9fa, itself an almost-white grey. Over a white row that resolves to
   about rgb(252, 252, 253): roughly a 2/255 step, which is not a stripe anyone
   can see. Bootstrap's value is a 13/255 step.

   Set on the grid table rather than at :root so this is scoped to grids and
   leaves any other .table-striped in the portal on the theme's value. The
   variable is the theme's own mechanism - Bootstrap 5 paints the stripe as an
   inset box-shadow on each cell (`.table > :not(caption) > * > *`), not as a row
   background, so overriding background-color on tr or td would not work here. */
div.DataGrid > table {
    --bs-table-striped-bg: rgba(0, 0, 0, 0.05);
}

div.DataGrid table thead tr,
div.DataGrid table thead tr td a {
    color: #495057;
    background-color: #f8f9fa;
    border-color: #e9ecef;
    border-bottom: 2px solid #e9ecef;
}

div.DataGrid > table > thead > tr > td {
    white-space: nowrap;
}

    div.DataGrid > table > thead > tr > td > .badge {
        margin-left: 5px;
    }

div.DataGrid > table > tfoot > tr {
    background-color: #ddd;
    border-left: #ccc 1px solid;
    border-right: #ccc 1px solid;
    border-top: #ccc 1px solid;
    border-bottom: #ccc 1px solid;
}

    div.DataGrid > table > tfoot > tr > td {
        padding: 5px 5px;
        text-align: right;
        font-weight: bold;
        color: #696969;
    }

span.LoadGridText {
    display: block;
    text-align: center;
    margin: 0 0;
    padding: 30px 0 15px 0;
    background: url(../../Images/ajax-loader.gif) no-repeat center 15px;
}

/* LOGIN HEADER */
section.loginHeader {
    padding-top: 10px;
}

    section.loginHeader div.loginLink {
        padding-right: 5px;
        color: white;
    }

/* LEFT MENU BAR */
.left-menu-nav,
.left-menu-sub-nav {
    background-color: #ffffff;
    margin: 0px 0px 0px !important;
    padding: 0px !important;
    border-radius: 6px;
    width: 230px;
    box-shadow: 0px 1px 4px rgba(0,0,0,0.065);
    -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, .065);
    -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, .065);
    -moz-border-radius: 6px;
    -webkit-border-radius: 6px;
}

    .left-menu-nav > li > a,
    .left-menu-sub-nav > li > a {
        margin: 0 0 !important;
        padding: 8px 8px !important;
        border-left: 1px solid rgb(229, 229, 229);
        border-top: 1px solid rgb(229, 229, 229);
        border-right: 1px solid rgb(229, 229, 229);
        border-bottom: 0;
        width: 214px;
        display: block;
        color: #A4172A;
    }

    .left-menu-sub-nav > li > a {
        padding-left: 20px !important;
        width: 202px;
    }

    .left-menu-nav > li:first-child > a {
        border-radius: 6px 6px 0px 0px;
        -moz-border-radius: 6px 6px 0 0;
        -webkit-border-radius: 6px 6px 0 0;
    }

    .left-menu-nav > li:last-child > a {
        border-radius: 0px 0px 6px 6px;
        -moz-border-radius: 0 0 6px 6px;
        -webkit-border-radius: 0 0 6px 6px;
    }

    .left-menu-nav > .active > a,
    .left-menu-sub-nav > .active > a {
        padding: 9px 15px;
        border: 0px currentColor;
        position: relative;
        z-index: 2;
        box-shadow: inset 1px 0px 0px rgba(0,0,0,0.1), inset -1px 0px 0px rgba(0,0,0,0.1);
        text-shadow: 0px 1px 0px rgba(0,0,0,0.15);
        -moz-box-shadow: inset 1px 0 0 rgba(0, 0, 0, .1), inset -1px 0 0 rgba(0, 0, 0, .1);
        -webkit-box-shadow: inset 1px 0 0 rgba(0, 0, 0, .1), inset -1px 0 0 rgba(0, 0, 0, .1);
    }

    .left-menu-nav .icon-chevron-right,
    .left-menu-nav .icon-chevron-down,
    .left-menu-sub-nav .icon-chevron-right,
    .left-menu-sub-nav .icon-chevron-down {
        margin-top: 2px;
        margin-right: -6px;
        float: right;
        opacity: 0.25;
    }

    .left-menu-nav > li > a:hover,
    .left-menu-sub-nav > li > a:hover {
        background-color: rgb(245, 245, 245);
    }

    .left-menu-nav a:hover .icon-chevron-right,
    .left-menu-sub-nav a:hover .icon-chevron-right,
    .left-menu-nav a:hover .icon-chevron-down,
    .left-menu-sub-nav a:hover .icon-chevron-down {
        opacity: 0.5;
    }

    .left-menu-nav .active .icon-chevron-right,
    .left-menu-sub-nav .active .icon-chevron-right,
    .left-menu-nav .active .icon-chevron-down,
    .left-menu-sub-nav .active .icon-chevron-down {
        opacity: 1;
        background-image: url("../content/bootstrap/img/glyphicons-halflings-white.png");
    }

    .left-menu-nav .active a:hover .icon-chevron-right,
    .left-menu-sub-nav .active a:hover .icon-chevron-right,
    .left-menu-nav .active a:hover .icon-chevron-down,
    .left-menu-sub-nav .active a:hover .icon-chevron-down {
        opacity: 1;
        background-image: url("../content/bootstrap/img/glyphicons-halflings-white.png");
    }

span.WaitDialog {
    background: #ffffff url('../../Images/ajax-loader2.gif') no-repeat 3px 18px;
    padding-left: 25px;
    padding-top: 20px;
    padding-bottom: 20px;
    display: inline-block;
    font-weight: bold;
}

td.contentPanel {
    padding-top: 20px !important;
}

table.PasswordStrengthWrapper {
    margin-left: 10px;
    margin-top: 0;
    margin-right: 0;
    margin-bottom: 0;
}

    table.PasswordStrengthWrapper tbody tr td {
        margin: 0 !important;
        padding: 0 !important;
    }

div.PasswordStrengthFrame,
div.PasswordStrengthScore,
div.PasswordStrengthVeryWeak,
div.PasswordStrengthWeak,
div.PasswordStrengthGood,
div.PasswordStrengthStrong,
div.PasswordStrengthVeryStrong {
    height: 15px;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

div.PasswordStrengthScore {
    text-align: center;
    width: 100%;
    z-index: 2;
}

div.PasswordStrengthVeryWeak {
    background-color: #d9534f;
}

div.PasswordStrengthWeak {
    background-color: #f0ad4e;
}

div.PasswordStrengthGood,
div.PasswordStrengthStrong,
div.PasswordStrengthVeryStrong {
    background-color: #d6e9c6;
}

div.PasswordStrengthContainer,
div.PasswordStrengthFrame {
    width: 75px;
}

div.PasswordStrengthFrame {
    border-left: 1px #999999 solid;
    border-top: 1px #999999 solid;
    border-right: 1px #999999 solid;
    border-bottom: 1px #999999 solid;
    position: relative;
}

td.PasswordStrengthText {
    text-align: center;
    padding-top: 0 !important;
    padding-bottom: 2px !important;
    padding-right: 0 !important;
    padding-left: 0 !important;
}

.alert-error a {
    color: #3a87ad;
}

div.GridPager {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

div.GridPager > span {
    display: inline-block;
    text-align: left;
}

    div.GridPager > span > span {
        float: left;
    }

        div.GridPager > span > span.row-count {
            padding-left: 10px;
            vertical-align: middle;
            line-height: 32px;
        }

div.GridPager > nav {
    margin-left: auto;
}

i.icon-sort-up {
    width: 12px;
    height: 12px;
    background: url(../../Images/icons/up_arrow_small.png);
    display: inline-block;
}

i.icon-sort-down {
    width: 12px;
    height: 12px;
    background: url(../../Images/icons/down_arrow_small.png);
    display: inline-block;
}

td.FieldLabel {
    text-align: right;
    padding-right: 5px;
}

label.checkbox span {
    display: inline-block;
    padding-top: 2px;
}

    label.checkbox span.checkbox-wrapper {
        padding: 0;
        margin-right: 3px;
    }

.break-text {
    overflow-wrap: break-word;
    word-wrap: break-word;
    -ms-word-break: break-all;
    word-break: break-all;
    -ms-hyphens: auto;
    -moz-hyphens: auto;
    -webkit-hyphens: auto;
    hyphens: auto;
}

.nav-icon {
    opacity: 0.35;
    margin-right: 5px !important;
    color: #000000;
    height: 14px;
    line-height: 14px;
}

    .nav-icon.fa {
        font-size: 1.25em;
        padding-left: 2px;
    }

.nav-link.active i.nav-icon {
    opacity: 1;
}

ul.breadcrumb li {
    vertical-align: middle;
}

    ul.breadcrumb li i {
        opacity: 0.5;
        margin-top: -1px;
        padding-right: 5px;
    }

        ul.breadcrumb li i.fa {
            font-size: 14px;
        }

.breadcrumb-item .svg-inline--fa {
    width: 20px;
}

.DataGrid {
    margin-top: 20px;
}

div.NoPermission span {
    padding-left: 5px;
}

.status-text {
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    padding: 10px 10px;
    width: 260px;
    border-width: 2px;
    border-style: solid;
    margin: 5px 5px;
    float: right;
}

.headerText {
    font-size: 16px;
    font-weight: bold;
    padding-bottom: 10px;
}

.headerText-padding {
    padding-top: 5px;
}

.no-bottom-padding {
    padding-bottom: 0;
}

.search-text {
    width: 643px;
}

.panel .search-text {
    width: 616px;
}

#wrapperTable tr td {
    padding-left: 0;
    padding-top: 0;
}

.fieldLabelCell {
    text-align: right;
}

.datepicker {
    width: 75px;
}

/* PROGRESS BARS */
div.ProgressText {
    padding-bottom: 10px;
    text-align: center;
    font-size: 0.9em;
}

div.ProgressDialog {
    height: 80px;
    padding: 10px 10px 40px;
    border-bottom-left-radius: 0 !important;
    border-bottom-top-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-bottom-bottom-radius: 0 !important;
}

.ui-progressbar-value {
    padding-top: 7px;
    text-align: center;
}

.user-top-label {
    padding-left: 3px;
    padding-right: 3px;
    text-shadow: none;
    color: #ffffff;
}

.user-top-caret {
    border-top-color: #ffffff;
    border-bottom-color: #ffffff;
}

.no-padding {
    padding: 0 0 !important;
}

.no-margin {
    margin: 0 0 !important;
}

table.no-padding tr td {
    padding: 0 0 !important;
}

table.no-margin tr td {
    margin: 0 0 !important;
}

.panel-heading > i,
.panel-heading > .headerText > i {
    margin-top: 3px;
}

.menu-expanded {
    background-color: #f5f5f5;
}

.DataGrid .btn-link {
    font-family: Verdana, ​ Helvetica, ​ sans-serif;
    background-color: transparent;
    margin: 0 !important;
    padding: 0 !important;
    border-width: 0 !important;
}

    .DataGrid .btn-link.disabled {
        color: #A9A9A9;
        margin-top: -3px !important;
    }

#SessionTimeout .modal-header {
    text-align: left !important;
}

.left-label {
    text-align: right;
    padding-right: 5px;
}

.tooltip-wrapper {
    display: inline-block;
}

    .tooltip-wrapper .btn[disabled] {
        pointer-events: none;
    }

    .tooltip-wrapper.disabled {
        cursor: not-allowed;
    }

.btn > i {
    margin-right: 5px;
}

.btn-link.disabled {
    background-color: transparent !important;
}

.btn-link > i.fa {
    font-size: 12px !important;
}

.portal-list {
    padding-top: 10px;
    margin-left: 380px;
    float: left;
}

    .portal-list .left-label {
        padding-right: 5px;
        text-align: right;
        color: #ffffff;
    }

#ddPortalList {
    width: 375px;
}

.select-column {
    width: 16px;
    text-align: center !important;
}

.DataGrid > table > tbody > tr > td.icon-column {
    width: 25px;
    padding-left: 7px;
    padding-right: 7px;
}

.page-size > select {
    width: 60px;
}

#PasswordStrength {
    position: absolute;
    right: 6px;
    top: 2px;
    font-size: .85714em;
}

div.PasswordStrengthFrame {
    border-left: 1px #d9d9d9 solid !important;
    border-top: 1px #d9d9d9 solid !important;
    border-right: 1px #d9d9d9 solid !important;
    border-bottom: 1px #d9d9d9 solid !important;
}

input[type="text"][readonly],
textarea[readonly],
select:disabled {
    background-color: #eee;
}

.full-height-card {
    height: calc(100% - 24px);
}

.card-header {
    border-left: #d9d9d9 1px solid;
    border-right: #d9d9d9 1px solid;
    border-top: #d9d9d9 1px solid;
}

.card-body {
    border-left: #d9d9d9 1px solid;
    border-right: #d9d9d9 1px solid;
    border-top: #d9d9d9 1px solid;
    border-bottom: #d9d9d9 1px solid;
}

.dropdown-item svg {
    margin-right: 5px;
    opacity: 0.75;
}

.tab-content {
    background: #fff;
    border-left: #efefef 1px solid;
    border-right: #efefef 1px solid;
    border-bottom: #efefef 1px solid;
    padding: 25px 15px;
}

.button-divider {
    margin-top: 25px;
    padding-top: 25px;
    text-align: center;
}

.hidden {
    display: none;
}

.authentication-bg .application-version {
    text-align: center;
    margin-top: 2em;
}

.bg-theme {
    background-color: #2b3d51;
}

.divider-vertical {
    margin: 0 9px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.toast-success .toast-close-button {
    top: calc(50% - 7px);
}

.upload-container {
    border: 1px dotted #2b3d51;
    text-align: left;
    vertical-align: middle;
    padding: 10px 10px 10px 10px;
    margin-top: 10px;
    margin-bottom: 10px;
    background-color: #f5f5f5;
    border-radius: 5px;
}

    .upload-container > .upload-footer > .upload-message {
        margin-right: 10px;
    }

.move-list {
    height: 200px;
}

    .move-list > table {
        width: 100%;
        height: 100%;
    }

    .move-list > tbody > tr > td > div {
        height: 100%;
    }

        .move-list > tbody > tr > td > div > select {
            height: 100%;
            width: 210px;
        }

    .move-list > tbody > tr > td.add-remove-buttons,
    .move-list > tbody > tr > td.up-down-buttons {
        vertical-align: middle;
        padding: 10px 10px;
    }

        .move-list > tbody > tr > td.add-remove-buttons > button {
            display: block;
            width: 100px;
            margin-bottom: 5px;
        }

        .move-list > tbody > tr > td.up-down-buttons > button {
            margin-bottom: 5px;
        }

        .move-list > tbody > tr > td.add-remove-buttons > button > span {
            display: inline-block;
        }

            .move-list > tbody > tr > td.add-remove-buttons > button > span.text-left {
                margin-right: 5px;
            }

            .move-list > tbody > tr > td.add-remove-buttons > button > span.text-right {
                margin-left: 5px;
            }

.custom-checkbox.input-validation-error .custom-control-label::before {
    border: 1px solid #e80c4d !important;
}

.custom-checkbox label.custom-control-label {
    font-weight: normal;
}

textarea {
    resize: none;
    overflow-y: scroll;
}

.modal-title svg {
    margin-right: 5px;
}

.modal-footer .container-fluid {
    padding-left: 0;
    padding-right: 0;
}

@media (max-width: 767.5px) {
    .btn {
        width: 100%;
        margin-bottom: 5px;
    }
}

#side-menu > li > a > svg {
    width: 20px;
}

/* STYLES FOR STACK TRACE */
.st-type {
    color: #A19599;
    font-weight: bolder;
}

.st-method {
    color: #8D561F;
    font-weight: bolder;
}

.st-frame-params {
    color: #212529;
    font-weight: normal;
}

.st-param-type {
    color: #0a8472;
}

.st-param-name {
    color: #212529;
}

.st-file {
    color: #212529;
}

.st-line {
    color: #A3235E;
}

/* Pin the grid pager to the horizontal scroll viewport. The .DataGrid container
   is the horizontal scroll element, and the framework renders .GridPager as a
   block child of it - so by default the pager is anchored at the table's content
   origin (content-space left:0) and slides leftward, "floating" mid-grid, as the
   user scrolls right. A block child of an overflow-x:auto box is only as wide as
   the viewport (not the scroll width), so sticky left:0 keeps the pager's left
   edge at the scrollport: the right-aligned nav/pagination stays pinned right and
   the row-count stays left. Harmless (no-op) for grids that don't scroll. */
.DataGrid > div.GridPager {
    position: sticky;
    left: 0;
}
/* ============================================================================
   RMG mobile/card CSS parity (ported 2026-06-07)
   Grid sort-header reset (UI.Grid .127+) + Phase 0 mobile foundation + card
   polish + grid totals-footer card view. Portal-agnostic framework/theme
   selectors; RMG-specific selectors (cubics, etc.) are harmless no-ops.
   ============================================================================ */

    /* UI.Grid (>= .127) renders sortable column headers as a
       <button class="grid-sort-button"> instead of an <a> (for a11y:
       role="columnheader" / aria-sort). The old "thead td > a" styling no
       longer matches, so the buttons fall back to native chrome (a 2px outset
       border box). Reset them to read as plain, left-aligned header text. */
    .DataGrid .grid-sort-button {
        padding: 0;
        border: 0;
        background: transparent;
        font: inherit;
        color: #495057;
        cursor: pointer;
        text-align: inherit;
    }

        .DataGrid .grid-sort-button:hover {
            text-decoration: underline;
        }

/* ==========================================================================
   MOBILE-FIRST FOUNDATION (Phase 0)
   Cross-cutting responsive rules for phone/tablet. site.css loads AFTER
   app.css, so these override the theme. Everything is scoped to
   <= 767.98px (Bootstrap's md breakpoint) so desktop is untouched. Per-module
   and per-page mobile polish (Inventory, VesselLoading, ...) builds on top.
   Note: module modal-width overrides are all gated to @media (min-width:1200px),
   so on mobile Bootstrap's near-full-width modal defaults already apply — the
   real mobile gaps are form-field stacking, popup overflow, and shell chrome.
   ========================================================================== */
@media (max-width: 767.98px) {

    /* --- Forms: stack the label above the input --------------------------
       Module forms use a fixed-width left label (.left-label, often
       ID-scoped) or a table-based field layout (.field-wrapper) that stays
       side-by-side and overflows a phone. Force a stacked (label-over-input)
       layout. !important beats the ID-scoped per-dialog width rules. */
    .left-label {
        width: auto !important;
        display: block !important;
        margin-bottom: 0.25rem;
        text-align: left !important;
    }

    .field-wrapper,
    .field-wrapper > tbody,
    .field-wrapper > tbody > tr {
        display: block !important;
        width: 100% !important;
    }

        .field-wrapper > tbody > tr > td {
            display: block !important;
            width: 100% !important;
            padding: 2px 0 !important;
        }

    /* --- Server-rendered wide tables scroll, not the page ----------------
       Some grids (e.g. VesselLoading's barge tables and the stow plan) are
       server-rendered <table>s inside .DataGrid.table-responsive, not
       client-rendered grids that collapse into cards. Here the wrapper's
       overflow-x resolves to visible, so a table wider than the phone pushes
       the whole page into horizontal scroll. Constrain it so the wide table
       scrolls inside its own box instead. (Card-collapsing grids have no
       overflow, so this is a no-op for them.) */
    .DataGrid.table-responsive {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    /* --- Fixed-width form controls cap to the container ------------------
       Some dialogs hardcode a control width (e.g. a comments textarea at
       width:500px) that overflows a phone and pushes the page into
       horizontal scroll even while the dialog is off-screen. Cap to the
       container; box-sizing keeps padding/border inside the cap. */
    textarea {
        max-width: 100% !important;
        box-sizing: border-box;
    }

    /* A native <select> sizes to its widest option, so a long option (e.g. a
       commodity name) can push the control past a narrow dialog and force the
       modal to scroll horizontally. Cap selects inside dialogs to the
       container. (Scoped to .modal so page/grid editors are untouched.) */
    .modal select {
        max-width: 100% !important;
    }

    /* --- Autocomplete / date-picker popups fit the viewport --------------
       Tom Select dropdowns append to <body> and size to their widest option
       (min-width: max-content); flatpickr calendars can overflow a narrow
       screen. Cap both to the viewport so options stay reachable. */
    body > .ts-dropdown,
    .ts-wrapper .ts-dropdown {
        max-width: 95vw !important;
        min-width: 0 !important;
    }

    .flatpickr-calendar {
        max-width: 95vw !important;
    }

    /* Bootstrap popovers append to <body> and some modules widen them to a
       fixed width (e.g. .popover { width:400px; max-width:none }), which
       overflows a phone narrower than that width. Cap to the viewport. */
    .popover {
        max-width: calc(100vw - 1rem) !important;
    }

    /* --- Modal button rows wrap instead of overflowing ------------------- */
    .modal .button-container {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    /* Making .button-container a flexbox (above) defeats its .text-center
       (text-align does not center flex items — they default to flex-start),
       so a centered section button like "Add Email" ends up left-aligned on
       mobile. Honor the centering intent under flex. */
    .modal .button-container.text-center {
        justify-content: center;
    }

    /* Many dialogs lay out their footer buttons as a 2-cell <table> (a
       text-left group — often a save-progress spinner — and a text-right
       button group). On a phone the cells stay side-by-side and the buttons
       overflow. Stack the cells full-width so each group wraps cleanly, and
       give the buttons a little vertical breathing room for touch. Shared
       across every module's dialogs (Inventory, Common, Railcar, ...). */
    .modal-footer > table,
    .modal-footer > table tbody,
    .modal-footer > table tr {
        display: block;
        width: 100%;
    }

    .modal-footer > table td {
        display: block;
        width: 100% !important;
        max-width: none !important;
    }

    .modal-footer > table .btn {
        margin-top: 0.25rem;
    }

    /* --- App shell ------------------------------------------------------- */
    /* Treat the slide-in left menu as a modal drawer: dim + scroll-lock the
       page behind it (menu.js already toggles body.sidebar-enable and closes
       on outside click). The sidebar is z-index 10 when open, so the backdrop
       sits just under it at 9. */
    body.sidebar-enable {
        overflow: hidden;
    }

        body.sidebar-enable::before {
            content: "";
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.4);
            z-index: 9;
        }

    /* The profile dropdown is a fixed 200px and the portal switcher is laid
       out for desktop (fixed width + large left margin); both cause horizontal
       overflow on a phone. Let them fit the viewport. */
    .profile-dropdown {
        width: auto !important;
        max-width: 90vw;
    }

    .portal-list {
        margin-left: 0 !important;
        max-width: 100%;
    }

        .portal-list #ddPortalList,
        #ddPortalList {
            width: 100% !important;
            max-width: 100%;
        }

    /* Align the page-title gutters with the reduced mobile content padding so
       the title box doesn't overhang and trigger horizontal scroll. */
    .page-title-box {
        padding-left: 10px !important;
        padding-right: 10px !important;
        margin-left: -10px !important;
        margin-right: -10px !important;
    }

    /* Keep toasts on-screen, below the topbar, and full-width (clear of the
       sidebar drawer) instead of a fixed top-right box that can clip. */
    #toast-container {
        top: 80px !important;
        right: 10px !important;
        left: 10px !important;
        width: auto !important;
    }

        #toast-container > div {
            width: 100% !important;
            max-width: none !important;
        }

    /* --- Touch targets: enlarge small controls toward ~44px -------------
       Grid per-row action buttons/icons, pager links, the modal close
       button, and nested (level 2-3) menu items all render below the ~44px
       touch minimum. Enlarge the tap area (and the tiny 11px grid-button
       glyph). In the responsive card layout the action buttons ride the
       card's top-right corner, so this enlarges them there too. */

    /* Per-row grid action buttons (edit/delete/print) — were 27x27 @ 11px */
    .DataGrid > table > thead > tr > td > .button-container > button,
    .DataGrid > table > tbody > tr > td > .button-container > button {
        width: 40px !important;
        height: 40px !important;
        font-size: 15px !important;
    }

    /* Per-row action icon links (edit / delete / info) */
    .DataGrid td.icon-column a,
    .DataGrid td.edit-column a,
    .DataGrid td.delete-column a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 40px;
        min-height: 40px;
    }

    /* Grid pager links */
    .GridPager .page-link {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 40px;
        min-height: 40px;
        padding: 0.4rem 0.6rem;
    }

    /* Modal close button */
    .modal .close {
        min-width: 44px;
        min-height: 44px;
        padding: 0.25rem 0.6rem;
        font-size: 1.6rem;
    }

    /* Nested sidebar menu items (drawer, level 2-3) — were ~26px tall */
    .nav-second-level li a,
    .nav-thrid-level li a {
        padding-top: 11px !important;
        padding-bottom: 11px !important;
        padding-left: 16px !important;
    }

    /* --- Responsive card polish ----------------------------------------- */

    /* Empty/colspan message rows ("No rows to display.", loading) inherit the
       card value alignment (right); center them across the card. */
    .mt-grid-responsive tbody td[colspan] {
        text-align: center !important;
        justify-content: center !important;
    }

    /* Hide the grid's own outer frame (div.DataGrid > table draws
       border-left/right/bottom) once it has collapsed into cards — the per-card
       borders are the only frame wanted in card view. */
    .DataGrid.mt-grid-responsive > table {
        border: 0 !important;
    }

    /* Tighten the dead space around a card-collapsed grid: the .card-body
       padding (20px) stacks with the grid's own top margin (20px) and its
       table's bottom margin (16px) into ~40px gaps on a phone. */
    .card-body:has(.mt-grid-responsive) {
        padding: 0.5rem;
    }

    .DataGrid.mt-grid-responsive {
        margin-top: 0;
    }

        .DataGrid.mt-grid-responsive > table {
            margin-bottom: 0;
        }

    /* Each card carries a bottom margin for inter-card spacing; on the last
       card that margin lands against the card-body padding and makes the
       below-grid gap larger than the above-grid gap. Drop it so the stack is
       flush and the whitespace above/below the grid is equal. */
    .mt-grid-responsive tbody tr:last-child {
        margin-bottom: 0;
    }

    /* With the last card flush (above) and the table's bottom margin zeroed,
       the pager would butt against the last card; restore a gap above it. */
    .mt-grid-responsive .GridPager {
        margin-top: 0.75rem;
    }

    /* Cubics/Holds table: the Cubics + Depth fields use float:left to sit side
       by side on desktop. Once the table cells stack on mobile (Phase 0), the
       uncleared floats leak into the next row and shove each following hold's
       "Available" checkbox to the right edge. Drop the float so each hold
       stacks cleanly (available checkbox, then Cubics, then Depth). */
    .cubics-wrapper .holds-table .field {
        float: none;
    }

    /* Card-header bars (e.g. "Search Options") lay out their title + collapse
       caret as a 2-cell .field-wrapper table. The generic .field-wrapper
       stacking (above) drops the caret onto its own line; keep header
       field-wrappers as a single title-left / caret-right row. */
    .card-header .field-wrapper {
        display: table !important;
        width: 100% !important;
    }

        .card-header .field-wrapper > tbody {
            display: table-row-group !important;
        }

        .card-header .field-wrapper > tbody > tr {
            display: table-row !important;
        }

            .card-header .field-wrapper > tbody > tr > td {
                display: table-cell !important;
                width: auto !important;
            }

    /* A centered section button (e.g. "Add Email") sits in a .button-container
       with a .divider spacer; once the container is flex the divider shares
       the line and pushes the button off-center — give it its own row. */
    .modal .button-container.text-center .divider {
        flex-basis: 100%;
    }
}

/* ==========================================================================
   GRID TOTALS FOOTER IN CARD VIEW
   A grid <tfoot> totals row is laid out to align each total under its column
   (the non-total columns are empty cells carrying colspan). If it cards like a
   data row, those empty spacer cells stack into a tall mostly-blank block
   (e.g. the LoadOrders Lots grid showed ~282px of empty lines below the data).
   Instead, present the footer as one compact, bold, right-aligned totals line:
   hide the empty colspan spacer cells, drop the data-label gutter, and set off
   the row with a top border so the totals stay visible but tidy.
   ========================================================================== */
@container (max-width: 600px) {
    .mt-grid-responsive tfoot {
        display: block;
    }

    .mt-grid-responsive tfoot tr {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-end;
        align-items: baseline;
        gap: 0.25rem 0.75rem;
        margin-top: 0.25rem;
        padding: 0.5rem 0.75rem;
        border-top: 2px solid var(--mt-grid-card-border, #dee2e6);
        font-weight: 600;
    }

    .mt-grid-responsive tfoot td {
        display: inline-block;
        min-height: 0;
        padding: 0;
        border: 0;
        text-align: right;
    }

        /* Empty alignment spacers (they carry colspan); the totals are in the
           non-spanning cells. */
        .mt-grid-responsive tfoot td[colspan] {
            display: none;
        }

        .mt-grid-responsive tfoot td::before {
            content: none;
        }
}

/* ---------------------------------------------------------------------------
   Uplon v3 chrome compatibility.

   The page-title markup (.page-title-box > .page-title-right + h4.page-title)
   is unchanged from Uplon v2, but v3 ships rules for .page-title-box only. With
   .page-title and .page-title-right undefined the breadcrumb stops floating and
   stacks above the heading, and the heading falls back to the plain h4 size
   (15.84px instead of 18px).

   Values taken from the v2 stylesheet still in use by RMG. v2's
   `line-height: 60px` on .page-title is deliberately not carried over - it set
   the bar height there, whereas v3 gets the same height from the
   `padding: 20px 24px` on .page-title-box, and applying both makes the bar
   ~100px tall.
   --------------------------------------------------------------------------- */
.page-title-box .page-title {
    font-size: 18px;
    margin: 0;
}

/* v2 paired `margin-top: 7px` here with a `.breadcrumb { padding: .75rem 0 }`
   and a 60px-tall title line, and the three together centred the breadcrumb
   against the heading. v3 gets the bar height from padding instead, so the two
   inherited offsets now stack on top of that padding and push the breadcrumb
   ~20px below the heading it is supposed to sit beside. Both are zeroed, which
   lands the breadcrumb's centre within 1px of the heading's. */
.page-title-box .page-title-right {
    float: right;
    margin-top: 0;
}

.page-title-box .breadcrumb {
    margin-bottom: 0;
    padding: 0;
}

/* v3 sizes the sidebar logo from a token rather than letting it fill its
   container the way v2 did, and its default suits a compact wordmark. PCI's
   logo is 738x227, so 22px rendered it 72px wide against ~196px of available
   sidebar width. Overriding the token keeps the theme's own mechanism. */
:root {
    --bs-logo-lg-height: 54px;
}

/* v3 dropped .noti-title, which v2 used to give the user-menu dropdown header a
   solid brand bar. Without it "Welcome <name>" renders as plain unpadded text.
   Colour taken from the v2 stylesheet (#64b0f2), expressed through the theme's
   primary token so a brand change keeps them in step. */
.dropdown-menu .noti-title {
    background-color: var(--bs-primary, #64b0f2);
    padding: 15px 20px;
    border-radius: .25rem .25rem 0 0;
    margin-top: -7px;
}

    .dropdown-menu .noti-title,
    .dropdown-menu .noti-title h5,
    .dropdown-menu .noti-title h6 {
        color: #fff;
    }

/* Sidebar menu.

   v2 styled the links as `#sidebar-menu > ul > li > a` at 15.5px in a soft grey
   (#6e768e) with no font-weight, so they sat at the body's normal 400 and
   inherited the body's 1.5 line-height. v3 restyles the same links as
   `.side-nav-link`, driving all of it from tokens: `--bs-menu-item-color`
   (#495057), `font-weight: 500`, and a font-size AND line-height both set from
   `--bs-menu-item-font-size` (15px) - which is what makes the menu read as
   darker, heavier and tighter than the one this portal has always had.

   The colour goes through the theme's own variable, scoped to `.side-nav` so
   the states derived from it stay in step. Weight and size have to be reclaimed
   as properties, because v3 sets them from two places:

     .side-nav .side-nav-item .side-nav-link                           (0,3,0)
     .side-nav > .side-nav-item.active .side-nav-link.active,
     .side-nav > .side-nav-item.active > a                             (0,4,0)

   so a plain `.side-nav .side-nav-link` (0,2,0) loses to both - which is why
   the ACTIVE item in particular would stay bold. Matching the same selectors
   wins on source order, since site.css loads after app.min.css.

   The selected item: v3's default is a 10% tint of the theme blue with the
   label in that same blue, which against the white menu is so faint it barely
   reads as a selection. v2 used an opaque #f5f8fb band with the label in the
   PCI navy - `#sidebar-menu > ul > li > a.active { background: #f5f8fb;
   color: #003D79 }` - which is what the portal has always shown as "you are
   here". The background comes from the theme's token; the colour cannot,
   because a later v3 rule paints the active label from
   `--bs-menu-item-hover-color` and overrides `--bs-menu-item-active-color`, so
   it is set as a property on the same selectors.

   Sub-menu links are deliberately left at v3's size (14.25px): v2 gave them no
   size of their own, so they inherited the body's ~14.4px, and forcing the
   top-level 15.5px on them would make them bigger than they have ever been. */
.side-nav {
    --bs-menu-item-color: #6e768e;
    --bs-menu-item-active-bg: #f5f8fb;
}

    .side-nav .side-nav-item .side-nav-link,
    .side-nav > .side-nav-item.active .side-nav-link.active,
    .side-nav > .side-nav-item.active > a {
        font-weight: 400;
        line-height: 1.5;
    }

    .side-nav > .side-nav-item > .side-nav-link {
        font-size: 15.5px;
    }

    .side-nav > .side-nav-item.active > .side-nav-link,
    .side-nav > .side-nav-item.active .side-nav-link.active,
    .side-nav > .side-nav-item.active > a {
        color: #003D79;
    }

    /* v2's menu heading was 11px/600; v3 derives 10.5px/700 from the item
       font-size token. */
    .side-nav .side-nav-title {
        font-size: 11px;
        font-weight: 600;
    }

/* Card headers. v2 gave them a light grey band (#e9ecef, padding .75rem 1.25rem)
   that separated the title from the card body; v3 leaves them transparent at
   15px 20px, so the header and the body read as one undifferentiated block. */
.card > .card-header {
    background-color: #e9ecef;
    padding: 12px 20px;
}

/* The grid carries its own 20px top margin, which lands inside a .card-body
   that already pads 20px - so the gap above a grid was double the gap at its
   sides and below. Dropped only where the grid is the first thing in the card
   body (directly, or through the usual .row > .col-12 wrapper); a grid further
   down still needs the margin to separate it from whatever precedes it. */
.card-body > .DataGrid:first-child,
.card-body > .row:first-child > div:first-child > .DataGrid:first-child {
    margin-top: 0;
}

/* Tab and pill labels. v3 inherits Bootstrap's own .nav-link weight, which
   reads heavier than the rest of the portal's chrome - the sidebar links above
   are already pulled back to 400. Match them so tabs and the menu agree. */
.nav-pills > li > a,
.nav-tabs > li > a {
    font-weight: 400;
}
