/* Профиль сверху справа */
.profile {
    min-height: 60px;

    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 22px;

    margin: 32px 0 33px auto; /* К правому краю + отступы */
}

.profile-link {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    color: inherit;
    text-decoration: none;
    transition: opacity .15s ease;
}

.profile-link:hover,
.profile-link:focus-visible {
    opacity: .75;
}

.profile-role {
    font-size: 16px;
    line-height: 1.15;
    color: var(--p-cyan);
    text-transform: uppercase;
    letter-spacing: .04em;
}

#user-name {
    text-align: right;
}


/* Контейнер вкладки */
.container {
    width: 660px;
    height: 636px;
    box-sizing: border-box;

    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    
    margin-left: auto; /* К правому краю */
}


/* Заголовок формы */
.form-title {
    width: 100%;
    height: 75px;

    box-sizing: border-box; /* Бордер внутри */
    border-bottom: 1px solid var(--border);
}

/* Для множественных заголовков */
.form-title:not(:first-child) {
    border-top: 1px solid var(--border); /* Бордер сверху */
}

.form-title p {
    text-align: center;
}

/* Центрированный текст внутри заголовков во вкладке "Мой профиль"  */
#container-profile .form-title,
#container-open-card .form-title {
    display: flex;
    justify-content: center;
    align-items: center;

    position: relative;
}

/* В других вкладках поле поиска  */
#container-clients .form-title,
#container-diagnostics .form-title,
#container-managers .form-title {
    display: flex;
    align-items: center;

    position: relative;
}

/* Во вкладке "Мой профиль" текст в заголовке капсом */
.form-title .p1-strong {
    text-transform: uppercase;
}

/* В открытой карточке кнопка назад */
#open-card-back, .container-back {
    width: 20px;
    height: 20px;
    padding: 12px 16px;
    position: absolute;

    left: calc(40px - 16px); /* Минус отступ от паддинга */
    top: calc(24px - 12px); /* Минус отступ от паддинга */
    opacity: .5;
    transition: .15s all;

    cursor: pointer;
}

@media (hover: hover) {
    #open-card-back:hover,
    .container-back:hover {
        opacity: 1;
    }
}

@media (hover: none) {
    #open-card-back:hover,
    .container-back:hover {
        opacity: 1;
    }
}


/* Мобильная кнопка возвращение в навигацию */
.container-back {
    display: none;
}


/* Форма профиля и пароля */
#container-profile .content, #container-open-card .content {
    width: 100%;
    box-sizing: border-box;
    padding: 18px 0 18px 54px;

    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    align-items: center;
    gap: 17px 52px;
}

.input-block {
    width: 250px;
    height: 66px;

    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 4px;
}

.input-block_select {
    position: relative;
    overflow: visible;
}

.input-block input {
    width: 100%;
    height: 40px;
    box-sizing: border-box;
    padding: 0 12px;

    border: 1px solid var(--border);
    border-radius: 10px;
}

/* Кнопка сохранить профиль и пароль */
.button-wrapper {
    flex-basis: 100%; /* Принудительный перенос строки */
    display: flex;
    justify-content: center;
}

.button-wrapper_column {
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
}

button {
    width: 300px;
    height: 40px;
    box-sizing: border-box;
    
    background: var(--border);
    border-radius: 10px;
    border: none;
    outline: none;       
    
    transition: .15s all;
    cursor: pointer;
    color: #000000 !important;
}

@media (hover: hover) {
    button:hover {
        background: #000000;
        color: #FFFFFF !important;
    }
}

button:disabled {
    background: #d1aedf;
    color: #313131 !important;
    cursor: not-allowed;
}

.change-password__error {
    display: none;
    width: 100%;
    text-align: center;
    color: red;
    font-size: 16px;
}


/* Поиск */
.search-wrapper {
    width: 300px;
    height: 40px;
    box-sizing: border-box;
    position: relative;

    border-radius: 10px;

    margin-left: 54px;
}

#container-managers .search-wrapper {
    margin-left: 0;
}

.search-wrapper input {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    padding-left: 48px; /* Отступ от картинки */
    padding-right: 12px;

    outline: none;
    border: none;
    border-radius: 10px;
    background: var(--input-bg);
}

.search-wrapper input::placeholder {
    color: var(--input-placeholder);
}

/* Кнопка в поиске */
.search-wrapper img {
    width: 20px;
    height: 20px;

    position: absolute;
    left: 20px;
    top: 10px;

    opacity: .5;
}

/* Контент - список карточек */
#container-clients,
#container-diagnostics,
#container-managers {
    height: auto;
    overflow: visible;
    margin-bottom: 24px;
}

#container-clients .content {
    width: 100%;
    height: auto;
    overflow: visible;
    min-height: calc(636px - 75px);
}

#container-clients .client-list-empty {
    width: 100%;
    min-height: 1px;
}

/* Скролл */
#container-clients .content::-webkit-scrollbar,
#container-diagnostics .content::-webkit-scrollbar,
#container-managers .content::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

/* Подложка скролла в цвет фона */
#container-clients .content::-webkit-scrollbar-track,
#container-diagnostics .content::-webkit-scrollbar-track,
#container-managers .content::-webkit-scrollbar-track {
    border-radius: 4px;
    background-color: #00000000;
}

/* Скролл цвета основного блока */
#container-clients .content::-webkit-scrollbar-thumb,
#container-diagnostics .content::-webkit-scrollbar-thumb,
#container-managers .content::-webkit-scrollbar-thumb {
    border-radius: 10px;
    background-color: var(--input-bg);
}


/* Карточка */
.card {
    width: 100%;
    min-height: 72px;
    box-sizing: border-box;
    padding: 12px 40px 12px 52px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);

    cursor: pointer;
    transition: background-color .15s ease, box-shadow .15s ease;
}

.card:hover,
.card:focus-visible {
    background: rgba(190, 146, 207, .08);
    box-shadow: inset 0 0 0 1px rgba(190, 146, 207, .18);
    outline: none;
}

.card-left {
    display: flex;
    flex: 1;
    min-width: 0;
    height: 100%;
    align-items: center;
}

.card-left__dot-wrapper {
    width: 8px;
    height: 100%;
    display: flex;
    align-items: center;
}

.card-left__dot {
    width: 8px;
    height: 8px;
    
    border-radius: 8px;
    background: var(--dot-bg);
}

.card-left__content {
    width: auto;
    min-width: 0;
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-left: 12px;
}

.list-person-name {
    font-size: 20px;
    line-height: 1.25;
}

.card-right__content {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-left: 20px;
}

.card-right__content p {
    text-align: right;
    white-space: nowrap;
    font-size: 18px;
    line-height: 1.1;
}


/* Диагностики */
.diagnostic {
    width: 100%;
    min-height: 80px;
    box-sizing: border-box;
    padding: 12px 24px;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;

    border-bottom: 1px solid var(--border);
}

.diagnostic-title {
    width: 100%;
    max-width: 100%;
    padding: 0;
    background: transparent;
    color: var(--p-cyan);
    font-weight: 600;
    text-align: left;
    letter-spacing: 0.01em;
    line-height: 1.2;
    word-break: break-word;
}

.diagnostic-divider {
    width: 100%;
    height: 1px;
    background: rgba(189, 146, 206, 0.45);
}

.diagnostic-link-row {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.diagnostic-link-copy {
    min-width: 0;
    flex: 1;

    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    text-align: left;
}

.diagnostic-link {
    display: inline-block;
    width: 100%;
    font-size: 18px;
    line-height: 132%;
    color: var(--p-gray);
    text-decoration: none;
    text-align: left;
    overflow-wrap: anywhere;
}

.diagnostic-link-available {
    color: var(--p-gray);
}

.diagnostic-link[aria-disabled="true"] {
    text-decoration: none;
    cursor: default;
}

.diagnostic-copy-status {
    font-size: 14px;
    color: #66CAA5;
    line-height: 1.1;
}

.diagnostic-copy-status:empty {
    display: none;
}

.diagnostic-copy-button {
    width: 40px;
    min-width: 40px;
    height: 40px;
    padding: 0;

    display: inline-flex;
    justify-content: center;
    align-items: center;

    background: transparent;
    border: none;
    border-radius: 10px;
}

.diagnostic-copy {
    width: 25px;
    height: 25px;
    padding: 0;

    opacity: .5;
    transition: .15s all;

    cursor: pointer;
}

@media (hover: hover) {
    .diagnostic-link-available:hover {
        color: #000000;
        text-decoration: underline;
        text-underline-offset: 3px;
    }

    .diagnostic-copy-button:hover {
        background: rgba(189, 146, 206, 0.14);
    }

    .diagnostic-copy:hover {
        opacity: 1;
    }
}

@media (hover: none) {
    .diagnostic-copy-button {
        background: transparent;
    }

    .diagnostic-copy {
        opacity: 1;
    }
}
