*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

.box-item-profile-selector {
    width: 100%;
    max-width: 1072px;
}

.action-bar {
    width: 100%;
    box-sizing: border-box;
}

.section-col,
.custom-select-container,
.custom-select,
.search-box,
.search-input-wrapper,
.profile-info {
    min-width: 0;
}


.info-tooltip {
    vertical-align: top;
}

.add-profile-section {
    display: flex;
    justify-content: flex-end;
    @media (max-width: 768px) {
        justify-content: flex-start;
    }
}

.search-box label {
    font-style: normal;
    font-weight: 400;
    line-height: 24px;
    letter-spacing: 0;
    color: #243A4D;
}

.search-box input {
    width: 100%;
    padding: 8px 16px;
    border: 1px solid #ccc;
    border-radius: 24px;
    font-size: 16px;
    outline: none;
    box-sizing: border-box;
    line-height: 24px;
    letter-spacing: 0;
}

.search-box input:focus {
    outline: none;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrapper input {
    width: 100%;
    padding-right: 40px;
}

.search-input-wrapper .search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    pointer-events: none;
}

.profile-card-list {
    margin-top: 12px;
    max-height: none;
    height: auto;
    overflow-y: visible;
    min-height: 0;
}

.profile-card {
    margin: 4px 4px 8px 4px;
}

.profile-info {
    font-size: 16px;
}

.profile-card.hidden {
    display: none;
}

.profile-card-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.profile-card-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.profile-card-label:hover {
    border-color: #488238;
    background: #EFF5EC;
}

.profile-card-input:focus-visible + .profile-card-label {
    outline: 2px solid #F0F;
    outline-offset: 0;
}

.profile-card-input:checked + .profile-card-label {
    border-color: #488238;
    background: #EFF5EC;
}

.profile-card-content {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
}

.profile-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid #CDCAD9;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.profile-card-input:checked + .profile-card-label .profile-avatar {
    background: #fff;
}

.avatar-initials {
    color: #14293F;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.profile-avatar--icon {
    padding: 10px;
}

.profile-card-input:checked + .profile-card-label .profile-avatar--legal {
    background: #fff;
}

[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%);
    padding: 8px 12px;
    background: #243A4D;
    color: #fff;
    font-size: 12px;
    line-height: 1.4;
    border-radius: 4px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 100;
    white-space: normal;
    max-width: 250px;
    width: max-content;
    text-align: center;
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}

[data-tooltip-position="bottom"]::after {
    bottom: auto;
    top: calc(100% + 8px);
}

.profile-card-input:checked + .profile-card-label .profile-card-check {
    background: #488238;
    border-color: #488238;
}

.profile-card-input:checked + .profile-card-label .check-icon {
    opacity: 1;
}

.list-no-results {
    padding: 30px;
    text-align: center;
}

.pagination-bar {
    display: flex;
    justify-content: center;
    padding: 16px 20px 32px 20px;
    border-top: 1px solid #e0e0e0;
    flex-wrap: wrap;
    gap: 16px;
    overflow: hidden;
}

.pagination-bar__controls {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination-bar__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border: 1px solid #fff;
    background: #fff;
    border-radius: 24px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #424242;
    transition: all 0.2s ease;
}

.pagination-bar__btn:hover:not(:disabled) {
    background: #375C28;
    border-color: #375C28;
    color: #fff;
}

.pagination-bar__btn:focus-visible {
    outline: 2px solid #F0F;
    outline-offset: 0;
}

.pagination-bar__btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #f5f5f5;
}

.pagination-bar__btn--nav {
    background: #fff;
}

.pagination-bar__btn--nav svg {
    stroke: currentColor;
}

.pagination-bar__btn--page {
    min-width: 40px;
    font-weight: 600;
}

.pagination-bar__pages {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.pagination-bar__btn--page.active {
    background: #488238;
    border-color: #488238;
    color: #fff;
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.35);
}

.pagination-bar__btn--page.active:hover {
    background: #375C28;
    border-color: #375C28;
    color: #fff;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.custom-select-container > label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 16px;
    color: #14293F;
}

.custom-select {
    position: relative;
    width: 100%;
}

.custom-select-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    border-radius: 24px;
    border: 1px solid #14293F;
    background: #FFF;
    cursor: pointer;
    user-select: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    min-height: 48px;
    font-size: 16px;
}

.custom-select-trigger:focus-visible {
    outline: 2px solid #F0F;
    outline-offset: 0;
}

.custom-select-trigger:focus:not(:focus-visible) {
    outline: none;
}

.custom-select-trigger:focus-visible {
    outline: 2px solid #F0F;
    outline-offset: 0;
}

/*.custom-select.open .custom-select-trigger {*/
/*    outline: 3px solid #F0F;*/
/*    outline-offset: 0;*/
/*}*/

.custom-select-trigger .arrow {
    font-size: 12px;
    color: #666;
    transition: transform 0.2s;
    margin-left: 10px;
}

.custom-select.open .custom-select-trigger .arrow {
    transform: rotate(180deg);
}

.custom-select-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    border-radius: 12px;
    border: 1px solid #CDCAD9;
    background: #FFF;
    box-shadow: 0 4px 8px 0 #F5F4F7;
    z-index: 1000;
    max-height: 300px;
    overflow: hidden;
}

.custom-select.open .custom-select-dropdown {
    display: block;
}

.selected-text {
    color: #14293F;
}

.search-option {
    margin: 24px 24px 0 24px;
    background: #FFF;
}

.search-option input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 24px;
    border: 1px solid #243A4D;
    background: #FFF;
    font-size: 16px;
    box-sizing: border-box;
    min-height: 44px;
}

.search-option input:focus {
    outline: none;
}

.options-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 220px;
    overflow-y: auto;
}

.option-item:first-child {
    margin-top: 12px;
}

.option-item {
    margin: 4px 24px;
    padding: 12px;
    cursor: pointer;
    transition: background-color 0.15s;
    min-height: 44px;
    font-size: 16px;
    display: block;
    color: #14293F;
    font-weight: 400;
    line-height: 24px;
    letter-spacing: 0;
}

.option-item:hover {
    background-color: #e3f2fd;
}

.option-item:focus,
.option-item.highlighted {
    border-radius: 24px;
    border: 1px solid #AFABC2;
    background: #F8F8FA;

}

.option-item.selected,
.option-item[aria-selected="true"] {
    border-radius: 4px;
    border: 1px solid #488238;
    background: #EFF5EC;
}

.option-item.selected:hover,
.option-item[aria-selected="true"]:hover {
    border-radius: 24px;
    border: 1px solid #AFABC2;
    background: #F8F8FA;
}

.option-item.selected:focus,
.option-item.selected.highlighted,
.option-item[aria-selected="true"]:focus,
.option-item[aria-selected="true"].highlighted {
    border-radius: 24px;
    border: 1px solid #AFABC2;
    background: #F8F8FA;
}

.option-item:focus-visible {
    outline: 2px solid #F0F;
    outline-offset: 0;
}

.option-item.hidden {
    display: none;
}

.select-no-results {
    display: none;
    padding: 16px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

.select-no-results.show {
    display: block;
}

@media (max-width: 480px) {
    .custom-select {
        max-width: 100%;
    }
}

@media (max-width: 600px) {
    .pagination-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .pagination-bar__controls {
        justify-content: center;
        order: 1;
    }

    .pagination-bar__per-page {
        justify-content: center;
        order: 2;
    }

    .pagination-bar__btn {
        min-width: 32px;
        height: 32px;
    }

    .pagination-bar__btn--page {
        min-width: 36px;
    }

    .pagination-bar__controls,
    .pagination-bar__pages {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .profile-card-label {
        padding: 10px 12px;
    }

    .profile-avatar {
        width: 40px;
        height: 40px;
    }

    .avatar-initials {
        font-size: 15px;
    }

    .avatar-icon {
        width: 22px;
        height: 22px;
    }

    .profile-avatar--icon {
        padding: 8px;
    }

    .profile-name[data-tooltip]::after {
        left: 0;
        transform: translateX(0) translateY(4px);
    }

    .profile-name[data-tooltip]::before {
        left: 20px;
        transform: translateX(0) translateY(4px);
    }

    .profile-name[data-tooltip]:hover::before,
    .profile-name[data-tooltip]:hover::after {
        transform: translateX(0) translateY(0);
    }
}

.section-row {
    display: flex;
    gap: 16px;
    width: 100%;
}

.section-divider {
    width: 100%;
    height: 1px;
    background: #CDCAD9;
    margin-block: 12px;
}

.section-col {
    line-height: 24px;
}

.section-col:first-child {
    flex: 2;
}

.section-col:last-child {
    flex: 1;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: #212121;
    margin: 0 0 12px 0;
}

@media (max-width: 768px) {
    .section-row {
        flex-direction: column;
        gap: 16px;
    }
}

.action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    max-width: 1071px;
    margin-left: auto;
    margin-right: auto;
    padding: 24px;
    border-radius: 8px;
    border-top: 1px solid #CDCAD9;
    background: #FFF;

}

.action-bar .action-bar-content {
    max-width: 1071px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.action-bar .justify-content-end {
    justify-content: end;
}

@media (max-width: 768px) {
    .action-bar {
        padding: 16px;
    }

    .action-bar .action-bar-content {
        flex-direction: column;
        gap: 12px;
    }

    .action-bar .action-bar-content button {
        width: 100%;
    }
}

.validation-error {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    background-color: #FFF0F0;
    border: 1px solid #FF6C64;
    border-radius: 4px;
    color: #B34C46;
    font-size: 14px;
}

.validation-error .error-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.profile-card-list.has-error {
    border: 1px solid #FF6C64;
    border-radius: 4px;
    padding: 8px;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

.validation-error {
    animation: shake 0.3s ease-in-out;
}