$active-background: $highlight-blue;

.itsec-card--type-security-profile-list {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;

    & .itsec-component-master-detail {
        border-bottom-left-radius: 10px;
    }

    & .itsec-card-header {
        flex-shrink: 0;
        border-bottom: 1px solid $light-gray-500;
    }

    & .itsec-card-security-profile__users--column-avatar img {
        height: 3em;
        border-radius: 50%;
    }

    & tbody td.itsec-card-security-profile__users--column-two-factor {
        text-align: center;
    }

    .itsec-card[max-width~="700px"] & .itsec-card-security-profile__users--column-avatar,
    .itsec-card[max-width~="700px"] & .itsec-card-security-profile__users--column-two-factor {
        display: none;
    }

    .itsec-card[max-width~="500px"] & .itsec-card-header-status {
        display: none;
    }
}

.itsec-card-security-profile__filter {
    display: grid;
    grid-template-columns: 1fr min-content;
    align-items: stretch;

    .itsec-card-security-profile__filter-search {
        grid-column: 1 / span 1;
        grid-row: 1;
        margin-top: .5em;
        border-bottom: 1px solid transparent;
        padding-right: .5em;
        padding-left: 1em;
        padding-bottom: .5em;

        .components-base-control__field {
            margin-bottom: 0;
        }
    }

    &:not(.itsec-card-security-profile__filter--has-roles) {
        .itsec-card-security-profile__filter-search {
            padding-right: 1em;

            .dashicon {
                right: 15px;
            }

            .components-spinner {
                right: 5px;
            }
        }
    }

    .components-button.has-icon.has-text {
        grid-column: 2 / span 1;
        grid-row: 1;
        color: $main-blue;
        border-left: 1px solid transparent;
        border-radius: 0;
        white-space: nowrap;
        height: auto;
        justify-content: center;
        margin-right: .5em;
        font-variant-numeric: tabular-nums;
    }

    ul {
        grid-column: 1 / span 2;
        grid-row: 2;

        display: flex;
        flex-wrap: wrap;
        margin: 0;
        padding: 0 1em .5em 1em;

        border-bottom: 1px solid $light-gray-500;

        li {
            margin-top: .5em;
            margin-right: .5em;
            margin-bottom: 0;
        }
    }

    &.itsec-card-security-profile__filter--roles-visible {
        .itsec-card-security-profile__filter-search {
            border-color: $light-gray-500;
        }

        .components-button.has-icon.has-text {
            border-color: $light-gray-500;
        }
    }
}

.itsec-card--type-security-profile-list .itsec-component-master-detail .itsec-component-master-detail__master-list thead th {
    border-top: none;
}

.itsec-card-security-profile__footer {
    position: sticky;
    bottom: 0;
    margin-top: auto;
    padding: .5em 1em;
    border-top: 1px solid $light-gray-500;
    background: $white;
}

.itsec-card-security-profile__user {
    & .itsec-card-security-profile__user-header {
        display: flex;
        flex-wrap: wrap;
        flex-shrink: 0;
        padding: 1em;
        text-align: center;
        align-items: center;
        justify-content: center;
        background: $highlight-blue;

        & > * {
            margin: .5em;
        }

        & img {
            width: 3em;
            height: 3em;
            border-radius: 50%;
        }
    }

    & .itsec-card-security-profile__password-strength--short {
        color: $alert-red;
    }

    & .itsec-card-security-profile__password-strength--bad {
        color: $alert-orange;
    }

    & .itsec-card-security-profile__password-strength--good {
        color: $alert-yellow;
    }

    & .itsec-card-security-profile__password-strength--strong {
        color: $alert-green;
    }

    & .itsec-card-security-profile__user-info {
        padding: 0 2em;

        & table {
            width: 100%;
            border-spacing: 0;
            text-align: left;
        }

        & table th,
        & table td {
            border-bottom: 1px solid $light-gray-500;
        }

        & table tr:last-child th,
        & table tr:last-child td {
            border-bottom: none;
        }

        & table th {
            text-transform: uppercase;
            font-weight: normal;
            color: $dark-gray-300;
            padding: 1em 1em 1em 0;
            width: 33%;
        }

        & table td {
            font-weight: bold;
            padding: 1em 0 1em 1em;
        }
    }

    .itsec-card-security-profile__user-actions {
        margin-bottom: 2em;

        .components-button {
            margin-top: .5em;
            margin-right: .5em;
        }
    }
}

.itsec-card[max-width~="250px"] .itsec-card--type-security-profile .itsec-card-security-profile__user-info {
    margin: 0;
    padding: 0 1em;

    & table {
        overflow: hidden;
    }

    & table th,
    & table td {
        display: block;
        border-bottom: none;
        width: auto;
        padding: .5em 1em 0 1em;
    }

    & table th {
        padding-top: 1em;
    }

    & table td {
        border-bottom: 1px solid $light-gray-500;
        padding-bottom: 1em
    }
}

.itsec-card--type-security-profile {
    height: 100%;
    display: flex;
    flex-direction: column;

    & .itsec-card-security-profile__user-header {
        border-top-left-radius: 10px;
        border-top-right-radius: 10px;
    }

    & .itsec-card-header {
        flex-shrink: 0;
    }

    & .itsec-card-security-profile__user {
        height: 100%;
        flex-shrink: 1;
        display: flex;
        flex-direction: column;

        & .itsec-card-security-profile__user-info {
            overflow-y: scroll;
            overflow-x: hidden;
        }
    }

    & .itsec-card-security-profile__select-user {
        padding: 2.5em 1em 0 1em;
        display: flex;
        flex-direction: column;
        align-items: center;
        height: 100%;
        background: $active-background;

        & > * {
            margin: .5em;

            &:first-child {
                margin-top: 0;
            }

            &:last-child {
                margin-bottom: 0;
            }
        }

        & .itsec-card-security-profile__select-form {
            display: flex;
            align-items: stretch;
            justify-content: center;
            width: 100%;
            max-width: 350px;

            & .itsec-card-security-profile__select-user-dropdown {
                flex-grow: 1;
            }

            & .itsec-card-security-profile__select-user-save-container {
                margin-left: .5em;

                & .components-button {
                    height: 100%
                }
            }
        }
    }
}

.itsec-component-master-detail__back.components-button.has-icon {
    padding: 0;
    height: auto;
    width: auto;
    min-width: 0;
    margin-right: .5em;
}
