/**
 * Create New Customer entity modal — scoped to .im-customer-modal-window only.
 */

.im-customer-modal-window.im-report-screen-modal .modal-dialog {
    max-width: calc(1200px + 1in) !important;
}

@media (min-width: 768px) {
    .im-customer-modal-window.im-report-screen-modal .modal-dialog {
        max-width: calc(1200px + 1in) !important;
    }
}

.im-customer-modal-window .im-customer-entity-modal .im-entity-modal-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.im-customer-modal-window .datepicker,
.im-customer-modal-window .datepicker.datepicker-inline,
.im-customer-modal-window .datepicker.datepicker-dropdown {
    background-color: #fff !important;
    border: 1px solid #ccc;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
    z-index: 10050 !important;
}

.im-customer-modal-window .im-customer-entity-modal .im-customer-tab-shell {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    max-width: none;
    padding-left: 0;
    padding-right: 0;
}

.im-customer-modal-window .im-customer-entity-modal .im-customer-tab-content {
    flex: 0 0 auto;
    height: calc(560px + 2in);
    min-height: calc(560px + 2in);
    max-height: calc(560px + 2in);
    border-top: none;
    background: #fff;
    overflow: hidden;
    box-sizing: border-box;
}

/* Only the active pane is visible — !important beats leftover inline display from tab fixes. */
.im-customer-modal-window .im-customer-entity-modal .im-customer-tab-content > .tab-pane {
    box-sizing: border-box;
    display: none !important;
    opacity: 0;
}

.im-customer-modal-window .im-customer-entity-modal .im-customer-tab-content > .tab-pane.active {
    display: block !important;
    opacity: 1 !important;
    height: 100%;
    min-height: 100%;
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.im-customer-modal-window .im-customer-entity-modal .customerVehicleGrid {
    max-width: 100%;
}

@media (max-width: 767px) {
    .im-customer-modal-window .im-customer-entity-modal .im-customer-tab-content {
        height: calc(420px + 2in);
        min-height: calc(420px + 2in);
        max-height: calc(420px + 2in);
    }
}

/* Search for Rego No. — red text when field has a non-blank value */
.im-customer-modal-window .im-customer-entity-modal .mm-customer-rego-search.mm-customer-rego-search--filled {
    color: #ff0000 !important;
}

/*
 * Customer modal — no orange/peach fields (neutral white + #cbd5e1).
 * Overrides Invoice .custxt/.txt when this modal is opened from Invoice.
 */
.im-customer-modal-window .im-customer-entity-modal input.custxt,
.im-customer-modal-window .im-customer-entity-modal input.txt,
.im-customer-modal-window .im-customer-entity-modal input.inputSelect,
.im-customer-modal-window .im-customer-entity-modal input.dateField,
.im-customer-modal-window .im-customer-entity-modal input.dateInput,
.im-customer-modal-window .im-customer-entity-modal textarea.custxt,
.im-customer-modal-window .im-customer-entity-modal textarea.inputSelect,
.im-customer-modal-window .im-customer-entity-modal select.inputSelect {
    border: 1px solid #cbd5e1 !important;
    background-color: #fff !important;
    box-shadow: none !important;
    color: #161616;
}

.im-customer-modal-window .im-customer-entity-modal textarea.im-customer-vehicle-notes {
    width: 150px;
    min-height: 4.5em;
    resize: none;
    box-sizing: border-box;
}

/*
 * Vehicles tab — match Year/Month/Color width; calendar flush to input.
 */
.im-customer-modal-window .im-customer-entity-modal #Vehicles .cancelPadding > input.custxt.txt {
    width: 123px !important;
    max-width: 123px !important;
    box-sizing: border-box !important;
}

.im-customer-modal-window .im-customer-entity-modal .im-customer-vehicle-date.input-group {
    display: inline-flex !important;
    flex-direction: row;
    align-items: stretch;
    width: auto !important;
    max-width: 100%;
    margin: 0;
    vertical-align: middle;
}

.im-customer-modal-window .im-customer-entity-modal .im-customer-vehicle-date > input.dateField,
.im-customer-modal-window .im-customer-entity-modal .im-customer-vehicle-date > input.custxt {
    flex: 0 0 123px;
    float: none !important;
    display: block !important;
    width: 123px !important;
    min-width: 123px !important;
    max-width: 123px !important;
    height: 28px;
    margin: 0 !important;
    border: 1px solid #cbd5e1 !important;
    border-right: 0 !important;
    background-color: #fff !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
}

.im-customer-modal-window .im-customer-entity-modal .im-customer-vehicle-date > .input-group-addon {
    flex: 0 0 auto;
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: auto !important;
    margin: 0 !important;
    padding: 0 6px !important;
    float: none !important;
    cursor: pointer;
    border: 1px solid #cbd5e1 !important;
    border-left: 0 !important;
    background-color: #fff !important;
    color: #64748b !important;
    border-radius: 0 !important;
    border-top-right-radius: 2px !important;
    border-bottom-right-radius: 2px !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
}

.im-customer-modal-window .im-customer-entity-modal .im-customer-vehicle-date > .input-group-addon .fa-calendar {
    font-size: 14px;
    line-height: 1;
}

@media (max-width: 767px) {
    .im-customer-modal-window .im-customer-entity-modal #Vehicles .cancelPadding > input.custxt.txt,
    .im-customer-modal-window .im-customer-entity-modal .im-customer-vehicle-date > input.dateField,
    .im-customer-modal-window .im-customer-entity-modal .im-customer-vehicle-date > input.custxt {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        flex: 1 1 auto;
    }

    .im-customer-modal-window .im-customer-entity-modal .im-customer-vehicle-date.input-group {
        display: flex !important;
        width: 100% !important;
    }
}

/* Financials tab — wider, uniform, left-aligned inputs (this tab only) */
.im-customer-modal-window .im-customer-entity-modal .im-customer-financials .im-customer-financials-label {
    width: 1%;
    white-space: nowrap;
    vertical-align: middle;
    padding-right: 10px;
}

.im-customer-modal-window .im-customer-entity-modal .im-customer-financials .im-customer-financials-field {
    width: auto;
    vertical-align: middle;
    text-align: left;
}

.im-customer-modal-window .im-customer-entity-modal .im-customer-financials input.inputSelect,
.im-customer-modal-window .im-customer-entity-modal .im-customer-financials input.currencyText,
.im-customer-modal-window .im-customer-entity-modal .im-customer-financials input.dateField {
    width: 200px !important;
    min-width: 200px !important;
    max-width: 200px !important;
    box-sizing: border-box !important;
    text-align: left !important;
    float: none !important;
    display: inline-block;
    margin: 0;
}

.im-customer-modal-window .im-customer-entity-modal .im-customer-financials .im-customer-financials-aging {
    margin-bottom: 0;
}

.im-customer-modal-window .im-customer-entity-modal .im-customer-financials .im-customer-financials-aging-cell {
    vertical-align: top;
    padding-left: 24px;
}

@media (max-width: 767px) {
    .im-customer-modal-window .im-customer-entity-modal .im-customer-financials input.inputSelect,
    .im-customer-modal-window .im-customer-entity-modal .im-customer-financials input.currencyText,
    .im-customer-modal-window .im-customer-entity-modal .im-customer-financials input.dateField {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
    }

    .im-customer-modal-window .im-customer-entity-modal .im-customer-financials .im-customer-financials-aging-cell {
        padding-left: 8px;
    }
}
