/* Modern Team Business / Phòng Kinh doanh UI for account.php. */

#team-business-section.team-business-dashboard {
    --team-brand: #078b54;
    --team-brand-dark: #056b41;
    --team-brand-soft: #edf9f3;
    --team-ink: #17251e;
    --team-muted: #748179;
    --team-border: #e1e9e4;
    --team-surface: #fff;
    --team-shadow: 0 12px 30px rgba(26,61,43,.07);
    color: var(--team-ink);
    padding-bottom: 0;
}

#team-business-section .team-business-hero {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 18px;
    padding: 23px 25px;
    border-radius: 20px;
    color: #fff;
    background:
        radial-gradient(circle at 88% 18%, rgba(255,255,255,.16), transparent 28%),
        linear-gradient(135deg,#057447 0%,#0a9258 58%,#13a667 100%);
    box-shadow: 0 16px 38px rgba(7,139,84,.16);
}

#team-business-section .team-business-hero-icon {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    background: rgba(255,255,255,.14);
    font-size: 22px;
}

#team-business-section .team-business-hero-copy {
    min-width: 0;
    flex: 1;
}

#team-business-section .team-business-eyebrow {
    display: block;
    margin-bottom: 3px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .75px;
    text-transform: uppercase;
    opacity: .84;
}

#team-business-section .team-business-hero h4 {
    margin: 0 0 4px;
    font-size: 25px;
    font-weight: 800;
    letter-spacing: -.35px;
}

#team-business-section .team-business-hero p {
    margin: 0;
    color: rgba(255,255,255,.82);
    font-size: 13px;
    line-height: 1.5;
}

#team-business-section .team-business-load-btn {
    flex: 0 0 auto;
    min-height: 43px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 15px;
    border: 1px solid rgba(255,255,255,.24);
    border-radius: 12px;
    color: #fff;
    background: rgba(255,255,255,.12);
    font-size: 11px;
    font-weight: 800;
    transition: background .2s ease, transform .2s ease, border-color .2s ease;
}

#team-business-section .team-business-load-btn:hover,
#team-business-section .team-business-load-btn:focus {
    color: #fff;
    border-color: rgba(255,255,255,.42);
    background: rgba(255,255,255,.20);
    transform: translateY(-1px);
}

#team-business-section .team-business-load-btn:disabled {
    opacity: .72;
    transform: none;
}

#team-business-section .team-business-stats {
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 12px;
    margin-bottom: 18px;
}

#team-business-section .team-stat-card {
    display: flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
    padding: 15px 16px;
    border: 1px solid var(--team-border);
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(26,61,43,.05);
}

#team-business-section .team-stat-icon {
    width: 45px;
    height: 45px;
    flex: 0 0 45px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    color: var(--team-brand);
    background: var(--team-brand-soft);
    font-size: 18px;
}

#team-business-section .team-stat-copy {
    min-width: 0;
}

#team-business-section .team-stat-copy span,
#team-business-section .team-stat-copy strong,
#team-business-section .team-stat-copy small {
    display: block;
}

#team-business-section .team-stat-copy span {
    color: #7f8d85;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .45px;
    text-transform: uppercase;
}

#team-business-section .team-stat-copy strong {
    margin: 2px 0 1px;
    color: #23362c;
    font-size: 25px;
    line-height: 1.05;
    font-weight: 850;
}

#team-business-section .team-stat-copy small {
    color: #89958e;
    font-size: 8px;
}

#team-business-section .team-business-panel {
    margin-bottom: 18px;
    padding: 21px;
    border: 1px solid var(--team-border);
    border-radius: 18px;
    background: var(--team-surface);
    box-shadow: var(--team-shadow);
}

#team-business-section .team-business-panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

#team-business-section .team-business-panel-kicker {
    color: var(--team-brand);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .75px;
    text-transform: uppercase;
}

#team-business-section .team-business-panel-heading h5 {
    margin: 2px 0 0;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -.2px;
}

#team-business-section .team-business-panel-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: var(--team-brand);
    background: var(--team-brand-soft);
}

#team-business-section .team-business-empty,
#team-business-section .team-business-error,
#team-business-section .team-business-loading,
#team-business-section .team-level-empty {
    min-height: 230px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 24px 16px;
    border-radius: 15px;
    text-align: center;
}

#team-business-section .team-business-empty {
    border: 1px dashed #ceddd5;
    color: #7b8981;
    background: #fafdfb;
}

#team-business-section .team-business-loading {
    color: #718078;
    background: #fafcfb;
}

#team-business-section .team-business-loading .spinner-border {
    color: var(--team-brand);
}

#team-business-section .team-business-loading strong {
    color: #405048;
    font-size: 12px;
}

#team-business-section .team-business-loading span {
    font-size: 9px;
}

#team-business-section .team-business-empty-icon,
#team-business-section .team-business-error-icon {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    margin-bottom: 3px;
    border-radius: 17px;
    font-size: 24px;
}

#team-business-section .team-business-empty-icon {
    color: var(--team-brand);
    background: var(--team-brand-soft);
}

#team-business-section .team-business-empty strong,
#team-business-section .team-business-error strong,
#team-business-section .team-level-empty strong {
    color: #405048;
    font-size: 13px;
}

#team-business-section .team-business-empty > span,
#team-business-section .team-business-error > span,
#team-business-section .team-level-empty > span {
    max-width: 430px;
    font-size: 10px;
    line-height: 1.5;
}

#team-business-section .team-business-empty button,
#team-business-section .team-business-error button {
    min-height: 39px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 5px;
    padding: 0 13px;
    border-radius: 10px;
    font-size: 9px;
    font-weight: 750;
}

#team-business-section .team-business-empty button {
    color: #fff;
    border: 1px solid var(--team-brand);
    background: var(--team-brand);
}

#team-business-section .team-business-error {
    min-height: 220px;
    border: 1px dashed #e8c4c4;
    color: #886565;
    background: #fff9f9;
}

#team-business-section .team-business-error.compact {
    min-height: 150px;
}

#team-business-section .team-business-error-icon {
    color: #b54b4b;
    background: #ffeded;
}

#team-business-section .team-business-error button {
    color: #9f4747;
    border: 1px solid #dfb9b9;
    background: #fff;
}

/* Tree */
#team-business-section .hierarchy-tree-container {
    overflow-x: auto;
    overflow-y: visible;
    padding: 0 0 5px;
    -webkit-overflow-scrolling: touch;
}

#team-business-section .hierarchy-tree-container .hierarchy-content {
    min-width: 0;
}

#team-business-section .team-tree-level {
    margin: 0 0 14px;
    padding: 13px;
    border: 1px solid #e3ebe6;
    border-radius: 14px;
    background: #fbfcfb;
}

#team-business-section .team-tree-level:last-child {
    margin-bottom: 0;
}

#team-business-section .team-tree-level .level-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 10px;
    padding: 0 2px;
}

#team-business-section .team-tree-level .level-title > div > span {
    display: block;
    color: #849188;
    font-size: 7px;
    font-weight: 800;
    letter-spacing: .45px;
    text-transform: uppercase;
}

#team-business-section .team-tree-level .level-title > div > strong {
    display: block;
    margin-top: 2px;
    color: #32443a;
    font-size: 12px;
}

#team-business-section .team-level-count {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 0 8px;
    border-radius: 999px;
    color: #087448;
    background: #e8f7ef;
    font-size: 8px;
    font-weight: 750;
    white-space: nowrap;
}

#team-business-section .hierarchy-tree-container .level-nodes {
    display: grid;
    grid-template-columns: repeat(auto-fill,minmax(180px,1fr));
    gap: 9px;
    padding: 0;
}

#team-business-section .hierarchy-tree-container .tree-node {
    min-width: 0;
}

#team-business-section .hierarchy-tree-container .node-card.team-member-node {
    width: 100%;
    min-height: 0;
    padding: 12px;
    border: 1px solid #e0e8e3;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(26,61,43,.035);
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

#team-business-section .hierarchy-tree-container .node-card.team-member-node:hover {
    transform: translateY(-2px);
    border-color: #b9d4c5;
    box-shadow: 0 8px 18px rgba(26,61,43,.07);
}

#team-business-section .team-member-node-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 9px;
}

#team-business-section .node-avatar,
#team-business-section .member-avatar {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    color: #fff;
    background: linear-gradient(135deg,#078b54,#12a66a);
    font-size: 11px;
    font-weight: 850;
    box-shadow: 0 5px 12px rgba(7,139,84,.13);
}

#team-business-section .team-member-level {
    padding: 4px 7px;
    border-radius: 999px;
    color: #617168;
    background: #f0f4f2;
    font-size: 7px;
    font-weight: 750;
}

#team-business-section .hierarchy-tree-container .node-name {
    min-height: 34px;
    color: #304239;
    font-size: 11px;
    line-height: 1.4;
    font-weight: 800;
    overflow-wrap: anywhere;
}

#team-business-section .hierarchy-tree-container .node-card .node-id {
    display: grid;
    gap: 6px;
    margin-top: 9px;
    padding-top: 9px;
    border-top: 1px solid #edf2ef;
    font-size: 8px;
}

#team-business-section .hierarchy-tree-container .node-card .node-id > div {
    display: grid;
    grid-template-columns: 14px 46px minmax(0,1fr);
    gap: 5px;
    align-items: start;
    margin: 0;
    color: #7a8880;
}

#team-business-section .hierarchy-tree-container .node-card .node-id i {
    margin-top: 2px;
    color: #91a098;
}

#team-business-section .hierarchy-tree-container .node-card .node-id span {
    font-weight: 700;
}

#team-business-section .hierarchy-tree-container .node-card .node-id strong {
    color: #4d5e55;
    font-weight: 750;
    overflow-wrap: anywhere;
}

/* Search + room tools */
#team-business-section .team-business-toolbar {
    display: grid;
    gap: 13px;
}

#team-business-section .team-business-current-room {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 11px;
    border: 1px solid #e3ebe6;
    border-radius: 12px;
    background: #fafcfb;
}

#team-business-section .team-business-current-room > span {
    color: #7d8a82;
    font-size: 9px;
    font-weight: 750;
}

#team-business-section .level-tabs {
    overflow: visible;
    padding: 0;
}

#team-business-section .team-room-tab {
    min-height: 31px;
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    border: 1px solid #afd0bd;
    border-radius: 9px !important;
    color: var(--team-brand);
    background: #fff;
    font-size: 9px;
    font-weight: 800;
}

#team-business-section .btn-check:checked + .team-room-tab {
    color: #fff;
    border-color: var(--team-brand);
    background: var(--team-brand);
    box-shadow: none;
}

#team-business-section .team-business-search-grid {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 10px;
}

#team-business-section .team-business-search-box {
    min-width: 0;
    padding: 12px;
    border: 1px solid #e3ebe6;
    border-radius: 12px;
    background: #fff;
}

#team-business-section .team-business-search-box > label {
    display: block;
    margin-bottom: 6px;
    color: #53635a;
    font-size: 9px;
    font-weight: 750;
}

#team-business-section .team-business-input-row {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    gap: 7px;
}

#team-business-section .team-business-input-wrap {
    position: relative;
    min-width: 0;
}

#team-business-section .team-business-input-wrap > i {
    position: absolute;
    left: 11px;
    top: 50%;
    z-index: 2;
    width: 15px;
    color: #87948d;
    text-align: center;
    transform: translateY(-50%);
    pointer-events: none;
}

#team-business-section .team-business-input-wrap .form-control {
    min-height: 39px;
    padding-left: 35px;
    border: 1px solid #dce6e0;
    border-radius: 10px;
    color: #26372e;
    background: #fff;
    box-shadow: none;
    font-size: 10px;
}

#team-business-section .team-business-input-wrap .form-control:focus {
    border-color: #66b691;
    box-shadow: 0 0 0 3px rgba(7,139,84,.08);
}

#team-business-section .team-business-input-row button {
    min-height: 39px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 11px;
    border: 1px solid var(--team-brand);
    border-radius: 10px;
    color: #fff;
    background: var(--team-brand);
    font-size: 9px;
    font-weight: 750;
}

#team-business-section .team-business-input-row button.is-search {
    border-color: #3e718e;
    background: #3e718e;
}

#team-business-section .team-business-level-content {
    margin-top: 14px;
}

#team-business-section .team-level-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

#team-business-section .team-level-heading > div > span {
    display: block;
    color: var(--team-brand);
    font-size: 7px;
    font-weight: 800;
    letter-spacing: .45px;
    text-transform: uppercase;
}

#team-business-section .team-level-heading h6 {
    margin: 2px 0 0;
    color: #304239;
    font-size: 12px;
    font-weight: 800;
}

#team-business-section .team-level-grid {
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 9px;
}

#team-business-section .team-level-member {
    min-width: 0;
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 11px;
    border: 1px solid #e2eae5;
    border-radius: 12px;
    background: #fbfcfb;
}

#team-business-section .team-level-member-copy {
    min-width: 0;
}

#team-business-section .team-level-member-copy strong,
#team-business-section .team-level-member-copy span {
    display: block;
}

#team-business-section .team-level-member-copy strong {
    margin-bottom: 5px;
    color: #35473d;
    font-size: 10px;
    line-height: 1.4;
}

#team-business-section .team-level-member-copy span {
    margin-top: 3px;
    color: #7c8981;
    font-size: 8px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

#team-business-section .team-level-member-copy i {
    width: 12px;
    margin-right: 4px;
    color: #92a097;
    text-align: center;
}

#team-business-section .team-level-empty {
    min-height: 140px;
    border: 1px dashed #d8e4dd;
    color: #7c8981;
    background: #fafcfb;
}

#team-business-section .team-level-empty > i {
    margin-bottom: 2px;
    color: var(--team-brand);
    font-size: 22px;
}

#team-business-section .team-search-loading {
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #718078;
    font-size: 9px;
}

#team-business-section .team-search-loading .spinner-border {
    color: var(--team-brand);
}

#team-business-section .team-search-result {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid #cfe2d7;
    border-radius: 13px;
    background: linear-gradient(135deg,#fbfefc,#f4faf7);
}

#team-business-section .team-search-result-icon {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    color: #fff;
    background: linear-gradient(135deg,#078b54,#12a66a);
    font-size: 12px;
    font-weight: 850;
}

#team-business-section .team-search-result-copy {
    min-width: 0;
}

#team-business-section .team-search-result-copy > span {
    display: block;
    color: var(--team-brand);
    font-size: 7px;
    font-weight: 800;
    letter-spacing: .45px;
    text-transform: uppercase;
}

#team-business-section .team-search-result-copy h6 {
    margin: 2px 0 5px;
    color: #304239;
    font-size: 12px;
    font-weight: 800;
}

#team-business-section .team-search-result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 12px;
}

#team-business-section .team-search-result-meta span {
    color: #718078;
    font-size: 8px;
}

#team-business-section .team-search-result-meta i {
    margin-right: 4px;
    color: #8e9b94;
}

@media (max-width: 991.98px) {
    #team-business-section .team-level-grid {
        grid-template-columns: repeat(2,minmax(0,1fr));
    }
}

@media (max-width: 600px) {
    #team-business-section {
        padding-bottom: 110px;
    }

    #team-business-section .team-business-hero {
        align-items: flex-start;
        gap: 12px;
        padding: 18px 16px;
        border-radius: 17px;
    }

    #team-business-section .team-business-hero-icon {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
        border-radius: 13px;
        font-size: 19px;
    }

    #team-business-section .team-business-hero h4 {
        font-size: 20px;
    }

    #team-business-section .team-business-hero p {
        font-size: 11px;
    }

    #team-business-section .team-business-load-btn {
        width: 42px;
        height: 42px;
        min-height: 42px;
        padding: 0;
        border-radius: 12px;
    }

    #team-business-section .team-business-load-btn span:not(.spinner-border) {
        display: none;
    }

    #team-business-section .team-business-stats {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    #team-business-section .team-stat-card {
        align-items: flex-start;
        gap: 9px;
        padding: 12px;
    }

    #team-business-section .team-stat-icon {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
        border-radius: 11px;
        font-size: 15px;
    }

    #team-business-section .team-stat-copy strong {
        font-size: 21px;
    }

    #team-business-section .team-stat-copy small {
        display: none;
    }

    #team-business-section .team-business-panel {
        padding: 16px;
        border-radius: 16px;
    }

    #team-business-section .hierarchy-tree-container .hierarchy-content {
        min-width: max-content;
    }

    #team-business-section .team-tree-level {
        width: min(780px, calc(100vw - 66px));
        min-width: 650px;
    }

    #team-business-section .hierarchy-tree-container .level-nodes {
        display: flex;
        gap: 8px;
    }

    #team-business-section .hierarchy-tree-container .tree-node {
        width: 170px;
        flex: 0 0 170px;
    }

    #team-business-section .team-business-current-room {
        align-items: flex-start;
        flex-direction: column;
    }

    #team-business-section .team-business-search-grid {
        grid-template-columns: 1fr;
    }

    #team-business-section .team-level-grid {
        grid-template-columns: 1fr;
    }

    #team-business-section .team-business-input-row {
        grid-template-columns: 1fr 68px;
    }

    #team-business-section .team-business-input-row button span {
        display: none;
    }

    #team-business-section .team-search-result {
        align-items: flex-start;
    }
}

@media (max-width: 380px) {
    #team-business-section .team-business-stats {
        grid-template-columns: 1fr;
    }
}
