.team-heading {
    align-items: center;
    gap: 24px;
}

.team-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin: 0 0 22px;
}

.team-stats article {
    min-height: 118px;
    padding: 22px;
    border: 1px solid #dce5ed;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(16, 42, 67, .06);
}

.team-stats small,
.team-invite-panel small {
    display: block;
    margin-bottom: 12px;
    color: #60758a;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
}

.team-stats b {
    color: #0b2b43;
    font-size: 32px;
}

.team-invite-panel {
    display: grid;
    grid-template-columns: minmax(220px, .75fr) minmax(420px, 1.25fr);
    gap: 34px;
    align-items: end;
    margin-bottom: 22px;
}

.team-invite-panel h2,
.team-section-heading h2 {
    margin: 0 0 8px;
}

.team-invite-panel p,
.team-section-heading p {
    margin: 0;
    color: #64768a;
}

.team-invite-form {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(150px, .55fr) auto;
    gap: 14px;
    align-items: end;
}

.team-invite-form label,
.team-actions label,
.team-transfer label {
    display: grid;
    gap: 7px;
    color: #183044;
    font-size: 14px;
    font-weight: 700;
}

.team-invite-form .btn {
    min-height: 47px;
    white-space: nowrap;
}

.team-list-card {
    margin-bottom: 22px;
    padding: 0;
    overflow: visible;
}

.team-section-heading {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 24px 18px;
    border-bottom: 1px solid #e6edf3;
}

.team-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.team-table {
    width: 100%;
    min-width: 820px;
    border-collapse: collapse;
}

.team-table th {
    padding: 13px 16px;
    background: #f5f8fb;
    color: #60758a;
    font-size: 12px;
    letter-spacing: .04em;
    text-align: left;
}

.team-table td {
    padding: 16px;
    border-top: 1px solid #e8eef4;
    color: #263d51;
    vertical-align: middle;
}

.team-table td:first-child strong,
.team-table td:first-child span {
    display: block;
}

.team-table td:first-child span {
    margin-top: 4px;
    color: #718295;
    font-size: 13px;
}

.team-role,
.team-member-status,
.team-delivery {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 10px;
    border-radius: 999px;
    background: #edf3f8;
    color: #36536b;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.team-role-owner,
.team-role-admin {
    background: #e2f1ff;
    color: #0866ad;
}

.team-role-accountant {
    background: #e7f8f1;
    color: #15734e;
}

.team-role-sales {
    background: #f1eafe;
    color: #6c3ab4;
}

.team-member-status.active,
.team-delivery.sent {
    background: #e5f7ed;
    color: #167449;
}

.team-member-status.suspended,
.team-delivery.failed {
    background: #fdeaea;
    color: #b3262e;
}

.team-delivery.pending {
    background: #fff4d8;
    color: #865f00;
}

.team-actions {
    position: relative;
}

.team-actions > summary,
.team-transfer > summary {
    color: #087bd3;
    cursor: pointer;
    font-weight: 800;
    list-style: none;
    white-space: nowrap;
}

.team-actions > summary::-webkit-details-marker,
.team-transfer > summary::-webkit-details-marker {
    display: none;
}

.team-action-menu {
    position: absolute;
    z-index: 8;
    right: 0;
    width: min(360px, calc(100vw - 56px));
    margin-top: 8px;
    padding: 18px;
    border: 1px solid #d9e3ec;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 18px 45px rgba(11, 43, 67, .18);
}

.team-action-menu form {
    display: grid;
    gap: 10px;
    margin: 0 0 14px;
}

.team-action-menu form:last-child {
    margin-bottom: 0;
}

.team-transfer {
    padding-top: 13px;
    border-top: 1px solid #e4ebf1;
}

.team-transfer form {
    margin-top: 13px;
}

.team-transfer p {
    margin: 0;
    color: #5f7184;
    font-size: 13px;
    line-height: 1.5;
}

.team-inline-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.team-inline-actions form {
    margin: 0;
}

.team-current-label {
    color: #718295;
    font-size: 13px;
    font-weight: 700;
}

.team-invite-card {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
}

.team-invite-card h2,
.team-invite-card > p {
    text-align: center;
}

.team-invite-icon {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: #e4f3ff;
    font-size: 30px;
}

.team-invite-providers {
    display: grid;
    gap: 10px;
    margin: 24px 0 18px;
}

.team-invite-expiry {
    margin-top: 18px;
    color: #718295;
    font-size: 13px;
    text-align: center;
}

@media (max-width: 1050px) {
    .team-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .team-invite-panel {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .team-heading {
        align-items: stretch;
    }

    .team-heading .btn {
        width: 100%;
        text-align: center;
    }

    .team-stats,
    .team-invite-form {
        grid-template-columns: 1fr;
    }

    .team-invite-panel,
    .team-section-heading {
        padding: 18px;
    }

    .team-stats article {
        min-height: 96px;
    }
}
