/*Custom JP Servicefee Color Scheme*/
@media (prefers-color-scheme: light) {
    .sidebar-dark-info .nav-sidebar > .nav-item > .nav-link.active, .sidebar-light-info .nav-sidebar > .nav-item > .nav-link.active {
        background-color: #f5b4cb;
        color: #373a3c;
    }

    .main-sidebar .navbar-info {
        background-color: #f5b4cb;
    }


    .sidebar-dark-success .nav-sidebar > .nav-item > .nav-link.active, .sidebar-light-success .nav-sidebar > .nav-item > .nav-link.active {
        background-color: #cbdc8a;
        color: #373a3c;
    }

    .main-sidebar .navbar-success {
        background-color: #cbdc8a;
    }

        /*change color of logo*/
    .main-sidebar .brand-image {
        filter: invert(0%) sepia(0%) saturate(1%) hue-rotate(177deg) brightness(0%) contrast(100%);
    }
}

/* Style the changelist view */
.card-header > .card-tools {
    width: 100%;
    float: none;
    justify-content: left;
    display: flow-root;
}

#changelist-search .form-group {
    flex: 0 1 32%;
    position: relative;
}

@media only screen and (max-width: 567px) {
    #changelist-search .form-group {
        flex: 1 1 100%;
        position: relative;
    }
}

@media only screen and (min-width: 1600px) {
    #changelist-search .form-group {
        flex: 1 1 20%;
        position: relative;
    }
}

#changelist-search input {
    min-width: 100%;
    max-width: 100%;
    border: 1px solid #aaa;
}

.card-tools input[type="text"] {
    width: 100%;
    min-height: 40px;
}

/* Style the input, select, textarea and button */
button {
    min-height: 40px;
}

.select2-selection__choice__remove {
    min-height: initial;
}

textarea.select2-search__field {
    border: none !important;
}

input[type="text"],
input[type="number"],
input[type="email"] {
    min-width: 75%;
    max-width: 75%;
    min-height: 40px;
    border-radius: 0.25rem;
}

@media only screen and (max-width: 567px) {
    input[type="text"],
    input[type="number"],
    input[type="email"] {
        min-width: 100%;
    }
}

@media only screen and (min-width: 1600px) {
    input[type="text"],
    input[type="number"],
    input[type="email"] {
        min-width: 50%;
        max-width: 50%;
    }
}

.vIntegerField.compact {
    max-width: 3.5em;
}

.vIntegerField.compact {
    max-width: 3.5em;
}

input[type="file"]::-webkit-file-upload-button {
    background: #2a9fd6;
    border: 2px solid #2a9fd6;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    padding: 8px 16px;
    text-transform: uppercase;
    transition: all 1s ease;
}

textarea {
    min-width: 75%;
    max-width: 75%;
    min-height: 40px;
    border-radius: 0.25rem;
    border: 1px solid #ced4da;
}

@media only screen and (max-width: 567px) {
    textarea {
        max-width: 100%;
        min-width: 100%;
    }
}

@media only screen and (min-width: 1600px) {
    textarea {
        min-width: 50%;
    }
}

select {
    min-width: 75%;
    min-height: 40px;
    border-radius: 0.25rem;
    border: 1px solid #ced4da;
}

.select2-container {
    width: 75% !important;
}

@media only screen and (max-width: 567px) {
    select {
        min-width: 100%;

    }

    .select2-container {
        width: 100% !important;
    }

}

@media only screen and (min-width: 1600px) {
    select {
        min-width: 50%;
    }

    .select2-container {
        width: 50% !important;
    }

}

a.inline-deletelink {
    margin: 0;
    padding: 10px 8px;
}

@media only screen and (max-width: 768px) {
    #changelist-form .actions label:nth-child(1) {
        width: 100%;
    }

    #changelist-form .actions button {
        margin-left: 0px !important;
        margin-bottom: 16px;
    }

    #changelist-form a.btn {
        float: none !important;
    }
}

/* style the select month-year-widget */
.month-year-widget {
    width: calc(37.5% - 0.125rem);
    min-width: calc(37.5% - 0.125rem);
}

.month-year-widget + .select2-container {
    width: calc(37.5% - 0.125rem) !important;
    min-width: calc(37.5% - 0.125rem) !important;
    margin-right: 6px;
}

@media only screen and (max-width: 567px) {
    .month-year-widget {
        width: calc(100% - 0.25rem);
        min-width: calc(100% - 0.25rem);
    }

    .month-year-widget + .select2-container {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        margin-bottom: 0.25rem;
    }
}

@media only screen and (min-width: 1600px) {
    /* style the select month-year-widget */
    .month-year-widget {
        width: calc(25% - 0.125rem);
        min-width: calc(25% - 0.125rem);
    }

    .month-year-widget + .select2-container {
        width: calc(25% - 0.125rem) !important;
        min-width: calc(25% - 0.125rem) !important;
        max-width: calc(25% - 0.125rem) !important;
        margin-right: 6px;
    }
}

/* Style the label desktop */
@media only screen and (min-width: 567px) {
    div .form-group > div.row > label {
        flex: 0 0 12em;
        text-align: right !important;
        max-width: unset;
        word-wrap: anywhere;
        margin: 0 !important;
        display: flex;
        align-items: center;
        justify-content: flex-end;
    }
}

/* Style the inline forms  */
.tab-pane .card > div {
    padding: 1rem !important;
    overflow: hidden;
}

/* Style calender -> datepicker  */
.calendarbox table {
    margin-top: 25px;
}

@media only screen and (max-width: 768px) {
    .calendarbox {
        left: 50% !important;
        transform: translateX(-50%);
    }
}

/* Style table  */
.card .table tr th:nth-child(2) {
    padding-left: 1.5rem !important;
}

div .form-group > div.row > div {
    flex: 1;
}

div .form-group > div.row > div > div.readonly {
    margin: 0 !important;
}

div > .form-group > div.row > div > input[type="number"] {
    height: calc(2.25rem + 2px);
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    box-shadow: inset 0 0 0 transparent;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.nicer-select, .select2.select2-container--admin-autocomplete {
    width: initial;
    height: auto;
    padding: .375rem .75rem;
    margin-right: .25em;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: .25rem;
    box-shadow: inset 0 0 0 transparent;
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

.select2-container {
    flex: 1;
}

.related-widget-wrapper
.select2-container--default
.select2-selection--multiple
.select2-selection__choice {
    color: #495057;
}

.related-widget-wrapper
.select2-container--default
.select2-selection--multiple
.select2-selection__choice__display {
    padding-left: 0.5em;
}

.card-tools > form {
    row-gap: 0.5em;
}

.card-tools input[type="text"] {
    border-radius: 0.25em;
}

/* Utility class to make clickable cards in bootstrap */
.stretched-link::after {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
    pointer-events: auto;
    content: "";
    background-color: rgba(0, 0, 0, 0);
}

/* Loading spinner for HTMX */

@keyframes rotate {
    to {
        transform: rotate(360deg);
    }
}

.spinner.htmx-request {
    animation: rotate 0.5s linear infinite;
}

/* Override sidebar */
.user-panel .info .d-block {
    /* Prevent white email-addresses on white background */
    color: #495057 !important;
}

/* Don't wrap lines for label_display field (admin for customer.Document) */
.field-label_display > a {
    white-space: nowrap;
}
