/* =========================================================
   GENEALOGY TREE (member + admin)
   ========================================================= */

.gn-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}

.gn-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

    .gn-controls input,
    .gn-controls select {
        padding: 10px 13px;
        border: 1px solid #e1e3ee;
        border-radius: 10px;
        font-size: 13px;
        color: #20243a;
        background: #fff;
        outline: none;
        font-family: inherit;
    }

    .gn-controls input {
        width: 210px;
    }

        .gn-controls input:focus,
        .gn-controls select:focus {
            border-color: #5b4bdb;
            box-shadow: 0 0 0 3px rgba(91, 75, 219, 0.08);
        }

.gn-btn {
    border: none;
    background: #5b4bdb;
    color: #fff;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

    .gn-btn:hover {
        background: #4435bd;
    }

    .gn-btn.light {
        background: #f0eefe;
        color: #5b4bdb;
    }

        .gn-btn.light:hover {
            background: #e4e0fd;
        }

    .gn-btn:disabled {
        opacity: 0.45;
        cursor: not-allowed;
    }

.gn-message {
    font-size: 13px;
    color: #b91c1c;
    min-height: 18px;
    margin-bottom: 6px;
}

.gn-scroll {
    width: 100%;
    overflow: auto;
    padding: 10px 0 25px;
}

/* ---------- classic CSS tree with connector lines ---------- */
.gn-tree {
    display: inline-block;
    min-width: 100%;
    text-align: center;
}

    .gn-tree ul {
        position: relative;
        display: flex;
        justify-content: center;
        padding-top: 26px;
        margin: 0;
        list-style: none;
    }

    .gn-tree > ul {
        padding-top: 0;
    }

    .gn-tree li {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 26px 8px 0;
        list-style: none;
    }

    .gn-tree > ul > li {
        padding-top: 0;
    }

        /* horizontal + vertical lines to parent */
        .gn-tree li::before,
        .gn-tree li::after {
            content: "";
            position: absolute;
            top: 0;
            right: 50%;
            width: 50%;
            height: 26px;
            border-top: 2px solid #d5d8e8;
        }

        .gn-tree li::after {
            right: auto;
            left: 50%;
            border-left: 2px solid #d5d8e8;
        }

        .gn-tree li:only-child::before,
        .gn-tree li:only-child::after {
            display: none;
        }

        .gn-tree li:first-child::before,
        .gn-tree li:last-child::after {
            border: 0 none;
        }

        .gn-tree li:last-child::before {
            border-right: 2px solid #d5d8e8;
            border-radius: 0 8px 0 0;
        }

        .gn-tree li:first-child::after {
            border-radius: 8px 0 0 0;
        }

    /* line down from parent */
    .gn-tree ul ul::before {
        content: "";
        position: absolute;
        top: 0;
        left: 50%;
        height: 26px;
        border-left: 2px solid #d5d8e8;
    }

/* ---------- node card ---------- */
.gn-node {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 150px;
    padding: 14px 10px 12px;
    background: #fff;
    border: 1px solid #e6e8f2;
    border-top: 4px solid #5b4bdb;
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(30, 35, 80, 0.06);
    font-family: inherit;
    cursor: pointer;
    transition: 0.2s ease;
}

button.gn-node:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 26px rgba(30, 35, 80, 0.12);
}

.gn-node strong {
    color: #20243a;
    font-size: 13px;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gn-node small {
    color: #858ba3;
    font-size: 11px;
}

.gn-avatar {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #5b4bdb;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 4px;
}

.gn-root {
    border-top-color: #f59e0b;
}

    .gn-root .gn-avatar {
        background: linear-gradient(135deg, #f59e0b, #f97316);
    }

.gn-left {
    border-top-color: #2563eb;
}

    .gn-left .gn-avatar {
        background: #2563eb;
    }

.gn-right {
    border-top-color: #16a34a;
}

    .gn-right .gn-avatar {
        background: #16a34a;
    }

.gn-inactive {
    opacity: 0.6;
}

    .gn-inactive .gn-avatar {
        background: #9ca3af;
    }

.gn-counts {
    display: flex;
    gap: 6px;
    margin-top: 4px;
}

    .gn-counts span {
        font-size: 10px;
        font-weight: 700;
        padding: 3px 7px;
        border-radius: 999px;
        background: #f3f4fa;
        color: #4b5270;
    }

.gn-status {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
}

    .gn-status.on {
        background: #dcfce7;
        color: #15803d;
    }

    .gn-status.off {
        background: #fee2e2;
        color: #b91c1c;
    }

.gn-more {
    font-size: 10px;
    color: #5b4bdb;
    font-weight: 700;
    margin-top: 2px;
}

.gn-empty {
    cursor: default;
    border: 2px dashed #d5d8e8;
    border-top: 2px dashed #d5d8e8;
    box-shadow: none;
    background: #fafbff;
}

    .gn-empty .gn-avatar {
        background: #eceef6;
        color: #9aa0b8;
    }

    .gn-empty strong {
        color: #9aa0b8;
    }

.gn-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    font-size: 12px;
    color: #858ba3;
    margin-top: 10px;
}

    .gn-legend i {
        display: inline-block;
        width: 10px;
        height: 10px;
        border-radius: 50%;
        margin-right: 6px;
        vertical-align: -1px;
    }

.gn-loading {
    padding: 40px;
    color: #858ba3;
    font-size: 14px;
}
