/* Профиль сверху справа */
.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; /* К правому краю */
}

@media screen and (min-width: 1001px) {
    #container-profile {
        height: auto;
        min-height: 636px;
        overflow: visible;
        margin-bottom: 24px;
    }
}


/* Заголовок формы */
.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-specialists .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;
}

.date-input {
    width: 100%;
    display: flex;
    align-items: stretch;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #ffffff;
    overflow: hidden;
}

.date-input input {
    border: none;
    border-radius: 0;
    background: transparent;
}

.date-input input::-webkit-calendar-picker-indicator {
    opacity: 0;
    pointer-events: none;
}

.date-input__toggle {
    width: 40px;
    min-width: 40px;
    height: 40px;
    border-radius: 0;
    border-left: 1px solid var(--border);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
}

.date-input__toggle svg {
    width: 18px;
    height: 18px;
    opacity: .6;
}

@media (hover: hover) {
    .date-input__toggle:hover {
        background: rgba(189, 146, 206, 0.14);
        color: inherit !important;
    }
}

@media (hover: none) {
    .date-input__toggle:active {
        background: rgba(189, 146, 206, 0.14);
        color: inherit !important;
    }
}

/* Кнопка сохранить профиль и пароль */
.button-wrapper {
    flex-basis: 100%; /* Принудительный перенос строки */
    display: flex;
    justify-content: center;
}

.contact-grid_inline-action .button-wrapper.contact-grid-action {
    flex-basis: auto;
    width: 250px;
    justify-content: stretch;
    align-self: flex-end;
}

.contact-grid_inline-action .button-wrapper.contact-grid-action button {
    width: 100%;
}

.contact-grid_stacked-action .button-wrapper.contact-grid-action {
    flex-basis: 100%;
    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-specialists .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-specialists,
#container-support {
    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-diagnostics .diagnostics-empty {
    width: 100%;
    box-sizing: border-box;
    padding: 32px 40px;
    border: 1px solid rgba(189, 146, 206, 0.34);
    border-radius: 18px;
    background: #f6eef9;
}

#container-diagnostics .diagnostics-empty__title {
    color: #583e63;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.2;
}

#container-diagnostics .diagnostics-empty__text {
    margin-top: 10px;
    max-width: 560px;
    color: rgba(44, 29, 52, 0.74);
    line-height: 1.4;
}

#container-clients .client-list-skeleton {
    width: 100%;
}

#container-clients .client-list-skeleton__card {
    cursor: default;
    pointer-events: none;
}

#container-clients .client-list-skeleton__card:hover,
#container-clients .client-list-skeleton__card:focus-visible {
    background: transparent;
    box-shadow: none;
}

#container-clients .client-list-skeleton__dot,
#container-clients .client-list-skeleton__line {
    background: linear-gradient(
        90deg,
        rgba(189, 146, 206, 0.14) 0%,
        rgba(189, 146, 206, 0.3) 50%,
        rgba(189, 146, 206, 0.14) 100%
    );
    background-size: 200% 100%;
    animation: client-list-skeleton-shimmer 1.35s ease-in-out infinite;
}

#container-clients .client-list-skeleton__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

#container-clients .client-list-skeleton__line {
    border-radius: 999px;
}

#container-clients .client-list-skeleton__line_name {
    width: min(280px, 70%);
    height: 24px;
    max-width: 100%;
}

#container-clients .client-list-skeleton__line_date {
    width: 158px;
    max-width: 100%;
    height: 20px;
}

#container-clients .client-list-degraded {
    width: 100%;
    box-sizing: border-box;
    padding: 24px 40px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #f6eef9;
}

#container-clients .client-list-degraded p + p {
    margin-top: 8px;
}

@keyframes client-list-skeleton-shimmer {
    0% {
        background-position: 100% 0;
    }

    100% {
        background-position: -100% 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    #container-clients .client-list-skeleton__dot,
    #container-clients .client-list-skeleton__line {
        animation: none;
    }
}

/* Скролл */
#container-clients .content::-webkit-scrollbar,
#container-diagnostics .content::-webkit-scrollbar,
#container-specialists .content::-webkit-scrollbar,
#container-support .content::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

/* Подложка скролла в цвет фона */
#container-clients .content::-webkit-scrollbar-track,
#container-diagnostics .content::-webkit-scrollbar-track,
#container-specialists .content::-webkit-scrollbar-track,
#container-support .content::-webkit-scrollbar-track {
    border-radius: 4px;
    background-color: #00000000;
}

/* Скролл цвета основного блока */
#container-clients .content::-webkit-scrollbar-thumb,
#container-diagnostics .content::-webkit-scrollbar-thumb,
#container-specialists .content::-webkit-scrollbar-thumb,
#container-support .content::-webkit-scrollbar-thumb {
    border-radius: 10px;
    background-color: var(--input-bg);
}

#container-support .form-title {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

#container-support .content {
    padding: 28px;
    box-sizing: border-box;
}

.support-content {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.support-intro {
    padding: 4px 0 0;
}

.support-intro__title {
    margin-bottom: 12px;
    color: #583e63;
}

.support-intro__text {
    max-width: 560px;
    color: rgba(44, 29, 52, 0.72);
    line-height: 1.35;
}

.support-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.support-action {
    min-height: 88px;
    padding: 20px 22px;
    border: 1px solid rgba(189, 146, 206, 0.34);
    border-radius: 18px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    text-decoration: none;
    transition: border-color .15s ease, background-color .15s ease;
}

.support-action__copy {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.support-action__label {
    color: #583e63;
    font-size: 24px;
    font-weight: 500;
    line-height: 1.1;
}

.support-action__meta {
    color: rgba(44, 29, 52, 0.62);
    line-height: 1.25;
}

.support-action__cta {
    min-width: 120px;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(189, 146, 206, 0.14);
    color: #583e63;
    font-size: 16px;
    font-weight: 500;
}

@media (hover: hover) {
    .support-action:hover {
        border-color: rgba(189, 146, 206, 0.7);
        background: rgba(246, 238, 249, 0.55);
    }
}


/* Карточка */
.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,
.card:focus-within {
    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-row {
    width: 100%;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.diagnostic-title {
    width: auto;
    flex: 1 1 auto;
    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-help {
    flex: 0 0 auto;
    margin-top: 2px;
}

.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;
    }
}
