/* 조직도 사용자 페이지 */
h3.title_sub {
    font-size:19px;
    color: #868686;
    margin-top: -20px;
    margin-bottom: 50px;
}

.orgchart-wrap {
    margin: 0 auto;
    padding: 20px 0 40px;
}

.orgchart-description {
    color: #6b7280;
    margin-bottom: 16px;
    line-height: 1.55;
}

.orgchart-empty {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 18px;
}

/* 조직도 테이블 리스트 스타일 */
.orgchart-list-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.orgchart-table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
    background: #fff;
}

.orgchart-table thead {
    background: #e6e8ea;
    color: #333;
    border-bottom: 2px solid #dcdcdc;
}

.orgchart-table thead th {
    padding: 14px 12px;
    text-align: center;
    font-weight: 600;
    color: #333;
    font-size: 14px;
    white-space: nowrap;
}

/* 컬럼별 너비 지정 */
.orgchart-table .col-position {
    width: 120px;
    min-width: 120px;
}

.orgchart-table .col-name {
    width: 140px;
    min-width: 140px;
}

.orgchart-table .col-duty {
    width: auto;
    min-width: 200px;
}

.orgchart-table .col-phone {
    width: 160px;
    min-width: 160px;
}

.orgchart-table .col-email {
    width: 220px;
    min-width: 220px;
}

.orgchart-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background-color 0.2s ease;
}

.orgchart-table tbody tr:hover {
    background-color: #f8f9fa;
}

.orgchart-table tbody tr:last-child {
    border-bottom: 1px solid #e0e0e0;
}

.orgchart-table tbody tr:nth-child(odd) {
    background-color: #fff;
}

.orgchart-table tbody tr:nth-child(even) {
    background-color: #f5f5f5;
}

.orgchart-table tbody tr:nth-child(odd):hover {
    background-color: #f8f9fa;
}

.orgchart-table tbody tr:nth-child(even):hover {
    background-color: #f8f9fa;
}

.orgchart-table tbody td {
    padding: 14px 12px;
    font-size: 13px;
    color: #5e5e5e;
    vertical-align: middle;
}

.orgchart-col-position {
    font-weight: 600;
    color: #333;
    text-align: center;
}

.orgchart-col-name {
    font-weight: 600;
    color: #222;
    text-align: center;
}

.orgchart-col-duty {
    white-space: pre-wrap;
    line-height: 1.6;
    text-align: left;
    color: #5e5e5e;
}

.orgchart-col-phone,
.orgchart-col-email {
    text-align: center;
    color: #5e5e5e;
}

/* 태블릿 반응형 (769px ~ 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .orgchart-table {
        min-width: 800px;
        font-size: 13px;
    }

    .orgchart-table thead th,
    .orgchart-table tbody td {
        padding: 12px 10px;
    }

    .orgchart-table .col-position {
        width: 100px;
        min-width: 100px;
    }

    .orgchart-table .col-name {
        width: 120px;
        min-width: 120px;
    }

    .orgchart-table .col-phone {
        width: 140px;
        min-width: 140px;
    }

    .orgchart-table .col-email {
        width: 180px;
        min-width: 180px;
    }
}

/* 모바일 반응형 (768px 이하) */
@media (max-width: 768px) {
    .orgchart-list-wrap {
        margin-top: 15px;
    }

    .orgchart-table {
        min-width: 650px;
        font-size: 12px;
    }

    .orgchart-table thead th {
        padding: 10px 8px;
        font-size: 12px;
    }

    .orgchart-table tbody td {
        padding: 10px 8px;
        font-size: 12px;
    }

    .orgchart-table .col-position {
        width: 80px;
        min-width: 80px;
    }

    .orgchart-table .col-name {
        width: 100px;
        min-width: 100px;
    }

    .orgchart-table .col-duty {
        min-width: 150px;
    }

    .orgchart-table .col-phone {
        width: 120px;
        min-width: 120px;
    }

    .orgchart-table .col-email {
        width: 150px;
        min-width: 150px;
    }

    .orgchart-col-duty {
        line-height: 1.5;
    }
}

/* 조직도 트리 구조 (이전 스타일 유지) */
.orgchart-tree-wrap {
    overflow-x: auto;
    padding: 12px 0 16px;
}

.orgchart-tree,
.orgchart-tree ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.orgchart-tree {
    min-width: max-content;
    display: flex;
    justify-content: center;
}

/* 최상위 item 그룹 */
.orgchart-tree {
    display: flex;
    justify-content: center;
}

/* 자식 UL: 가로 배치 */
.orgchart-item > ul {
    display: flex;
    justify-content: center;
    gap: 16px;
    position: relative;
    margin-top: 0;
    padding-top: 40px;
}

/* 부모 카드에서 자식 그룹 가로선까지의 세로선 */
.orgchart-item > ul::before {
    content: "";
    position: absolute;
    top: -20px;
    left: 50%;
    width: 0;
    height: 20px;
    border-left: 2px solid #94a3b8;
    transform: translateX(-50%);
}

/* 자식 그룹의 가로 연결선 (실제 자식 카드 위치에만) */
.orgchart-item > ul::after {
    content: "";
    position: absolute;
    top: 20px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: #94a3b8;
}

.orgchart-item {
    position: relative;
    text-align: center;
    padding: 0;
}

/* 자식 item: 가로선에서 카드로 내려오는 세로선 */
.orgchart-item > ul > .orgchart-item {
    position: relative;
}

.orgchart-item > ul > .orgchart-item::before {
    content: "";
    position: absolute;
    top: -40px;
    left: 50%;
    width: 0;
    height: 40px;
    border-left: 2px solid #94a3b8;
    transform: translateX(-50%);
}

/* 최상위 레벨 item은 상단 세로선 제거 */
.orgchart-tree > .orgchart-item::before {
    display: none;
}

.orgchart-node {
    position: relative;
    display: inline-block;
    width: 284px;
    max-width: 284px;
    min-height: 122px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    padding: 13px 15px;
    text-align: left;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.orgchart-node:hover {
    border-color: #192f55;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.orgchart-role,
.orgchart-name,
.orgchart-dept,
.orgchart-contact {
    font-size: 13px;
    color: #5e5e5e;
    line-height: 1.5;
}

.orgchart-role,
.orgchart-dept,
.orgchart-contact {
    margin-top: 5px;
}

.orgchart-name {
    margin-top: 2px;
    font-size: 14px;
    color: #222;
    font-weight: 600;
}

.orgchart-role strong,
.orgchart-name strong,
.orgchart-dept strong,
.orgchart-contact strong {
    color: #222;
}

@media (max-width: 980px) {
    .orgchart-tree {
        min-width: 100%;
    }

    .orgchart-tree ul {
        display: block;
        margin-top: 10px;
        padding-top: 0;
        padding-left: 14px;
        gap: 0;
    }

    .orgchart-tree ul::before,
    .orgchart-tree ul::after,
    .orgchart-item::before {
        display: none;
    }

    .orgchart-tree ul {
        border-left: 2px dashed #cbd5e1;
    }

    .orgchart-item {
        padding: 0;
        margin: 0 0 12px;
        display: block;
    }

    .orgchart-node {
        width: 100%;
        max-width: none;
        min-height: 0;
    }
}

.admin_edit_btn {
    text-align: right;
    margin-top: 10px;
}

.admin_edit_btn .btn_admin_edit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 100px;
    padding: 6px 14px;
    background-color: #1a73e8;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.admin_edit_btn .btn_admin_edit:hover {
    background-color: #155dbd;
}

.admin_edit_btn .btn_admin_edit:active {
    transform: translateY(1px);
}