.floating-labels .field-show-floating-label .field-label {
    -webkit-transform: none;
    transform: none;
    opacity: 1;
    z-index: 3;
}

    .floating-labels .field-show-floating-label .field-label.required {
        background: transparent url(../../images/icons/required.png) no-repeat right;
        color: #b94a48;
        padding-right: 13px;
    }

.floating-labels .field-show-floating-label .field-input {
    padding-top: 1.5em;
    padding-bottom: 0.35714em;
}

/* field-static-floating-label — the label is always docked above the
   input, regardless of whether the field has a value. The C# helper
   (e.g. FloatingLabelMilitaryDateTimePicker) sets this class together
   with field-show-floating-label on render; per-module sync JS that
   strips field-show-floating-label on empty fields shouldn't take
   this class with it. Without these rules the label inherits
   .field-label's default opacity:0 and disappears whenever the field
   is empty. Mirrors the field-show-floating-label ruleset. */
.floating-labels .field-static-floating-label .field-label {
    -webkit-transform: none;
    transform: none;
    opacity: 1;
    z-index: 3;
}

    .floating-labels .field-static-floating-label .field-label.required {
        background: transparent url(../../images/icons/required.png) no-repeat right;
        color: #b94a48;
        padding-right: 13px;
    }

.floating-labels .field-static-floating-label .field-input,
.floating-labels .field-static-floating-label .field-time,
.floating-labels .field-static-floating-label .field-date {
    padding-top: 1.5em;
    padding-bottom: 0.35714em;
}

.floating-labels .field-label,
.floating-labels .field-input {
    -webkit-transition: all 0.2s ease-out;
    transition: all 0.2s ease-out;
}

.floating-labels .field {
    width: 100%;
    float: left;
    padding: 0.42857em 0;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

.floating-labels .field-input-wrapper {
    position: relative;
}

    .floating-labels .field-input-wrapper.field-border {
        border-color: #d9d9d9;
        border-width: 1px;
        border-style: solid;
        border-radius: 5px;
    }

    .floating-labels .field-input-wrapper.readonly,
    .floating-labels .field.disabled .field-input-wrapper,
    .floating-labels .field-time-picker > .field-input-wrapper.readonly .field-date,
    .floating-labels .field-time-picker > .field-input-wrapper.readonly .field-time {
        background-color: #eeeeee;
    }

.floating-labels .field-label {
    font-size: 0.88em;
    font-weight: normal;
    position: absolute;
    top: 0;
    width: auto;
    margin-top: 0.42857em;
    margin-left: 1px;
    padding: 0 0.91667em;
    z-index: 1;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-transform: translateY(3px);
    transform: translateY(3px);
    pointer-events: none;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    opacity: 0;
    color: #737373;
    display: block;
    text-align: left;
    margin: 0.5em 0;
    overflow: hidden;
    max-width: calc(100% - 7px);
}

.floating-labels .field-input {
    background-color: white;
    color: #333333;
    border-color: #d9d9d9;
    border-width: 1px;
    border-style: solid;
    background-clip: padding-box;
    border-radius: 5px;
    display: block;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    width: 100%;
    padding: 0.92857em 0.78571em;
    word-break: normal;
    line-height: inherit;
}

    .floating-labels .field-input[disabled],
    .floating-labels .field-input[readonly],
    .floating-labels .field-input.readonly,
    .floating-labels .field-date.readonly {
        background-color: #eee;
    }

        .floating-labels .field-input.readonly > label {
            color: #737373;
        }

    /* A checkbox is focused through its inner <input>, so the focus ring has to
       be drawn on the wrapper rather than the control itself. */
    .floating-labels .field-input.field-input-checkbox:has(input:focus) {
        border-color: #64b0f2;
        -webkit-box-shadow: 0 0 0 1px #64b0f2;
        box-shadow: 0 0 0 1px #64b0f2;
        background-clip: padding-box;
        border-radius: 5px;
        border-style: solid;
    }

    .floating-labels .field-input.required::placeholder {
        color: #b94a48;
    }

/* ===== Dropdown placeholder->float (label-as-placeholder) =====
   Mirrors the framework's Scripts/Shared/assets/floating-labels.css. A <select>
   has no native placeholder, so an empty .field-select shows its own label in
   the placeholder position and floats it up on selection (shared.js / the
   framework initFloatingLabels toggles field-show-floating-label). The
   required.png marker sits right after the label text, same as the floated
   state. field-static-floating-label still opts a select out.

   Both states also test the selection directly via :has(option:checked), not just
   the JS class. A dropdown populated by AJAX after initFloatingLabels has run gets
   its value through jQuery .val(), which fires no change event, so the class never
   lands and the label would otherwise sit on top of the selected text.

   The test is "does the closed select render any text", i.e.
   option:checked:not(:empty) - NOT option:checked:not([value=""]). Cascading
   dropdowns disable themselves with a hint option that is deliberately
   value="" so it can never satisfy a required rule, yet still paints text:
   <option value="">Please select a job above ...</option>. Keying the float off
   the value left the label parked in the placeholder position directly on top of
   that hint. Only a genuinely blank option (<option value=""></option>, what the
   loaders prepend once real choices arrive) leaves the label as the placeholder.

   Scoped to :not(:has(.ts-wrapper)) so this only ever drives native dropdowns. A
   Tom Select field keeps its underlying <select> in sync, so it would match too -
   and floating its label while the autocomplete pilot rule below still has the
   .ts-control in placeholder mode (no reserved top padding, transparent) would
   reintroduce the very overlap this fixes. The pilot owns that state. */
.floating-labels .field-select:not(:has(.ts-wrapper)):has(select option:checked:not(:empty)) .field-label {
    -webkit-transform: none;
    transform: none;
    opacity: 1;
    top: 0;
    margin: 0.5em 0;
    font-size: 0.88em;
    z-index: 3;
}

.floating-labels .field-select:not(:has(.ts-wrapper)):has(select option:checked:not(:empty)) .field-input {
    padding-top: 1.5em;
    padding-bottom: 0.35714em;
}

.floating-labels .field-select:not(.field-show-floating-label):not(.field-static-floating-label) .field-label {
    opacity: 1;
    top: 50%;
    margin: 0;
    -webkit-transform: translateY(-50%);
    transform: translateY(-50%);
    font-size: 1em;
    color: #737373;
    max-width: calc(100% - 2.4em);
}

    .floating-labels .field-select:not(.field-show-floating-label):not(.field-static-floating-label) .field-label.required {
        background: transparent url(../../images/icons/required.png) no-repeat right;
        color: #b94a48;
        padding-right: 13px;
    }

    /* A disabled dropdown shouldn't advertise as required. */
    .floating-labels .field-select:not(.field-show-floating-label):has(select:disabled) .field-label.required {
        background: none;
        color: #737373;
        padding-right: 0;
    }

    .floating-labels .field-input:focus {
        outline: none;
        border-color: #64b0f2;
        -webkit-box-shadow: 0 0 0 1px #64b0f2;
        box-shadow: 0 0 0 1px #64b0f2;
    }


    .floating-labels .field-input.datePickerInput {
        display: inline-block;
        width: 100% !important;
        padding-right: 30px;
    }

/* Collapse the flatpickr wrap div from layout so the calendar trigger
   can be absolutely positioned within .field-input-wrapper. The wrap
   div is added by flatpickr's wrap-mode and otherwise stacks the
   trigger below the input as a block-level child. */
.floating-labels .field-input-wrapper > .flatpickr {
    display: contents;
}

.floating-labels .flatpickr-trigger {
    position: absolute;
    top: 12px;
    right: 7px;
}

/* When the underlying date input is readonly, the input and the calendar
   trigger should look and behave inert. flatpickrUtil.setEnabled also
   sets clickOpens: false, so this is the visual half of that contract
   and a defensive guard for trigger clicks that bypass clickOpens. */
.flatpickr > .flatpickr-input[readonly] {
    cursor: default;
}
.flatpickr > .flatpickr-input[readonly] ~ .flatpickr-trigger {
    cursor: default;
    pointer-events: none;
}
.flatpickr > .flatpickr-input[readonly] ~ .flatpickr-trigger img {
    cursor: default;
    pointer-events: none;
    opacity: 0.4;
}

.floating-labels .field-input-select {
    padding-right: 2.07143em;
    white-space: nowrap;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    -webkit-font-smoothing: inherit;
    background: transparent;
    cursor: pointer;
    position: relative;
    z-index: 2;
}

    /* A dropdown paints ON TOP of its own label - position: relative + z-index: 2
       above the label's z-index: 1 - so that an empty field can show the label
       through the control in the placeholder position. That only holds while the
       select stays transparent, and .field-input[disabled] above is the more
       specific selector (0,3,0 against this block's 0,2,0), so it repainted a
       disabled dropdown opaque grey directly over its own label and the field read
       as an unlabelled empty box. Any screen that disables a dropdown it does not
       need - the charge code and signer fields on PCI's project task dialog, say -
       lost the label naming it.

       Keep the control see-through and let the wrapper below carry the grey. A
       disabled dropdown that still holds a value was never affected: the floated
       label lifts to z-index 3 and wins on its own. */
    .floating-labels .field-input-select[disabled],
    .floating-labels .field-input-select[readonly] {
        cursor: default;
        background-color: transparent;
    }

    .floating-labels .field-select:has(select.field-input-select[disabled]) .field-input-wrapper,
    .floating-labels .field-select:has(select.field-input-select[readonly]) .field-input-wrapper {
        background-color: #eee;
        border-radius: 5px;
    }

.floating-labels .field-caret {
    border-left: 1px rgba(179,179,179,0.5) solid;
    display: block;
    width: 2.14286em;
    height: 43%;
    position: absolute;
    top: 50%;
    right: 0;
    -webkit-transform: translate(0%, -50%);
    transform: translate(0%, -50%);
    text-align: center;
    color: #919191;
    cursor: pointer;
    z-index: 1;
}

.floating-labels select.field-input[disabled] + .field-caret {
    cursor: default;
}

.floating-labels .field-time-picker > .field-input-wrapper {
    border-color: #d9d9d9;
    background-clip: padding-box;
    border-radius: 5px;
    border-style: solid;
    border-width: 1px;
    white-space: nowrap;
    overflow: hidden;
}

    .floating-labels .field-time-picker > .field-input-wrapper.input-validation-error {
        border: 1px solid #e80c4d !important;
    }

    .floating-labels .field-time-picker > .field-input-wrapper .field-time {
        padding-top: 1.5em;
        padding-bottom: .35714em;
        width: 110px !important;
        border-left: 0;
        border-right: 0;
        border-top: 0;
        padding-right: 0;
        border-bottom: 0;
        padding-left: 0.78571em;
    }

    .floating-labels .field-time-picker > .field-input-wrapper .field-date {
        padding-top: 1.5em;
        padding-bottom: .35714em;
        width: 120px !important;
        border-left: 0;
        border-right: 0;
        border-top: 0;
        border-bottom: 0;
        padding-left: 0.92857em;
    }

    /* The flatpickr wrap-mode div sits between .field-input-wrapper and
       the date input. Collapse it from layout so the date / time inputs
       render side-by-side as if they were direct children. */
    .floating-labels .field-time-picker > .field-input-wrapper > .flatpickr {
        display: contents;
    }

    .floating-labels .field-time-picker > .field-input-wrapper .flatpickr-trigger {
        position: absolute;
        left: 98px;
        right: unset;
        top: 25px;
    }

    .floating-labels .field-time-picker > .field-input-wrapper .field-time.input-validation-error {
        border-right: none !important;
    }

    .floating-labels .field-time-picker > .field-input-wrapper .field-date.input-validation-error {
        border-left: none !important;
    }

.floating-labels .list-horizontal > .list-item {
    display: inline-block;
    margin-top: 5px;
    margin-right: 5px;
}

    .floating-labels .list-horizontal > .list-item > label,
    .floating-labels .list-vertical > .list-item > label {
        font-weight: normal;
    }

        .floating-labels .list-vertical > .list-item > input[type="radio"] + label,
        .floating-labels .list-vertical > .list-item > label + input[type="radio"],
        .floating-labels .list-horizontal > .list-item > input[type="radio"] + label,
        .floating-labels .list-horizontal > .list-item > label + input[type="radio"] {
            margin-left: 3px;
        }

.floating-labels .list-vertical > .list-item {
    display: block;
    margin-top: 3px;
}

    .floating-labels .list-vertical > .list-item:first-child {
        display: block;
        margin-top: 5px;
    }

/* ===== Tom Select (autocomplete) inside floating-label wrappers =====
   Reconciled with the framework canonical floating-labels.css so autocompletes
   size and float their label like the dropdowns (paired with the
   FloatingLabelAutoComplete placeholder->float package change). */

/* The framework's .field-caret renders a chevron with its own click handler, so
   suppress Tom Select's own CSS caret to avoid a duplicate. */
.floating-labels .field-input-wrapper .ts-wrapper.single .ts-control::after {
    display: none;
}

/* Size the Tom Select control to match .field-input; extra top padding leaves
   room for the floating label. */
.floating-labels .field-input-wrapper .ts-control {
    border-color: #d9d9d9;
    border-radius: 5px;
    padding: 1.5em 2.07143em 0.35714em 0.78571em;
    line-height: inherit;
}

    /* Placeholder->float: while the autocomplete has no value (and isn't focused
       — FloatingLabelAutoComplete floats field-show-floating-label on focus/value),
       drop the reserved top padding so the label reads as a centred placeholder
       rather than floating above an empty gap. */
    .floating-labels .field-select:not(.field-show-floating-label) .field-input-wrapper .ts-control {
        padding-top: 0.92857em;
        padding-bottom: 0.92857em;
    }

.floating-labels .field-input-wrapper .ts-wrapper.focus .ts-control {
    border-color: #64b0f2;
    box-shadow: 0 0 0 1px #64b0f2;
}

/* Multi-select pills overlap the floating label without this; bump specificity
   and re-apply the top/bottom/right spacing. */
.floating-labels .field-input-wrapper .ts-wrapper.multi.has-items .ts-control {
    padding-top: 2em;
    padding-right: 2.07143em;
    padding-bottom: 0.35714em;
}
