body.recruit-page {
    background: #eef3f8;
}

.recruit-shell {
    display: grid;
    gap: 0.9rem;
}

.recruit-hero,
.recruit-panel {
    border: 1px solid #e5edf6;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.05);
}

.recruit-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
}

.recruit-hero h1 {
    margin: 0.2rem 0 0.35rem;
    color: #101828;
    font-size: 1.8rem;
}

.recruit-hero p {
    max-width: 720px;
    margin: 0;
    color: #667085;
    line-height: 1.7;
}

.recruit-mode-switch {
    display: inline-flex;
    gap: 0.35rem;
    padding: 0.28rem;
    border: 1px solid #dce7f4;
    border-radius: 12px;
    background: #f8fbff;
}

.recruit-mode-switch button {
    height: 38px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #475467;
    padding: 0 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
}

.recruit-mode-switch button.active {
    background: #0f766e;
    color: #fff;
}

.recruit-panel {
    display: none;
    overflow: hidden;
}

.recruit-panel.active {
    display: block;
}

.recruit-toolbar,
.tree-actions {
    min-height: 64px;
    padding: 0.95rem 1rem;
    border-bottom: 1px solid #edf2f7;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.recruit-toolbar strong,
.tree-actions strong {
    display: block;
    color: #101828;
}

.recruit-toolbar span,
.tree-actions span {
    display: block;
    margin-top: 0.25rem;
    color: #667085;
    font-size: 0.86rem;
}

.recruit-search,
.tree-buttons {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.recruit-search .search-box {
    width: 280px;
}

.recruit-date {
    height: 38px;
    border: 1px solid #d8e1ec;
    border-radius: 10px;
    background: #fff;
    color: #344054;
    padding: 0 0.72rem;
    font: inherit;
    font-weight: 700;
    outline: none;
}

.recruit-table-wrap {
    overflow-x: auto;
}

.recruit-table {
    width: 100%;
    min-width: 1140px;
    border-collapse: collapse;
}

.recruit-table th,
.recruit-table td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid #eef2f6;
    text-align: left;
    vertical-align: middle;
}

.recruit-table th {
    background: #fbfcfe;
    color: #667085;
    font-size: 0.86rem;
    font-weight: 900;
}

.recruit-user-cell,
.detail-user-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.recruit-avatar,
.detail-avatar,
.profile-tree-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #2563eb;
    color: #fff;
    font-weight: 900;
    overflow: hidden;
}

.recruit-avatar {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
}

.detail-avatar {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    border-radius: 14px;
}

.recruit-avatar img,
.detail-avatar img,
.profile-tree-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recruit-user-main strong,
.recruit-user-main span,
.sponsor-cell strong,
.sponsor-cell span {
    display: block;
}

.recruit-user-main strong {
    color: #101828;
}

.recruit-user-main span,
.muted-text,
.sponsor-cell span {
    color: #667085;
    font-size: 0.84rem;
}

.user-code,
.level-chip,
.base-tag,
.downline-count-chip {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 900;
}

.user-code {
    margin-left: 0.35rem;
    padding: 0.12rem 0.45rem;
    background: #eef4ff;
    color: #3157a5;
}

.level-chip {
    margin-top: 0.2rem;
    padding: 0.18rem 0.55rem;
    background: #ecfdf3;
    color: #087443;
}

.base-tag {
    margin: 0.2rem 0.35rem 0 0;
    padding: 0.18rem 0.55rem;
    border: 1px solid transparent;
}

.base-tag.super {
    border-color: rgba(242, 94, 67, 0.34);
    background: rgba(242, 94, 67, 0.12);
    color: rgb(242, 94, 67);
}

.base-tag.base {
    border-color: rgba(100, 213, 114, 0.38);
    background: rgba(100, 213, 114, 0.14);
    color: rgb(100, 213, 114);
}

.downline-count-chip {
    gap: 0.3rem;
    padding: 0.25rem 0.62rem;
    background: #f8fbff;
    color: #3157a5;
    border: 1px solid #dbe7f5;
}

.view-btn {
    min-height: 34px;
    padding: 0 0.75rem;
}

.recruit-mobile-list {
    display: none;
    padding: 1rem;
}

.recruit-mobile-card {
    border: 1px solid #e5edf6;
    border-radius: 14px;
    background: #fff;
    padding: 0.85rem;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.recruit-mobile-card + .recruit-mobile-card {
    margin-top: 0.85rem;
}

.recruit-mobile-head {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: flex-start;
}

.recruit-mobile-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    margin: 0.85rem 0;
}

.recruit-mobile-meta span {
    display: block;
    color: #667085;
    font-size: 0.78rem;
}

.recruit-mobile-meta strong {
    display: block;
    margin-top: 0.15rem;
    color: #101828;
    font-size: 0.88rem;
    word-break: break-word;
}

.tree-stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.75rem;
    padding: 1rem;
    border-bottom: 1px solid #edf2f7;
}

.tree-stats article {
    border: 1px solid #e5edf6;
    border-radius: 12px;
    background: #f8fbff;
    padding: 0.9rem;
}

.tree-stats span,
.tree-stats strong {
    display: block;
}

.tree-stats span {
    color: #667085;
    font-size: 0.82rem;
    font-weight: 800;
}

.tree-stats strong {
    margin-top: 0.25rem;
    color: #101828;
    font-size: 1.35rem;
}

.profile-tree-container {
    min-height: 520px;
    overflow: auto;
    padding: 1.25rem;
}

.profile-tree {
    min-width: 520px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.profile-tree ul {
    position: relative;
    margin: 0.45rem 0 0 2.05rem;
    padding-left: 2rem;
    list-style: none;
}

.profile-tree li {
    position: relative;
    padding: 0.55rem 0;
}

.profile-tree ul::before {
    content: "";
    position: absolute;
    top: -0.45rem;
    bottom: 2.1rem;
    left: 0;
    width: 1px;
    background: #d8e2ee;
}

.profile-tree li::before {
    content: "";
    position: absolute;
    top: 1.65rem;
    left: -2rem;
    width: 2rem;
    height: 1px;
    background: #d8e2ee;
}

.profile-tree ul > li:last-child::after {
    content: "";
    position: absolute;
    left: -2rem;
    top: 1.7rem;
    bottom: 0;
    width: 1px;
    background: #fff;
}

.profile-tree > li {
    padding-left: 0;
}

.profile-tree > li::before {
    display: none;
}

.profile-tree ul.collapsed {
    display: none;
}

.profile-tree-node {
    display: grid;
    grid-template-columns: 22px 34px minmax(96px, 1fr) auto;
    align-items: center;
    gap: 0.45rem;
    width: 230px;
    min-height: 54px;
    border: 1px solid #dfe8f2;
    border-radius: 10px;
    background: #fff;
    padding: 0.45rem;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
    cursor: pointer;
}

.profile-tree-node.root {
    border-color: #99f6e4;
    background: #f0fdfa;
}

.profile-tree-node:hover {
    border-color: #93c5fd;
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.12);
}

.profile-tree-toggle,
.profile-tree-placeholder {
    width: 22px;
    height: 22px;
}

.profile-tree-toggle {
    border: 0;
    border-radius: 7px;
    background: #eaf2ff;
    color: #2563eb;
    cursor: pointer;
}

.profile-tree-toggle i {
    transition: transform 0.18s ease;
}

.profile-tree-toggle.collapsed i {
    transform: rotate(-90deg);
}

.profile-tree-avatar {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
}

.profile-tree-info {
    min-width: 0;
}

.profile-tree-info strong,
.profile-tree-info span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-tree-info strong {
    color: #101828;
    font-size: 0.9rem;
}

.profile-tree-info span {
    color: #0f766e;
    font-size: 0.72rem;
    font-weight: 900;
}

.profile-tree-info .base-tag {
    display: inline-flex;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

.profile-tree-info .base-tag {
    margin-right: 0.25rem;
}

.profile-tree-count {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    height: 24px;
    border: 1px solid #dbe7f5;
    border-radius: 999px;
    background: #f8fbff;
    color: #667085;
    padding: 0 0.45rem;
    font-size: 0.68rem;
    font-weight: 900;
}

.detail-grid,
.recruit-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.recruit-detail-modal .modal-panel {
    width: min(760px, calc(100vw - 24px));
}

.recruit-detail-modal .modal-body {
    max-height: min(70vh, 620px);
    overflow: auto;
}

.recruit-detail-grid {
    padding: 0.25rem;
}

.recruit-detail-card {
    position: relative;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 1rem;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.recruit-detail-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: linear-gradient(90deg, #2563eb, #0f766e);
}

.recruit-detail-card header {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding-bottom: 0.7rem;
    border-bottom: 1px solid #f3f4f6;
}

.recruit-detail-card header i {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.85rem;
}

.recruit-detail-card header strong {
    color: #1e293b;
    font-size: 0.9rem;
    font-weight: 800;
}

.recruit-detail-list {
    display: grid;
    gap: 0.58rem;
    padding-top: 0.7rem;
}

.recruit-detail-row {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 0.55rem;
    align-items: start;
}

.recruit-detail-row span {
    color: #94a3b8;
    font-size: 0.78rem;
    font-weight: 600;
}

.recruit-detail-row strong {
    min-width: 0;
    color: #1e293b;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.empty-table {
    padding: 2rem 1rem;
    text-align: center;
    color: #667085;
}

.detail-field {
    border: 1px solid #e5edf6;
    border-radius: 10px;
    background: #fbfdff;
    padding: 0.72rem;
}

.detail-field.wide {
    grid-column: 1 / -1;
}

.detail-field span,
.detail-field strong {
    display: block;
}

.detail-field span {
    color: #667085;
    font-size: 0.78rem;
    font-weight: 800;
}

.detail-field strong {
    margin-top: 0.2rem;
    color: #101828;
    font-size: 0.92rem;
    word-break: break-word;
}

.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.65rem;
    padding: 0.95rem 1rem;
    border-top: 1px solid #edf2f7;
    color: #475467;
    font-size: 0.92rem;
}

.pagination-bar.is-loading {
    opacity: 0.58;
    pointer-events: none;
}

.pagination-bar button {
    border: 1px solid #d8e1ec;
    border-radius: 10px;
    background: #fff;
    color: #1f2937;
    padding: 0.55rem 0.9rem;
    cursor: pointer;
    font: inherit;
}

.pagination-bar button:disabled {
    cursor: not-allowed;
    color: #98a2b3;
    background: #f8fafc;
}

.pagination-pages {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.pagination-bar .page-number {
    min-width: 36px;
    padding: 0.55rem 0.65rem;
}

.pagination-bar .page-number.active {
    border-color: #2563eb;
    background: #2563eb;
    color: #fff;
}

.pagination-ellipsis,
.pagination-total {
    color: #667085;
    font-weight: 700;
}

@media (max-width: 900px) {
    .recruit-hero,
    .recruit-toolbar,
    .tree-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .recruit-search,
    .tree-buttons {
        flex-wrap: nowrap;
    }

    .recruit-search .search-box {
        flex: 1;
        min-width: 0;
        width: auto;
    }

    .tree-stats {
        grid-template-columns: 1fr;
    }

    .recruit-table-wrap {
        display: none;
    }

    .recruit-mobile-list {
        display: block;
    }

    .pagination-bar {
        justify-content: center;
    }
}

@media (max-width: 560px) {
    .recruit-search {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 48px;
        gap: 0.62rem;
        width: 100%;
        align-items: center;
    }

    .recruit-search .search-box {
        grid-column: 1 / -1;
        width: 100%;
        min-width: 0;
    }

    .recruit-date {
        width: 100%;
        min-width: 0;
        padding: 0 0.45rem;
    }

    .recruit-search .action-btn {
        width: 48px;
        min-width: 48px;
        height: 40px;
        padding: 0;
    }

    .recruit-mobile-meta,
    .detail-grid,
    .recruit-detail-grid {
        grid-template-columns: 1fr;
    }

    .recruit-detail-row {
        grid-template-columns: 74px minmax(0, 1fr);
    }

    .profile-tree-container {
        padding: 1rem;
    }
}
