/* --------------------------------------------------------------------------
 * 마이페이지 — 왼쪽 내 정보(머리글자 동그라미 · 이름 · 항목 격자 · 바로 가기), 오른쪽 입력 카드.
 * -------------------------------------------------------------------------- */
.mypage-profile {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--ln);
}
.mypage-avatar {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 50%;
    background: var(--brand-accent);
    color: var(--brand-ink);
    font-size: 1.25rem;
    font-weight: 700;
}
.mypage-name {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
    color: var(--tx-strong);
    font-size: 1.125rem;
    font-weight: 700;
}
.mypage-detail {
    margin: 1rem 0 0;
    font-size: 0.875rem;
}
.mypage-detail dd {
    margin-bottom: 0;
}
.mypage-links .list-group-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}
.mypage-form {
    grid-template-columns: 8.5rem 1fr;
}
@media (max-width: 575.98px) {
    .mypage-form {
        grid-template-columns: 1fr;
    }
}

/* --------------------------------------------------------------------------
 * 프로필 사진(x-avatar) — 사진이 있으면 동그라미를 사진으로 채운다. 크기 · 색은 각 자리의 class 가 정한다.
 * -------------------------------------------------------------------------- */
.avatar-circle {
    overflow: hidden;
    user-select: none;
}
.avatar-circle.has-photo {
    background: var(--sf-raised);
}
.avatar-circle > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 마이페이지 — 동그라미를 누르면 사진 고르기, 오른쪽 아래 카메라 표시 */
.mypage-avatar-pick {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
    margin: 0;
    border-radius: 50%;
    cursor: pointer;
}
.mypage-avatar-pick .mypage-avatar {
    width: 4.5rem;
    height: 4.5rem;
    font-size: 1.75rem;
}
.mypage-avatar-camera {
    position: absolute;
    right: -0.125rem;
    bottom: -0.125rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border: 2px solid var(--sf-card);
    border-radius: 50%;
    background: var(--tx-strong);
    color: var(--sf-card);
}
.mypage-avatar-camera svg {
    width: 0.875rem;
    height: 0.875rem;
}
.mypage-avatar-pick:hover .mypage-avatar {
    filter: brightness(0.92);
}
.mypage-avatar-pick:focus-within {
    box-shadow: 0 0 0 3px var(--theme-focus-ring-color);
}

/* 조직도 — 이름 앞 작은 사진, 사진이 있으면 눌러 크게 본다 */
.org-person {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}
.org-avatar {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--theme-primary-bg-subtle);
    color: var(--brand-emph);
    font-size: 0.8125rem;
    font-weight: 700;
}
.org-avatar-button {
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    cursor: zoom-in;
}
.org-avatar-button:focus-visible {
    box-shadow: 0 0 0 3px var(--theme-focus-ring-color);
}
.avatar-preview {
    overflow: hidden;
    border-radius: 1rem;
}
.avatar-preview > img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: var(--sf-raised);
}
.avatar-preview-body {
    padding: 0.75rem 1rem;
    text-align: center;
}
.avatar-preview-close {
    position: absolute;
    top: 0.625rem;
    right: 0.625rem;
    z-index: 1;
    padding: 0.5rem;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.85);
}


/* --------------------------------------------------------------------------
 * 조직도 트리 보기 — 부서 머리(펼침 화살표 · 이름 · 인원) 아래 직원 줄, 하위 부서는 왼쪽 선을 따라 들여 쓴다.
 * 직원 줄: 사진 · 이름 | 직급 | 내선 | 휴대폰 | 쪽지 — 칸 폭을 맞춰 한눈에(좁으면 직급 · 휴대폰을 숨긴다).
 * -------------------------------------------------------------------------- */
.icon-xs {
    width: 0.8125rem;
    height: 0.8125rem;
}
.org-tree-view {
    padding-top: 0.5rem;
}
.org-tree-node > .org-tree-body {
    margin-left: 0.6875rem;
    padding-left: 0.875rem;
    border-left: 1px solid var(--ln-soft);
}
.org-tree-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4375rem 0.25rem;
    border-radius: 0.375rem;
    color: var(--tx-strong);
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}
.org-tree-head::-webkit-details-marker {
    display: none;
}
.org-tree-head:hover {
    background: var(--sf-hover);
}
.org-tree-chevron {
    flex-shrink: 0;
    width: 1rem;
    height: 1rem;
    color: var(--tx-muted);
    transition: transform 0.12s ease;
}
.org-tree-node[open] > .org-tree-head .org-tree-chevron {
    transform: rotate(90deg);
}
.org-tree-node[data-depth="0"] > .org-tree-head {
    font-size: 1rem;
}
.org-tree-head .badge-count {
    background: var(--sf-raised);
    color: var(--tx-muted);
}
.org-tree-members {
    margin: 0 0 0.25rem;
    padding: 0;
    list-style: none;
}
.org-tree-member {
    display: grid;
    grid-template-columns: minmax(9rem, 14rem) 6rem 6rem 9rem 2.5rem;
    gap: 0.75rem;
    align-items: center;
    padding: 0.3125rem 0.25rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
}
.org-tree-member:hover {
    background: var(--sf-hover);
}
.org-tree-cell {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.org-tree-cell svg {
    color: var(--tx-muted);
}
.org-tree-action {
    text-align: right;
}
.org-tree-member .org-avatar {
    width: 1.75rem;
    height: 1.75rem;
    font-size: 0.75rem;
}
@media (max-width: 767.98px) {
    .org-tree-member {
        grid-template-columns: minmax(0, 1fr) 5.5rem 2.5rem;
    }
    .org-tree-member > .org-tree-cell:nth-of-type(1),
    .org-tree-member > .org-tree-cell:nth-of-type(3) {
        display: none;
    }
}

/* 조직도 왼쪽 부서 트리 — 맨 위 조직 이름(1단계)은 굵게, 넓은 화면에서는 따라 내려오고 길면 안에서 스크롤 */
.org-nav-root {
    font-weight: 600;
}
@media (min-width: 992px) {
    .org-department-nav {
        position: sticky;
        top: calc(var(--theme-topbar-height) + 1rem);
        max-height: calc(100vh - var(--theme-topbar-height) - 2rem);
        overflow-y: auto;
    }
}

/* 조직도 보기 토글(아이콘만) — 글자가 없어 검색칸 · 검색 버튼보다 낮았다. 같은 줄의 높이에 맞춰 늘이고 아이콘은 가운데. */
.org-view-toggle {
    align-self: stretch;
}
.org-view-toggle .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
}
